query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
bb73d877902086312a58f05982c9bca8 | GET /bugs/1 GET /bugs/1.json | [
{
"docid": "6513fc85196e4053eb01f465a4845c38",
"score": "0.0",
"text": "def show \n# @project\n end",
"title": ""
}
] | [
{
"docid": "efd6fd9e50cc1df2a7f32b5ea9144c86",
"score": "0.8061156",
"text": "def show\n @bugs = Bug.find(params[:id])\n # render :json => @bugs\n end",
"title": ""
},
{
"docid": "1d528ab87be91ed775d466f08432336d",
"score": "0.7829508",
"text": "def index\n p params\n @b... |
95316e3ee224b2fd9351a10aaa4ae650 | Matches menu item against the actual path it's pointing to. Is only applied when :path option is not present. | [
{
"docid": "5e178fe76c25a5d9382b51ffbdbb5bb7",
"score": "0.6232169",
"text": "def item_href_match?(item)\n if item[:href]\n item_href = item[:href].chomp('/')\n if (@current_path == item_href) or # IF path matches perfectly\n (item[:match_... | [
{
"docid": "178b5c63a09b3f62e2e54c39ceacd698",
"score": "0.69877666",
"text": "def selected_item?(item)\n # Ensure we match the path without the locale, if present.\n path = match_locale_for(encoded_path)\n\n # First try to match against a \"menu match\" value, if available.\n ... |
b109fe1010364c83080e1c6fc7d1b84c | count = sum = 0 text = "0" 12.times do count += 1 sum += count text += " + " + count.to_s puts text + " = " + sum.to_s end | [
{
"docid": "5b08a9c2586392b1d9735119910bb6f4",
"score": "0.0",
"text": "def countPresents(days)\n\tcount = sum = 0\n\tdays.times do\n\t\tcount += 1\n\t\tcountdown = count\n\t\tcount.times do\n\t\t\t#puts \"Adding #{countdown} to #{sum}\"\n\t\t\tsum += countdown\n\t\t\tcountdown -= 1\n\t\tend\n\tend\n\tp... | [
{
"docid": "26d92575db09fa78b417f1cd1dbb811f",
"score": "0.6934322",
"text": "def sum(number)\n count = 0\n split = number.to_s.split('')\n split.each do |num|\n # num = num.to_i\n # count = count + num\n count += num.to_i\n end\n count\nend",
"title": ""
},
{
"docid": "a53d591... |
bcc4828b80e2b919e89ee0a537de2239 | Renders the first step for resetting the PIN GET /reset_pin | [
{
"docid": "75cbee6aef5b146ac9cb5a1fec01024d",
"score": "0.0",
"text": "def index; end",
"title": ""
}
] | [
{
"docid": "28c9e98bd4a4195ccd6610800d5194a3",
"score": "0.7525067",
"text": "def reset\n @response = symphony_client.reset_pin(\n params['library_id'],\n change_pin_with_token_unencoded_url\n )\n flash[:success] = t 'mylibrary.reset_pin.success_html', library_id: params['library_id']... |
7f2cfe14794d12fbf500dc24b410df83 | POST /donations POST /donations.xml | [
{
"docid": "4a92fb7f10d3bb72760cb49de6cd6c3c",
"score": "0.56277865",
"text": "def create\n @donation = Donation.new(params[:donation])\n\n # check for bulk import\n if(params[:bulk])\n bulk_create\n else\n\n respond_to do |format|\n if @donation.save\n flash[:no... | [
{
"docid": "785956421c8979ca44608c3ed406638a",
"score": "0.6646222",
"text": "def create\n @donation = Donation.new(params[:donation])\n @donation.processed = false\n @charity = Charity.find(@donation.charity_id)\n\n if @donation.save\n #@base_url = root_url.to_s\n #@base_url.gsub!... |
d654b142b9f2753c319583991e799d7c | PUT /subscribers/1 PUT /subscribers/1.json | [
{
"docid": "e4c137059cc065eedace98776eef8148",
"score": "0.6348288",
"text": "def update\n @subscriber = Subscriber.find(params[:id])\n respond_to do |format|\n if @subscriber.update_attributes(subscriber_params)\n if session[:subscriber]\n session[:subscriber] = nil\n ... | [
{
"docid": "4b1801346efa7ca16513f4ed93549e61",
"score": "0.7483299",
"text": "def update\n if @subscriber.update(subscriber_params)\n render json: @subscriber, status: :ok\n else\n render json: @subscriber.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
... |
ca605e4ea269cf1023eaab29f5e0aede | Having some trouble cleanly linking the VK client Auth API with OmniAuth. This is because their JS API doesn't provide oauth tokens. So, we're verifying userid manually and then injecting users using client data. FIXME: The user info here (name, etc. but not VK id) is actually unconfirmed, and can suffer from client fr... | [
{
"docid": "bab0cd681950d35d5583ce68707706be",
"score": "0.70430475",
"text": "def create_vkclient\n \n #logger.debug \"COOKIE: #{ request.cookies[\"vk_app_#{ENV['VKONTAKTE_KEY']}\"] }\"\n\n if !verify_vk_signature( request.cookies[\"vk_app_#{ENV['VKONTAKTE_KEY']}\"] )\n render :json => { ... | [
{
"docid": "30670ba6ca2071290789669faeae4941",
"score": "0.6673655",
"text": "def link_vkclient\n vk_cookie = request.cookies[\"vk_app_#{ENV['VKONTAKTE_KEY']}\"]\n if !verify_vk_signature( vk_cookie )\n render :json => { :status => 'failure', :error => I18n.t('messages.vk_sig_failed') }\n ... |
d4a1edaae4d92d004632cf64501ce2e7 | DELETE /users/1 DELETE /users/1.json | [
{
"docid": "15bbd6148634eeae1703a9d0983f5a27",
"score": "0.0",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1",
"score": "0.7590564",
"text": "def test_delete_user\n delete '/users/2'\n data = JSON.parse last_response.body\n\n assert_equal 'Daniel', data['name'], 'Propiedad name incorrecta'\n assert_equal 'Arbelaez', data['last_name'], 'Propiedad last_nam... |
ead6a94113408addddd7fda3ad61cc24 | POST /project/phase/activities or /project/phase/activities.json | [
{
"docid": "c0569c6fc098b1fade5eae5f2c0b12cd",
"score": "0.69677496",
"text": "def create\n @project_phase_activity = Project::Phase::Activity.new(project_phase_activity_params)\n @project_phase_activity.project_phase = Project::Phase.find_by_id(params[:phase_id])\n if can? :create,... | [
{
"docid": "915bcea78ac5029432aa74b590bcf85c",
"score": "0.68862635",
"text": "def create\n @activity = @user.activities.create!(params[:activity])\n \n @activity.add_to_goal(params[:goal_id]) unless params[:goal_id].blank?\n\n respond_to do |format|\n if @activity\n format.html ... |
a84f5a0b051fec04ca02c309441d7e1b | for it to be true, you need to set your input to the table of brotherhood | [
{
"docid": "1596760dd6625e6352139e2180310e69",
"score": "0.62771964",
"text": "def sit_at_table(people)\n return @table_of_brotherhood = people\n end",
"title": ""
}
] | [
{
"docid": "254612fef0362a7453a9dbfde2ca70e8",
"score": "0.6267881",
"text": "def truth_table\n @truth_table ||= generate_truth_table(@user_input)\n end",
"title": ""
},
{
"docid": "a010cb5a3695248f92d618f641b5b120",
"score": "0.5963633",
"text": "def table?(table)\n !ta... |
6cbac47fad672f997ff33f3d231e7f50 | Place the order with the broker. Negative contracts denote a short rather than a long. Returns the orderID (not wrapped in an oStruct), or throws an exception if the order did not take for some reason. | [
{
"docid": "b3c8fece5638cfb4f1eea9e2246166cc",
"score": "0.6811971",
"text": "def placeBrokerOrder(ee, sym, contracts, limit = 0, stop = 0)\n raise MarketException.new(\"Direction Parameter Error #{ee}: must be either #{PLACE_ORDER_DIRECTIONS}\") unless PLACE_ORDER_DIRECTIONS.member? ee\n contract... | [
{
"docid": "9ff18810156ef4659b855f3d36dcaf04",
"score": "0.6911759",
"text": "def place_order(exchange, tradingsymbol, transaction_type, quantity, product,\n order_type, price = nil, trigger_price = nil, tag = nil, variety = nil)\n params = {}\n exchange_type = exchange || \"NSE\"... |
3562c9bd5045410f789974d4c5d62258 | PUT /things/1 PUT /things/1.xml | [
{
"docid": "9565bf2acfb1afd5b8564b00dc89ebc1",
"score": "0.62016463",
"text": "def update\n @thing = Thing.find(params[:id])\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n flash[:notice] = 'Thing was successfully updated.'\n format.html { redirect_to(... | [
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.6699646",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.66605914",
"text": "def update opts = {}\n opts[:headers] ||= ... |
f869bea360634cdbdb20df029405dac3 | POST /contact_requests POST /contact_requests.json | [
{
"docid": "6c800c2b8e323106195abf391014b184",
"score": "0.5799549",
"text": "def create\n @contact_request = ContactRequest.new(params[:contact_request])\n if @contact_request.valid?\n User.administrators.each { |user|\n ContactMailer.send_contact_request(@contact_request, user).deliv... | [
{
"docid": "5904e4b23737c8cdcc6268982df53c59",
"score": "0.70488405",
"text": "def create\n contact_request = ContactRequest.create(contact_request_params)\n\n if contact_request.new_record?\n render json: { errors: contact_request.errors.messages }, status: 422\n else\n render json: ... |
7c642aff0c3b3b7ba1a82c0ad7e9a56f | Process the standard each_with_index operator. | [
{
"docid": "64084792692551ee89ce45b3b8d8ed00",
"score": "0.79646873",
"text": "def each_with_index(&block)\r\n if block_given?\r\n process_all {|index, posn| block.call(@array_data[posn], index)}\r\n self\r\n else\r\n self.to_enum(:each_with_index)\r\n end\r\n end",
"title":... | [
{
"docid": "b82bd85f5af3877e113c3f6f24d16e0a",
"score": "0.82377714",
"text": "def each_with_index(&block)\n end",
"title": ""
},
{
"docid": "3811125686a6ac4a2f2d4f180a3bddec",
"score": "0.7851655",
"text": "def each_with_index(&block)\n to_a.each_with_index(&block)\n ... |
62aabf003f8249dcc42c4450e918b239 | Public: An array of sites Returns the Jekyll sites created. | [
{
"docid": "68863517a9d05bb042cefb88869d9eb0",
"score": "0.778015",
"text": "def sites\n @sites ||= []\n end",
"title": ""
}
] | [
{
"docid": "162570ba204e9f095b3b30c2e674991a",
"score": "0.72195315",
"text": "def sites\n result = call(\"Webs\", \"get_web_collection\")\n result.xpath(\"//sp:Web\", NS).map { |web| Site.new(connection, web[\"Url\"].to_s, @depth + 1) }\n end",
"title": ""
},
{
"docid": "5c5116... |
8bed22caa2365ec89274314d51b75b11 | Exhumes a buried unit. Responds to `POST /units/:id/undelete` | [
{
"docid": "fd3c7440b4c56b0297c7e48d70ae3a42",
"score": "0.77170825",
"text": "def undelete\n ActiveRecord::Base.transaction do\n @unit.exhume!\n end\n rescue => e\n flash['error'] = \"#{e}\"\n else\n RefreshOpensearchJob.perform_later\n toast!(title: \"Unit undeleted\",\n ... | [
{
"docid": "19b781c04afbd7ad9bc7469c579239b5",
"score": "0.7151063",
"text": "def delete\n unit_institution = @unit.institution\n ActiveRecord::Base.transaction do\n @unit.bury!\n end\n rescue => e\n flash['error'] = \"#{e}\"\n redirect_to @unit\n else\n RefreshOpensearchJob.per... |
0e26109245a73438c2f61b89d2642f7f | method to get one and only one candidate from a party | [
{
"docid": "2320a9ef3d5c1a50739147c870b10577",
"score": "0.78483987",
"text": "def get_candidate(party)\n candidate = nil\n @politicians.each do |politician|\n if politician.get_party == party\n candidate = politician\n end\n end\n candidate\nend",
"title": ""
}
] | [
{
"docid": "a668ed5d3f459df98350a8572bc4e9fc",
"score": "0.71861863",
"text": "def get_candidate\n candidate = Candidate.find_by_id(self.candidate.first.resource_id)\n return candidate\n end",
"title": ""
},
{
"docid": "6e8e5eaa43ffb9753c8f1f2a5bdcc3f7",
"score": "0.66619474",
... |
882591cf5c982a7e3d8b1c35207dbecb | Write a method that returns a list of all substrings of a string that start at the beginning of the original string. The return value should be arranged in order from shortest to longest substring. input: string output: list of substrings starting at beginning of string arrange in order from shortest to longest init em... | [
{
"docid": "1859b33c098249d9efbe34e152b62e08",
"score": "0.85298157",
"text": "def substrings_at_start(string)\n array = []\n counter = 0\n loop do\n array.push(string.slice(0..counter))\n counter += 1\n break if counter == string.length\n end\n array\nend",
"title": ""
}
] | [
{
"docid": "7478e8a54e55cabaf163ccaf85b386ba",
"score": "0.8530739",
"text": "def substrings_at_start(string)\n array = []\n counter = 0\n loop do\n array.push(string[0..counter])\n counter += 1\n break if counter == string.length\n end\n array\nend",
"title": ""
},
{
"docid": ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "2d21438b9a74c49b95c56ca74bb633f9",
"score": "0.0",
"text": "def set_community_tag\n @community_tag = CommunityTag.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "d... |
dc7c90f09dd6ba6e82cf9d1687a95578 | Extracts num pages from MARC. May be nil. | [
{
"docid": "2e151e08ba77da57c81e6656cc490b05",
"score": "0.68198574",
"text": "def num_pages \n if source_record['300'] && (source_record['300']['a'] =~ /(\\d{1,6}) ?pp?(?:[\\. ]|\\Z)(?!.*\\d+ pp?(?:[\\. ]|\\Z))/)\n return $1\n end\n\n return nil\n end",
"title": ""
}
] | [
{
"docid": "6e50dcc7fb57ca0ed22156658cb8690c",
"score": "0.6994649",
"text": "def extract_total_pages\n pag = setup.fetch_page.css('.Ver12C')[70].text\n pag.scan(/\\d+/)[2].to_i\n end",
"title": ""
},
{
"docid": "83c188d0f0a36180d295f39587cc2b3e",
"score": "0.67066765",
... |
900d05b256905a273f94fa9c5dcbf328 | GET Renders pending users. | [
{
"docid": "1883062bc026c030c1afc0800021fa70",
"score": "0.7581021",
"text": "def pending_users\n @users = User.where(private_files_project: nil)\n\n @users_grid = initialize_grid(@users)\n render \"admin/users/pending\"\n end",
"title": ""
}
] | [
{
"docid": "23ec75a8b1ebe7957d0e12970c43f538",
"score": "0.7716466",
"text": "def pending_users\n @pending_users = User.find(:all, :conditions => {:enabled => false, :activation_code => !nil})\n render :partial => 'pending_users'\n end",
"title": ""
},
{
"docid": "23ec75a8b1ebe7957d0e... |
046b02cae29b302eefc6412440e94e1f | DELETE /appointments/1 DELETE /appointments/1.json | [
{
"docid": "1d39f07faac0a093173e66e92b0b0014",
"score": "0.77010787",
"text": "def destroy\n @appointment.destroy\n respond_to do |format|\n format.html { redirect_to appointments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "bf8c21831c69d832d807c39d5bf67394",
"score": "0.80352926",
"text": "def delete_appointment\n\t\tid = grab_id(\"delete\")\n\t\taddress = @url + \"/\" + id\n\t\tresponse = HTTParty.delete(address)\n\t\tresponse.body\n\tend",
"title": ""
},
{
"docid": "761cfe19688ad8e3010fa2e15ee3cb... |
aa61cc508d6a4c6262737a7533f25f3b | Logged in verification with error message. | [
{
"docid": "1bfbcb3d52eee2c17a94425d1499829e",
"score": "0.6547577",
"text": "def logged_in_verification\n if is_logged_in?(session)\n @user = current_user(session)\n else\n flash[:message] = \"You must be logged in to access that page.\"\n redirect \"/login\"\n end\n... | [
{
"docid": "e69543b27955158686cfddd72a3e5d70",
"score": "0.71977246",
"text": "def note_failed_signin\r\n flash[:error] = \" Invalid user/password combination.\"\r\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\r\n end",
"title": ""
},
... |
84a6f75e72f420e4133a8b9d08a7e6d0 | rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength | [
{
"docid": "33594276ad592c527fec77ea5ec8c2e4",
"score": "0.0",
"text": "def compute_and_save_effort(day_to_effort, assignment, top_effort_assignment, transition)\n demand = assignment.demand\n return if day_off?(day_to_effort, demand)\n\n membership = assignment.membership\n return if member... | [
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.6547891",
"text": "def used; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.6547891",
"text": "def used; end",
"title": ""
},
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"sc... |
4f8797772b1be923abeb5b9138739446 | TODO: Improve this method AbcSize TODO: Improve policy usage rubocop:disable Metrics/AbcSize | [
{
"docid": "1de25d13fb059c4645aa8cc717c93f6e",
"score": "0.0",
"text": "def register(data)\n attendee = Attendee.find(data['attendeeId'])\n packet_id = data['packet_id']\n serial = data['serial']\n machine = attendee.event.machines.find_by(check_points: { registrar: current_user })\n retu... | [
{
"docid": "74f497175b70fd0dcc0419cc95b52953",
"score": "0.59330016",
"text": "def agency_abv; end",
"title": ""
},
{
"docid": "ee1e04a5dfc4f69cc08792c48aa924e3",
"score": "0.57254165",
"text": "def policy; end",
"title": ""
},
{
"docid": "f1d76f4c19f330f525cd7a12a7d871b9... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "83f6ab52f5638f5eaa679ff7fdad9803",
"score": "0.0",
"text": "def tipus_indicador_params\n params.require(:tipus_indicador).permit(:nom_ca, :nom_es, :nom_en, :unitats, :descripcio_ca, :descripcio_es, :descripcio_en)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
afb2429dcb18b231431b46d3292fbda4 | Removes the record with the given id. | [
{
"docid": "7c275271ac087d7055fd2ae1687e73df",
"score": "0.7533764",
"text": "def delete(id)\n if @records.has_key?(id)\n MemoryRecord.new(@records.delete(id).to_hash.merge(id: id))\n end\n end",
"title": ""
}
] | [
{
"docid": "06a8acdeee40bcb94a52589914f64dc6",
"score": "0.81513613",
"text": "def remove_record(id)\n id = id.to_i\n if @records[id]\n @records[id] = nil\n true\n end\n end",
"title": ""
},
{
"docid": "6574281ef281bee47dafd94a1ce5f19f",
"score": "0.778214... |
5baf050b5f1690efd5a99e9e69ee4d10 | Gets the severity property value. The severity property | [
{
"docid": "3df3518dc5aba8e2f9542291501acde0",
"score": "0.8601677",
"text": "def severity\n return @severity\n end",
"title": ""
}
] | [
{
"docid": "87e3b05a7d0c206c41e05e02fd513872",
"score": "0.85213464",
"text": "def severity\n @severity\n end",
"title": ""
},
{
"docid": "87e3b05a7d0c206c41e05e02fd513872",
"score": "0.8520482",
"text": "def severity\n @severity\n end",
"title": ""
},
{
"... |
8dfb5b8c8d4a09691d09955ce7c7fc74 | Get the "dynamic sessions in URL" for this policies. | [
{
"docid": "eb911712404bf10db4e5f6d6f1213538",
"score": "0.7095947",
"text": "def dynamic_sessions_in_url\n super\n end",
"title": ""
}
] | [
{
"docid": "2349ef0a813151f3f84ad2b5c48b48a7",
"score": "0.6208554",
"text": "def set_dynamic_sessions_in_url(opts)\n opts = check_params(opts,[:settings])\n super(opts)\n end",
"title": ""
},
{
"docid": "21dfd480cc14b1d001e87c32f7d1786c",
"score": "0.5649912",
"text": "... |
a7efd3492e793bacb01e7ebf020a355d | PATCH/PUT /wallpapers/1 PATCH/PUT /wallpapers/1.json | [
{
"docid": "b0236384faa103d5fda0ae5fabe2ebb8",
"score": "0.6838347",
"text": "def update\n authorize! :update, @wallpaper\n respond_to do |format|\n if @wallpaper.update(wallpaper_params)\n format.html { redirect_to @wallpaper, notice: 'Wallpaper was successfully updated.' }\n f... | [
{
"docid": "3028082393b6e2eb617363c4c208f5dd",
"score": "0.6942448",
"text": "def update\n @wallpaper = Wallpaper.find(params[:id])\n\n respond_to do |format|\n if @wallpaper.update_attributes(params[:wallpaper])\n format.html { redirect_to @wallpaper, notice: 'Wallpaper was successful... |
0ac59257b0aac08462e1f9e68176ef0f | Bulk Delete SLO Timeframes. Delete (or partially delete) multiple service level objective objects. This endpoint facilitates deletion of one or more thresholds for one or more service level objective objects. If all thresholds are deleted, the service level objective object is deleted as well. | [
{
"docid": "7781a21426068cd750cc06f8d6bda677",
"score": "0.67299604",
"text": "def delete_slo_timeframe_in_bulk_with_http_info(body, opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ServiceLevelObjectivesAPI.delete_slo_timeframe_in_bulk ...'\n ... | [
{
"docid": "c09b3ef924777a4d7e85dedaf87dd5be",
"score": "0.7049851",
"text": "def delete_slo_timeframe_in_bulk(body, opts = {})\n data, _status_code, _headers = delete_slo_timeframe_in_bulk_with_http_info(body, opts)\n data\n end",
"title": ""
},
{
"docid": "1db333fe95dc27dfc88d... |
9ca69d7fac3da68b1d722702e09fe0b8 | GET /staffs/new GET /staffs/new.json | [
{
"docid": "a4dc65e75169b49cbf31af7b8535b50a",
"score": "0.83042973",
"text": "def new\n @staff = Staff.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @staff }\n end\n end",
"title": ""
}
] | [
{
"docid": "de2589a13d9fd33e908cb13b05ff4876",
"score": "0.833271",
"text": "def new\n @staff = Staff.new\n\n @page_title = t(:create_new_staff)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @staff }\n end\n end",
"title": "... |
365c7d5afb20d71a80ad81337ccf6f03 | Not using this yet since the secure_compare method seems to be broken on our version of ruby. def verify_signature(request) request.body.rewind payload_body = request.body.read signature = 'sha1=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), ENV['SECRET_TOKEN'], payload_body) return halt 500, "Signatures didn... | [
{
"docid": "2db46d5fbbf4c9045f951982627b506d",
"score": "0.0",
"text": "def deploy_r10k(data)\n\t\tub_ary = get_data(data)\n\t\tuser = ub_ary[0]\n\t\tenviro = ub_ary[1]\n\t\tsha = ub_ary[2]\n\t\tLOG.info(\"User #{user} deploying to environment #{enviro} on #{Time.now}\")\n\t\tLOG.info(\"SHA for commit i... | [
{
"docid": "0feb50d634c80704e369e8b9b8e08573",
"score": "0.9010205",
"text": "def verify_signature(payload_body)\n signature = 'sha1=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), ENV['SECRET_TOKEN'], payload_body)\n return halt 500, \"Signatures didn't match!\" unless Rack::Utils.secure_com... |
e8d191140b51cb297a5432598510aeeb | Get email content as HTML. For displaying emails in browser context. Retrieve email content as HTML response for viewing in browsers. Decodes quotedprintable entities and converts charset to UTF8. Pass your API KEY as a request parameter when viewing in a browser: `?apiKey=xxx`. Returns contenttype `text/html;charset=u... | [
{
"docid": "d3fb7ba526fd45495770b9b6cd1047af",
"score": "0.65999603",
"text": "def get_email_html(email_id, opts = {})\n data, _status_code, _headers = get_email_html_with_http_info(email_id, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "583586d5a5c2bf80390afbef87536c5f",
"score": "0.69976026",
"text": "def html\n email.html\n end",
"title": ""
},
{
"docid": "cfe017961c07d4a5e999f1532b8f67c7",
"score": "0.6777522",
"text": "def get_email_html_with_http_info(email_id, opts = {})\n if @api_clie... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "493ad1a848fe6bdcaa9f22b2b6dd238e",
"score": "0.0",
"text": "def set_job\n @job = Job.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "d... |
6551a2ec6fec2414075c04bd96c80c45 | CTT05 Id: 183 Name: Volume Type: R Min/Max: 1/8 Description: Value of volumetric measure | [
{
"docid": "d7b5c2017f412035b73de8e56605609e",
"score": "0.0",
"text": "def CTT05=(arg)",
"title": ""
}
] | [
{
"docid": "2f78e4fcc460f17d6b45f56138cc1d9e",
"score": "0.68743867",
"text": "def series_volume\n end",
"title": ""
},
{
"docid": "3984514a4b36b8df264f57bdfc1977d2",
"score": "0.67684275",
"text": "def get_volume\n\n # get the keyword value of \"SHAPE\"\n shape = get_... |
29ff2fd0f1cebed82492ca7c47061395 | the logic to store the new data into the database | [
{
"docid": "748959242247460bbf20ae613317c23a",
"score": "0.0",
"text": "def create\n @movie = Movie.new(movie_params)\n @movie.save # (for the save goes with instance variable we can not use is with Movie model.) params have all the access to the data in the database.for we don't have any data i... | [
{
"docid": "de21b4276061b96f1e1e410cb642428f",
"score": "0.7084896",
"text": "def save\r\n @new_record ? insert : update\r\n end",
"title": ""
},
{
"docid": "eb353698abb9b41d22b5aebb5bf43d35",
"score": "0.7074687",
"text": "def persist new_vals\n #persist the new value... |
8815572d31272c0470b4beae407c07fa | Deletes this Zones in this views. | [
{
"docid": "e394873198e08f08db2548bde15a8461",
"score": "0.6802489",
"text": "def delete_zone(opts)\n opts = check_params(opts,[:view_zones])\n super(opts)\n end",
"title": ""
}
] | [
{
"docid": "8451c96b94b72fcf95929b13aa774aef",
"score": "0.69175214",
"text": "def destroy\n @zones = Zone.all\n @zone = Zone.find(params[:id])\n @zone.destroy\n\n end",
"title": ""
},
{
"docid": "ccacbc32aac6d656eaabf1515183828d",
"score": "0.680858",
"text": "def delete\n... |
73d35470c47c337c5780759d37526015 | if the user types in a number, use as the length of the wall | [
{
"docid": "175f5916404442c62d34c2bcf284ffc9",
"score": "0.5938693",
"text": "def onUserText(text, view)\r\n # The user may type in something that we can't parse as a length\r\n # so we set up some exception handling to trap that\r\n begin\r\n value = text.to_l\r\n rescue\r\n #... | [
{
"docid": "87a4bef84582c6ffea9c0c53177e612f",
"score": "0.67239225",
"text": "def get_dimension_length\n puts('Enter the length of the room in meters: ')\n length = gets.chomp\n length.to_f\nend",
"title": ""
},
{
"docid": "91b33432d4f443df5ec1a64702adec08",
"score": "0.6642995",
... |
fed8f3cb6a320288873e02cb83d031c7 | Called on the closing CDATA tag. | [
{
"docid": "247c14a87acc2b6055cc67e4d1739be5",
"score": "0.82123667",
"text": "def on_cdata_end\n add_token(:T_CDATA_END)\n end",
"title": ""
}
] | [
{
"docid": "e812445fe6e9d58f6893b9c24f4865b7",
"score": "0.63873863",
"text": "def escape_cdata_end(string)\n string.gsub(']]>', ']]>')\n end",
"title": ""
},
{
"docid": "ca3b4cc8b0a010627fde8d9fd39b417e",
"score": "0.6196915",
"text": "def on_cdata_body(value)\n add_to... |
ae7dd777b5636db1d7f88a0e5b73326b | Captures a previously authorized payment. If the gross amount of the invoice has changed between authorization and capture, the difference in case authorization amount capture amount > 0 will be refunded to the respective account, otherwise an exception thrown. Only payments can be captured, not deposits. E.g. | [
{
"docid": "d6e934e465aef3f568560c9283ef1abc",
"score": "0.70691097",
"text": "def capture(options={})\n transaction do\n if authorization\n capture_result = authorization.class.capture(\n gross_total,\n authorization_reference,\n payment_options(aut... | [
{
"docid": "1f1efabee1497854b189979894c0597b",
"score": "0.7402077",
"text": "def capture_invoice(invoice)\n payment = invoice.capture_payment({})\n self.pay! if payment.success\n payment\n end",
"title": ""
},
{
"docid": "1d5b106c67be1d9b1ac8ab8ee5e08d52",
"score": "0.73103267... |
492ac38ec154f2b2657bf736e5bc018b | ++ This is for testing a custom validation, 'validate_patient_name'. | Patient First Name and Patient Last Name should contain alphabets/numbers/ hyphens/periods only | Input : Patient_first_name and patient_last_name contain valid data and | patient_middle_initial contains valid data. | Output : Returns true. | Author... | [
{
"docid": "be8ec97a88c1d5b62f7f6dbe674c3afe",
"score": "0.7128339",
"text": "def test_validate_patient_name_by_giving_valid_data\n eob = InsurancePaymentEob.new\n eob.patient_first_name = \"gh.gh\"\n eob.patient_last_name = \"h-gfhj\"\n eob.patient_middle_initial = \"hj\"\n eob.save\n ... | [
{
"docid": "95e619013da1ec99ae5f628f4833d3e8",
"score": "0.78637946",
"text": "def validate_first_and_last_name\n error_message = \"\"\n error_message += \"First/Last Name should be Alphanumeric, hyphen or period only!\" if $IS_PARTNER_BAC &&\n !last_name.blank? && !first_name.blank? &&\n ... |
936cc609cf2d00a9e568120eea476135 | before_action :set_tag, only: [:show, :edit, :update, :destroy] GET /tags GET /tags.json | [
{
"docid": "6921edaf5ebf599c4830017a15590364",
"score": "0.0",
"text": "def index\n @tags = Tag.all.paginate(:page => params[:page], :per_page => 10)\n end",
"title": ""
}
] | [
{
"docid": "c7a65eb50d9d5164414ca3539af31e71",
"score": "0.69992614",
"text": "def tag\n tag = params[:tag]\n filter = params[:filter] || 'all'\n sort = params[:sort] || 'default:asc'\n\n if request.format.html?\n redirect_to \"/ov/#!/tag/#{tag}/#{filter}/#{sort}\"\n return\n en... |
1f66e8492a5230e4b4dea5a6deedf98a | Returns the value of attribute request. source://restclient//lib/restclient/abstract_response.rb8 | [
{
"docid": "c5036a247d6d36888e108137980f43eb",
"score": "0.0",
"text": "def request; end",
"title": ""
}
] | [
{
"docid": "71d2a677a83a573722bb7924c18b2f02",
"score": "0.65958714",
"text": "def requests_get\n @attributes[:requests_get]\n end",
"title": ""
},
{
"docid": "e64e56900fc6efc90f593e48656345b1",
"score": "0.645755",
"text": "def request\n response.request\n end",
... |
32c8aeb7df11a9c3176edd23719a4700 | characters and ignoring cases. Example 1: Input: s = "A man, a plan, a canal: Panama" Output: true Explanation: "amanaplanacanalpanama" is a palindrome. Example 2: Input: s = "race a car" Output: false Explanation: "raceacar" is not a palindrome. Constraints: 1 <= s.length <= 2 105 s consists only of printable ASCII ch... | [
{
"docid": "e5702bb992bbd8013098fa0703f76f08",
"score": "0.7729876",
"text": "def is_palindrome(s)\n s = s.downcase.delete \"^a-z0-9\"\n s == s.reverse\n\n\nend",
"title": ""
}
] | [
{
"docid": "469b2a3b2883cae4ee34cd06e5a92fa7",
"score": "0.81863374",
"text": "def is_palindrome(s)\n if s.nil? || s.length === 0\n return true\n end\n\n characters = []\n for i in 0...s.length\n ascii_char = s[i].ord\n if (ascii_char > 64 && ascii_char < 91) || (ascii_char > 96 && ascii_ch... |
7f2b5359db6a0335c3586aaf7f09d5b7 | Set the value of password_confirmation_field | [
{
"docid": "34fa2d416dfd1379952588740518b154",
"score": "0.864248",
"text": "def password_confirmation_field=(value)\n # This is a stub, used for indexing. The method is dynamically generated.\n end",
"title": ""
}
] | [
{
"docid": "15987b094a496e35eb198f0739dc88d1",
"score": "0.85637784",
"text": "def password_confirmation=(value)\n @password_confirmation = value\n end",
"title": ""
},
{
"docid": "e30a178d4413d8571df24254e4f8df0a",
"score": "0.82938105",
"text": "def password_confirmation=(v... |
73648bb27bf4718449269f749acc3878 | GET /post115s/1 GET /post115s/1.xml | [
{
"docid": "51bbd3fcb0df55956952d5b8b7f32e2b",
"score": "0.6578412",
"text": "def show\n @post115 = Post115.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post115 }\n end\n end",
"title": ""
}
] | [
{
"docid": "25a71f4e99b932e6be094421d675f7d5",
"score": "0.6518589",
"text": "def show\n @post185 = Post185.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post185 }\n end\n end",
"title": ""
},
{
"docid": "6ced72... |
131dc1d07b5680edc0d7ab2a4ad34679 | def link(uri) TODO: fail if type already set TODO: set uri and merge in query params from provided uri if any self end | [
{
"docid": "b4da9823ea1d0baf3cd4dcc48169ef75",
"score": "0.0",
"text": "def all\n raise ArgumentError, \"No type specified for query\" if @type.nil?\n\n @store.load_from_url(uri_builder.resources_uri(@type, to_query))\n end",
"title": ""
}
] | [
{
"docid": "3aa78fbcc5391f3fe77bba3bd3d24a6d",
"score": "0.67318064",
"text": "def link uri\n self.apply_hyperlink java.net.URI.new(uri)\n end",
"title": ""
},
{
"docid": "da5906cb3c535f56783cfde50fca3929",
"score": "0.670175",
"text": "def uri=(_arg0); end",
"title": ""
... |
0869a81fe604718390fe7319d3b86d92 | possibly n (slice! (?)) | [
{
"docid": "47d7f27bc152e98a5657bc1c1f3ecc77",
"score": "0.0",
"text": "def second_anagram?(word1, word2)\n word1.each_char do |char|\n index = word2.index(char)\n word2.slice!(index)\n end\n\n if word2.empty?\n true\n else\n false\n end\n\nend",
"title": ""
}
] | [
{
"docid": "6950c761f1a7b353d040e84a72e34add",
"score": "0.64383394",
"text": "def slice!(p0, *rest) end",
"title": ""
},
{
"docid": "6950c761f1a7b353d040e84a72e34add",
"score": "0.64383394",
"text": "def slice!(p0, *rest) end",
"title": ""
},
{
"docid": "5290ae5aa398bcd5... |
6148a5b6d375fafe92606f401da7047a | Update work order, charge account and store text fields at view from project select | [
{
"docid": "206bc038258ed003fa06704d7fdc1842",
"score": "0.75298804",
"text": "def si_update_charge_account_from_project\n project = params[:order]\n projects = projects_dropdown\n if project != '0'\n @project = Project.find(project)\n @work_order = @project.blank? ? work_or... | [
{
"docid": "d8f478030a2b6512d64c064bfe45fce5",
"score": "0.7565097",
"text": "def of_update_charge_account_from_project\n project = params[:order]\n projects = projects_dropdown\n if project != '0'\n @project = Project.find(project)\n @work_order = @project.blank? ? work_ord... |
3156248e51333eb502e0d526e6b21242 | Start the process and return pipes to its standard streams. | [
{
"docid": "83325115357dac7f4e85ff1ae4643772",
"score": "0.0",
"text": "def popen\n @pid, i, o, e = Open4.open4(@command_and_args.join(' '))\n [i, o, e]\n end",
"title": ""
}
] | [
{
"docid": "1479b76539866862f75dc7c090e0e4c4",
"score": "0.72323453",
"text": "def start_process # :nodoc:\n # Open a pipe to monitor the child startup\n r, w = IO.pipe\n\n @pid = fork do\n # Open the redirection outputs\n stdout, stderr = n... |
e13c0656980cbba5dcc3f8d60916cea0 | Use this to raise internal error with a given message. This works for all modes production, development, etc. | [
{
"docid": "bf1a020aeff542f805c09f4bbd20c3f8",
"score": "0.777365",
"text": "def internal_error(message = 'internal error')\n raise message\nend",
"title": ""
}
] | [
{
"docid": "0854a82208d020deef1a9ec7d8562ad8",
"score": "0.71817625",
"text": "def error(message)\n raise Error, message\n end",
"title": ""
},
{
"docid": "d8796ab174393985e941282783a5ac59",
"score": "0.71337295",
"text": "def error(message)\n if Config[:raise] === t... |
426c7c9c0bceec59b129d3439c975cea | returns true if there is a winning combination on the board | [
{
"docid": "039b1b4a9104dce9232daeda35a1cae1",
"score": "0.0",
"text": "def won?(board)\n WIN_COMBINATIONS.each do |win_combination|\n win_index_1 = win_combination[0]\n win_index_2 = win_combination[1]\n win_index_3 = win_combination[2]\n\n position_1 = board[win_index_1]\n position_2 =... | [
{
"docid": "3fd6b7256b3238d3476d2162eb67f440",
"score": "0.8601805",
"text": "def won?\n WIN_COMBINATIONS.each do | winning_combination |\n if @board[winning_combination[0]] == @board[winning_combination[1]] && @board[winning_combination[1]] == @board[winning_combination[2]] && self.position_tak... |
ea1d16e641d597d2c3a862d2611f5c76 | POST /runs POST /runs.json | [
{
"docid": "e1fd33eb9624d6cba757e45a9daa31ba",
"score": "0.0",
"text": "def create\n # Grab resources needed to build run\n @job = Job.find(run_params[:job_id])\n @user = User.find(run_params[:user_id])\n @run = Run.new(run_params.slice('job_id'))\n\n # Store prompt values\n @job.pro... | [
{
"docid": "82db5bf9fb030a85038a2cb0605b1ac8",
"score": "0.74984384",
"text": "def create\n @run = Run.new(run_params)\n current_user.runs << @run\n\n if @run.save\n render json: @run, status: :created\n else\n render json: @run.errors, status: :unprocessable_entity\n end\n end... |
17ee5600c7bf58a02990eb869461c33d | Takes a hash a recursively sets the default of the hash and all subhashes | [
{
"docid": "b911d4d2402ec67ec8530bac3e3183e3",
"score": "0.7528848",
"text": "def set_all_defaults(hash, default = nil)\n return unless hash.class == Hash\n hash.default = default\n hash.each_pair do |k, v|\n set_all_defaults(v) if v.class == Hash\n if v.class ... | [
{
"docid": "a8ec316d930cf97fd62db57e75fecf69",
"score": "0.62507427",
"text": "def hash_default(hash, key, def_val)\r\n hash[key] = hash.key?(key) ? hash[key] : def_val\r\n end",
"title": ""
},
{
"docid": "69799f7bd9b18a7635cb738495d8d1d2",
"score": "0.6170399",
"text": "def buil... |
b01b52793ceae94c047f12585eead252 | GET /line_items GET /line_items.json | [
{
"docid": "ac4e41df94c58e2efaa10685c7af4486",
"score": "0.688919",
"text": "def index\n @line_items = @invoice.line_items\n end",
"title": ""
}
] | [
{
"docid": "7b04de706c8fe7b0f819b399a78cc498",
"score": "0.8007268",
"text": "def show\n @line_items = LineItem.find(params[:id])\n render json: @line_items\n end",
"title": ""
},
{
"docid": "92123c846f365fcd48b82ee6faab25bd",
"score": "0.7856364",
"text": "def show\n @item... |
04f0d33ce6f56492f16018288de226a2 | POST /sims_instrument_configurations POST /sims_instrument_configurations.json | [
{
"docid": "c34b67c7dff36cf49acfaa70148c2e16",
"score": "0.7293792",
"text": "def create\n @sims_instrument_configuration = SimsInstrumentConfiguration.new(params[:sims_instrument_configuration])\n\n respond_to do |format|\n if @sims_instrument_configuration.save\n format.html { redire... | [
{
"docid": "3cd58dfa00744bf2cdf19dd17ce00de9",
"score": "0.6249832",
"text": "def new\n @sims_instrument_configuration = SimsInstrumentConfiguration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sims_instrument_configuration }\n end\n end",... |
fe4a6eed0f5ecf90cbc2618c1133dbf2 | Realiza login com os parametros | [
{
"docid": "9f37f05049cda94890b8ac677baa7f00",
"score": "0.73433226",
"text": "def login_user\n login(params[:email], params[:password], params[:remember])\n # , params[:remember]\n end",
"title": ""
}
] | [
{
"docid": "f62ed20a106c6d11cc984b9d0823093a",
"score": "0.7906318",
"text": "def login_from_params\n login_by_password!(params[:login], params[:password]) if params[:login] && params[:password]\n end",
"title": ""
},
{
"docid": "df5335d39d48d8f1c4455955f19733a5",
"score": "0.7847178... |
083d3d9b4043922aa71f40d9c75f6aa5 | This method works in conjunction with map_saved_attributes. Let's say a user fills out a registration form, provides an OpenID and submits the form. They are then redirected to their OpenID provider. All is good and they are redirected back. All of those fields they spent time filling out are forgetten and they have to... | [
{
"docid": "301175cac48ffbe493191991c68eea30",
"score": "0.6677164",
"text": "def attributes_to_save # :doc:\n attrs_to_save = attributes.clone.delete_if do |k, v|\n [:password, crypted_password_field, password_salt_field, :persistence_token, :perishable_token, :single_access_token, ... | [
{
"docid": "155d0fb850a40b6e9b806b4fd534a470",
"score": "0.6666832",
"text": "def attributes_to_save # :doc:\n attrs_to_save = attributes.clone.delete_if do |k, v|\n [:id, :password, crypted_password_field, password_salt_field, :persistence_token, :perishable_token, :single_access_to... |
5a2d0466c08d9483d20c462e970afcf0 | "ermittelt Daten einer Transaktion" | [
{
"docid": "c8d882482e79cca61ea5a8d035e84840",
"score": "0.0",
"text": "def transactionGet(options={})\n assert_valid_keys(options, :transactionId)\n assert_keys_exists(options, :transactionId)\n execute(:transactionGet, options)\n end",
"title": ""
}
] | [
{
"docid": "bb5b9df99cd033e36edfd01a2b429e3c",
"score": "0.6353317",
"text": "def transmissions; end",
"title": ""
},
{
"docid": "bb5b9df99cd033e36edfd01a2b429e3c",
"score": "0.6353317",
"text": "def transmissions; end",
"title": ""
},
{
"docid": "ff7399af86660bc69b85351e... |
c4716069333ac64f7d0ab83a548b5385 | example: f = Filter.new f.height=val print f => | [
{
"docid": "7dfbd9d884dacced2fc9f217b385b7c9",
"score": "0.0",
"text": "def height= value\r\n value = value.to_s\r\n @attributes['height'] = value\r\n value.to_number\r\n end",
"title": ""
}
] | [
{
"docid": "b41c05e628d49016e2070e9acc86093c",
"score": "0.62142503",
"text": "def filter=(filter); end",
"title": ""
},
{
"docid": "6272bad47eadd5bd6cfd09cbd0dd94de",
"score": "0.61842465",
"text": "def initialize (f = {})\n @filter = f\n setDefault\n end",
"title": ""
... |
03db67ed9e3be453ca16553a4ddbee2a | Given a string, returns a Ruby object. | [
{
"docid": "3acee7b89588a97841bdf2bab970a450",
"score": "0.0",
"text": "def decode(object)\n return unless object\n\n begin\n JSON.load object\n rescue JSON::ParserError => e\n raise DecodeException, e.message, e.backtrace\n end\n end",
"title": ""
}
] | [
{
"docid": "682d35e82796aa482cd903dda296bcdf",
"score": "0.6561318",
"text": "def parse(str)\n RubyParser.new.parse(str.deep_clone)\n end",
"title": ""
},
{
"docid": "f4c62d7f4603a8154c9ac8082d81e610",
"score": "0.6222472",
"text": "def ruby_source_from_string(s)\n parser ... |
ccbd47eac7a609a9040e21efd944ea44 | GET /recipes/1 GET /recipes/1.json | [
{
"docid": "18b333e632d5eeaebd648073f8949844",
"score": "0.0",
"text": "def show; end",
"title": ""
}
] | [
{
"docid": "3fe41449861fd2452b1fe46a9895e7c7",
"score": "0.7595955",
"text": "def show\n @recipe = Recipe.find(params[:id])\n render json: @recipe\n end",
"title": ""
},
{
"docid": "82e3a5971e5368ccee78424019fc65b8",
"score": "0.7503586",
"text": "def recipe(id)\r\n BnetA... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "51f72adfcbf51a59781a06641ef9986d",
"score": "0.0",
"text": "def set_questioner_form\n @questioner_form = QuestionerForm.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "d... |
572442f8faa6a146d95f0c25ec72c539 | Destroy account DELETE /1 | [
{
"docid": "1bc5dda4872393e27986bf1cde36f79e",
"score": "0.0",
"text": "def destroy\n @current_account.cancel\n\n AccountMailer.canceled(@current_account).deliver_later\n\n redirect_to account_canceled_path, notice: 'Account was successfully canceled.'\n end",
"title": ""
}
] | [
{
"docid": "85f75fa87a735d6adea643b100ac7d02",
"score": "0.8401681",
"text": "def delete_account\n @connection.request({\n :method => 'DELETE'\n })\n end",
"title": ""
},
{
"docid": "3673f5b4865916f6278654b20718ce9e",
"score": "0.8396909",
"text": ... |
8a0dceb8e87395a4d671dae5b78564aa | reach in to send a conflict | [
{
"docid": "5641daced99b707d952fb3ee06006794",
"score": "0.0",
"text": "def find_rev r\n @conflicts.find{|c|c.rev == r}\n end",
"title": ""
}
] | [
{
"docid": "552b3b565778f0a0ca37ef7e204fcdbb",
"score": "0.65261",
"text": "def on_conflict_behavior\n say_status :exist, :blue\n end",
"title": ""
},
{
"docid": "1351912c708072ff9c1f8643e9a3a856",
"score": "0.6217025",
"text": "def conflict(body = nil)\n error Rac... |
c15881b678c2ef2f588035cc303a0378 | DELETE /actus/1 DELETE /actus/1.xml | [
{
"docid": "8269f37889c7945a1cbbc1b194b6151d",
"score": "0.69235194",
"text": "def destroy\n @actu.destroy\n\n respond_to do |format|\n format.html { redirect_to(newsletter_actus_url(@newsletter)) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "d5d90a7ed1698e907fbad2adfb3d9396",
"score": "0.6764339",
"text": "def destroy\n @actattribute = Actattribute.find(params[:id])\n @actattribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(actattributes_url) }\n format.xml { head :ok }\n end\n end",
... |
dde7c81f7b3286d46dc923616211baa4 | Validates the size of an uploaded picture. | [
{
"docid": "4278d459e93cc8f5f72863cceb967d99",
"score": "0.0",
"text": "def picture_size\n return if picture.size > Settings.micropost.picture_size .megabytes\n errors.add :picture, I18n.t(\"micropost.messages\")\n end",
"title": ""
}
] | [
{
"docid": "6a700f10219f87bb1d8572f6a32470b0",
"score": "0.8246438",
"text": "def picture_size\n if picture.size > 5.megabytes\n errors.add(:picture, \"should be less than 5MB\")\n end\n end",
"title": ""
},
{
"docid": "4c2d409b7726da27b4a5c79f311b40ea",
"score": "0.82460... |
389290d7dd9bb702e92e9474b7572be9 | POST /orders POST /orders.json | [
{
"docid": "bc686c251efc231d2745669b0efe304e",
"score": "0.0",
"text": "def create\n @order = Activity.find_by_id(params[:activity_id]).orders.new\n @order.user = current_user;\n @order.number_of_tickets = order_params[:number_of_tickets]\n @order.total_price = @order.number_of_tickets * @or... | [
{
"docid": "ee8d8e8e024d35ee13910acc551b370b",
"score": "0.81998754",
"text": "def create_order\n post_request \"orders\"\n end",
"title": ""
},
{
"docid": "845035633d004ad773ad8d0df67d69fd",
"score": "0.7508254",
"text": "def create\n response = Unirest.post(\"http://loca... |
60b352ed7ab990765a295ca65121b982 | report on any errors we contain | [
{
"docid": "9d18c00a7fd95d3fe8ad3d0f2f46acbd",
"score": "0.0",
"text": "def error_list\n res = []\n t = @data_object\n res << \"Missing team name\" if t.team_name.empty?\n\n check_length(res, t.team_name, 100, \"Team Name\")\n\n cha = Challenge.with_id(t.team_challenge)\n if cha\n ... | [
{
"docid": "5b67f1c864a4330ea70b29ab077e3f43",
"score": "0.7134762",
"text": "def errors; end",
"title": ""
},
{
"docid": "5b67f1c864a4330ea70b29ab077e3f43",
"score": "0.7134762",
"text": "def errors; end",
"title": ""
},
{
"docid": "5b67f1c864a4330ea70b29ab077e3f43",
... |
2b6f454cfe28e4e5e27fe76e3f0a3f22 | count all the order items, taking into consideration quantity | [
{
"docid": "f0dfbf2032c990f9a537e611c33106df",
"score": "0.8486455",
"text": "def total_order_items\n count = 0\n self.order_items.each do |order_item|\n count += order_item.quantity\n end\n count\n end",
"title": ""
}
] | [
{
"docid": "8192c15ffc9b26e84bebeadc9a75eb1c",
"score": "0.8373655",
"text": "def num_of_items\n order_items.collect { |oi| oi.valid? ? oi.quantity : 0 }.sum\n end",
"title": ""
},
{
"docid": "6b2ec912c5ce3aa9217166230fcb01f3",
"score": "0.8087783",
"text": "def total_items\n ... |
e38ce726013385ff211273fb4365b4f5 | get the users who belongs to a content provider | [
{
"docid": "6bd10126a045b7b2a9d339074671a230",
"score": "0.6363164",
"text": "def get_users_per_client_names client_names, user_filter\r\n\t\tusers = []\r\n\t\tContentProvider.where(technical_name: client_names).find_each do |cp|\r\n\t\t\tcp.users.where(user_filter).find_each do |u|\r\n\t\t\t\tusers << ... | [
{
"docid": "cff59a09808bd037252a5d1e80b2b0cc",
"score": "0.65490013",
"text": "def relevant_members\r\n group_ids = self.group_ids\r\n user_ids = Membership.select(\"user_id\").where(group_id: group_ids).map(&:user_id).uniq\r\n User.find(user_ids)\r\n end",
"title": ""
},
{
"docid"... |
2c4e9658b990a31dd44549d0fed797be | ABSTRACT ADAPTER OVERRIDES ======================================= see abstract_adapter.rb Returns the humanreadable name of the adapter. | [
{
"docid": "ddc47788f4819106112d5bb6387404fc",
"score": "0.847657",
"text": "def adapter_name\n self.class::ADAPTER_NAME\n end",
"title": ""
}
] | [
{
"docid": "8e054db851f87638eda0d45b88cf0384",
"score": "0.86672515",
"text": "def adapter_name\n ADAPTER_NAME\n end",
"title": ""
},
{
"docid": "8e054db851f87638eda0d45b88cf0384",
"score": "0.86672515",
"text": "def adapter_name\n ADAPTER_NAME\n end",
"ti... |
df7ce5f8b2b4f9a256bf20b2f067767d | === Affichage tous les objets de l'inventaire | [
{
"docid": "cf573d6c6034b8f6d6f7f740e5789398",
"score": "0.0",
"text": "def to_s\n\t\t\"#{@listObjet}\"\n\tend",
"title": ""
}
] | [
{
"docid": "cdec078fd17e5e678e4725bcbcc0365e",
"score": "0.6591826",
"text": "def utiliserObjet(unObjet)\n\t\ttaille = @inventaire.tailleInventaire();\n\t\tj=0;\n\t\tlisteO = @inventaire.getListe()\n\t\tlisteO.each { |i|\n\t\t\tif (i.eql?(unObjet) )\n\t\t\t\tunObjet.utiliser(self)\n\t\t\t\t@inventaire.j... |
90a9aed6d1c3004721495a0fc3a8c5c8 | If the cookie should be marked as SameSite with 'Lax' or 'Strict' flag. | [
{
"docid": "9ca812fdcd7fbc0a68a2e9b4df515a86",
"score": "0.5246409",
"text": "def same_site\n return @same_site if defined?(@same_site)\n @same_site = self.class.same_site(nil)\n end",
"title": ""
}
] | [
{
"docid": "d5c0fd4dcb6953fc439cd01e7320a4e8",
"score": "0.7143329",
"text": "def validate_exclusive_use_of_samesite_enforcement!(attribute)\n if (intersection = (config[:samesite][:lax].fetch(attribute, []) & config[:samesite][:strict].fetch(attribute, []))).any?\n raise CookiesConfigError.... |
693f549d90ed03bba00d498025b0012a | handle Normal OAuth flow: callback | [
{
"docid": "f04a0529b7fbecf96dea2ade4847c1a0",
"score": "0.0",
"text": "def create\n client.authorization_code = params[:code]\n access_token = client.access_token!\n puts access_token\n end",
"title": ""
}
] | [
{
"docid": "b04e39b9140b570da9946d488574bfe0",
"score": "0.802054",
"text": "def callback\n self.oaw_callback(params[:oauth_verifier], params[:oauth_token])\n end",
"title": ""
},
{
"docid": "02526c09f8b72c9d16bf5de09ba9fcbd",
"score": "0.76735544",
"text": "def facebook\n han... |
ca56ea839e2941f76857b691e45eaa02 | Create a glossary term Create a new glossary term. | [
{
"docid": "a22432f75fd189f219a1821b7b277c65",
"score": "0.79788345",
"text": "def glossary_term_create(account_id, glossary_id, glossary_term_create_parameters, opts = {})\n data, _status_code, _headers = glossary_term_create_with_http_info(account_id, glossary_id, glossary_term_create_parameters,... | [
{
"docid": "7f8c506237983aa908da70eaed778ca4",
"score": "0.7238591",
"text": "def create\n @glossary = Glossary.create_glossary(params[:glossary])\n\n respond_to do |format|\n if @glossary.save\n format.html { redirect_to @glossary, notice: 'Glossary was successfully created.' }\n ... |
8347caab216ff538456cf9bcca165029 | Stop the application from running. The given message is displayed in the CLI. | [
{
"docid": "d2f7158501994d40980f7243c4c76d2f",
"score": "0.64203405",
"text": "def stop(message)\n puts message.red\n exit\nend",
"title": ""
}
] | [
{
"docid": "5797787c8478033359dab9d234b3ff11",
"score": "0.6945048",
"text": "def stop\n run_cmd(\"stop\")\n end",
"title": ""
},
{
"docid": "17da6f1d08fb08dab410ba32e7d37162",
"score": "0.68630797",
"text": "def stop(msg=nil, options={})\n msg = nil if options[:quiet]\n if... |
bbead26f659d921f395e19da6e8615cb | takes a collection (nameArray) of node name to remove from nodeset but working yet | [
{
"docid": "b02d507fcbc72862332de750746e69ef",
"score": "0.8429754",
"text": "def CleanUp(nodeset, nameArray)\r\n\tnodeset.each do |node|\r\n\t\tnameArray.each do |name|\r\n\t\t\tnode.at(name).remove\r\n\t\tend\r\n\tend\r\n\treturn nodeset\r\nend",
"title": ""
}
] | [
{
"docid": "344d1c08e46e54f00deeca239844d09a",
"score": "0.68796194",
"text": "def removeNamedItem(name)\n ret = @nodes[name]\n @nodes[name] = nil\n ret\n end",
"title": ""
},
{
"docid": "40022ee6894159d848bad8a599342bfe",
"score": "0.6822169",
"text": "def ... |
186e1b1e0eedee9d1fef4815c50eca49 | Return a pretty description of a byte count Return a pretty description of a byte count with required precision and using B, kB, MB, GB or TB as unit as appropriate. Uses the current locale defined decimal separator (i.e. the result is language dependant). | [
{
"docid": "d111c6e5f846d92414f98ff57b4618ba",
"score": "0.6641431",
"text": "def FormatSizeWithPrecision(bytes, precision, omit_zeroes)\n return \"\" if bytes == nil\n\n units = [\n # Byte abbreviated\n _(\"B\"),\n # KiloByte abbreviated\n _(\"kB\"),\n # Meg... | [
{
"docid": "cbbdf125e89f9d0645608d7ccac50b2c",
"score": "0.7494519",
"text": "def nice_bytes(count)\n suffix = [ '', 'K', 'M', 'G', 'T', 'P' ]\n while count > 999\n count /= 1024.0\n suffix.shift\n end\n if count >= 100\n count = count.to_i.to_s\n elsif count >= 10\n count = '%2.1f' % c... |
7ae6bd2654e5e23882d576a1dfcf8df1 | Serialize what are essentially constants stored in the database down to the UI so it can use them for joins. | [
{
"docid": "fe7de0e936f5098254c6294cfb644f26",
"score": "0.0",
"text": "def constant_indexes\n {\n service_types_index: service_types_index,\n event_note_types_index: event_note_types_index\n }\n end",
"title": ""
}
] | [
{
"docid": "ca21918429a516f5b256d6671271c176",
"score": "0.6484764",
"text": "def marshal_dump\n { \n :klass => self.class.to_s, \n :values => @attribute_values_flat, \n :joined => @joined_models\n }\n end",
"title": ""
},
{
"docid": "9ac710cd0d1de53ff3d4ade4f0746355",
... |
fe1313d3ad41ab31df691a61c152bb0b | Replace this with your real tests. | [
{
"docid": "72fd36c52f9358823fcd80b429120869",
"score": "0.0",
"text": "def test_truth\n assert true\n end",
"title": ""
}
] | [
{
"docid": "16a6d5e8eabd975007f205c109c50890",
"score": "0.7378937",
"text": "def testing; end",
"title": ""
},
{
"docid": "1068832c8229c37488788b46a0871f26",
"score": "0.6994956",
"text": "def testing\n end",
"title": ""
},
{
"docid": "8fbc98d9068bd9c82033a031286f0a1e",... |
ac7f9fa3b1983873e93d05ef295c33c8 | Returns the length of this input. | [
{
"docid": "d4a106f7c2e354c602c9b2cfad1c2db1",
"score": "0.0",
"text": "def length\n string.length\n end",
"title": ""
}
] | [
{
"docid": "806214256089ca0b4628e5e880124b4b",
"score": "0.83372825",
"text": "def length\r\n return @length\r\n end",
"title": ""
},
{
"docid": "9e13ef40795275c2e73ce2f028b2084e",
"score": "0.83247894",
"text": "def length\n return @length\n ... |
e9739208de6e48f924d54b8c3fa75930 | Make sure decorations list is initializsed if Decoration extends an object. | [
{
"docid": "02cf9e9610608b53f0945b528a0df781",
"score": "0.6576618",
"text": "def extended(object)\n object.send(:setup_decorations)\n super\n end",
"title": ""
}
] | [
{
"docid": "301bd716a2652485f1d1595c5d8e21eb",
"score": "0.6147732",
"text": "def decorators\n # Note: can't use respond_to? because it's delegated...\n # So I also had to either rescue here or monkeypatch Object.\n # Decided to just rescue.\n (decorated.decorators rescue []) << decorator_cl... |
147697d7fe760ed04330ff59e2c6d9fe | List or search organizations providing content to ReliefWeb. | [
{
"docid": "145eec2a45371eefdb56f7a943efaa4e",
"score": "0.0",
"text": "def get_sources(opts = {})\n data, _status_code, _headers = get_sources_with_http_info(opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "d0d3912a805bc2da8a817f1f60820271",
"score": "0.79779404",
"text": "def get_organizations\n params = {\n 'method' => :get,\n 'command' => '/org'\n }\n\n response, headers = send_request(params)\n orgs = response.css('OrgList Org')\n\n ... |
525a83a6b15a18d3b6d5841f6e7d78f3 | Set a new password, clear the date the password reset token was sent and reset the perishable token | [
{
"docid": "874512f7668202f034bdf983e3ca6a3c",
"score": "0.8059701",
"text": "def reset_password(pass)\n self.password = pass\n self.password_reset_sent = nil\n reset_perishable_token\n end",
"title": ""
}
] | [
{
"docid": "5d5b1cff008d528b36a94478b605a800",
"score": "0.814566",
"text": "def set_password_reset_token\n self.password_reset_sent = DateTime.now\n set_perishable_token\n self.perishable_token\n end",
"title": ""
},
{
"docid": "5d5b1cff008d528b36a94478b605a800",
"score": "0.8... |
d8ef245c6bdf14b390d3a178de1ff5f6 | invite All currently known answers. | [
{
"docid": "b1bf30802558de246bfbb46ca66913bb",
"score": "0.0",
"text": "def answers\n Hash[@questions.map{|k,e| [(e[:name] || k), e[:desc]] }]\n end",
"title": ""
}
] | [
{
"docid": "74401012b926812f401e0272296bda88",
"score": "0.6808489",
"text": "def invite_all\n self.group.users.each { |user| self.invite(user) }\n end",
"title": ""
},
{
"docid": "b5bf06d9ade93e112a267a04f967a688",
"score": "0.64724296",
"text": "def invite ids\n true\n end"... |
9ee3b81f3d84cc51c9e648f99517b8c7 | Display final results of total rubies collected, per Rubyist. | [
{
"docid": "e3497f4a2a81ab748f7f4683aded732f",
"score": "0.7803611",
"text": "def final_results(num_rubyist)\n puts \"After #{@curr_prospector.total_days} days, Rubyist #{num_rubyist + 1} found:\\n\"\n\n if @curr_prospector.total_rubies != 1\n puts \"\\t#{@curr_prospector.total_rubies} rubies... | [
{
"docid": "15221108249f02ddcc363c3940ff01a4",
"score": "0.7323407",
"text": "def display_rubies(total_rubies, total_fake, rubyist_num, iterations)\r\n raise 'total_rubies must be an integer!' unless total_rubies.is_a? Integer\r\n\r\n raise 'total_fake rubies must be an integer!' unless total_fake... |
dbf34a4c942b3af56bb8e7f21350f46f | Lifted from avalon.rake. The rake task should probably use a library like this for consistency outside of rake tasks. | [
{
"docid": "70d7789b4a44c262f2916f3cda06981a",
"score": "0.0",
"text": "def delete_user(username)\n groups = Avalon::RoleControls.user_roles username\n User.where(Devise.authentication_keys.first => username).destroy_all\n groups.each do |group|\n Avalon::RoleControls.remov... | [
{
"docid": "e1b9f5ae3be4f52e98d25f314f31189a",
"score": "0.74004745",
"text": "def rake_tasks(&block); end",
"title": ""
},
{
"docid": "e1b9f5ae3be4f52e98d25f314f31189a",
"score": "0.74004745",
"text": "def rake_tasks(&block); end",
"title": ""
},
{
"docid": "f087c0f104e3... |
1e9def6e9040dd40bd245d3f7b28bd08 | GET /answerchoices/1 GET /answerchoices/1.xml | [
{
"docid": "e40b253466b191c8a7733580a240cd08",
"score": "0.7041934",
"text": "def show\n @answerchoice = Answerchoice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @answerchoice }\n end\n end",
"title": ""
}
] | [
{
"docid": "6df34e5ca7973810e9580e9015fd63df",
"score": "0.706102",
"text": "def show\n @answer_choice = AnswerChoice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @answer_choice }\n end\n end",
"title": ""
},
{
... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "a1db05400695e80db9be3200e47e5f85",
"score": "0.0",
"text": "def set_workflow\n @workflow = Workflow.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook;... |
c32cdb58ab02138e21d6191506428fdd | Entry point for this parser Parse `filename` out of the hash `files` | [
{
"docid": "4b4155f47513cb99d21028f755cf6d6b",
"score": "0.0",
"text": "def parse_file(orig_filename, opts = {})\n\n includes = find_clang_includes + [@tmpdir]\n\n # Override the path we want to filter by\n filename = File.join(@tmpdir, orig_filename)\n debug_enable if opts[:debug]\n... | [
{
"docid": "7cbc638f0e5ab808806c779db7119cd6",
"score": "0.7610485",
"text": "def parse_file(filename); end",
"title": ""
},
{
"docid": "0ba209de1f42f2b91e2a860ef35dfd86",
"score": "0.753249",
"text": "def parse(*filenames); end",
"title": ""
},
{
"docid": "0ba209de1f42f2... |
d1ac3fe1050d2f8fd0eca3caf0894ee9 | action for updating a Question | [
{
"docid": "3db4ccbcf73bc29575f023ba55e2de00",
"score": "0.77596647",
"text": "def update\n @question = Question.find(params[:id])\n #update the Question with the submitted params\n if @question.update(question_params)\n #if succesful display message\n flash[:notice] = \"Your question wa... | [
{
"docid": "37889e61c6800868c8f8942607dd9781",
"score": "0.8212163",
"text": "def update\n # logger.debug \"IMPORTANT INFO COMING NEXT \"\n # logger.debug params[:answer]\n respond_to do |format|\n if @question.update(question_params)\n manage_answers # insert or update\n forma... |
fb5a266168413a1ec31e4e8aa4e8bc60 | Shows the list of characters and asks for a choice | [
{
"docid": "965c4eb78a6699c1c56da97cd0888701",
"score": "0.6728111",
"text": "def input \n Character.list\n input = gets.chomp\n index = input.to_i\n clear\n if index <= Character.names.length && index > 0\n adjusted_index = index - 1\n info = Ch... | [
{
"docid": "4f32c287a9548b763fe7a3df53629f88",
"score": "0.7540752",
"text": "def character_menu\n puts \" \"\n puts \" ┌─┐┬ ┬┌─┐┬─┐┌─┐┌─┐┌┬┐┌─┐┬─┐ ┬┌┐┌┌─┐┌─┐\"\n puts \" │ ├─┤├─┤├┬┘├─┤│ │ ├┤ ├┬┘ ││││├┤ │ │\"\n puts \" └─┘┴ ┴┴ ┴┴└─┴ ┴└─┘ ┴ └─┘┴└─ ┴┘└┘└ └─┘\"\n... |
cd3994068832e2fc68dad82ab31083bc | register Kodiak as an application with Growl | [
{
"docid": "3c40d704ffb7c22b77e04c319aa39d08",
"score": "0.79899925",
"text": "def growl_register\n\t\t\t@application = Kodiak::APP_NAME\n\t\t\t@icon = \"#{Kodiak::CONFIG_PATH}/#{Kodiak::CONFIG_ICON}\"\n\t @default_notifications = [\"Kodiak Success\"]\n\t @notifications = [\"Kodiak Success\", \"Ko... | [
{
"docid": "d2bbcbc82f8c4388b58482ecab3790ef",
"score": "0.6030015",
"text": "def register_app(apk, bundle_id, env = \"dev\")\n if apk.nil?\n UI.error(\"Specify the APK you want to run and register in crashlytics. Provide the filename only, not the full path.\")\n exit(1)\n end\n\n if bundle_id... |
17d41be29067646a824b40e2ca9416cc | Sets the category13 property value. The label associated with Category 13 | [
{
"docid": "469ab92c9c416e3be39af8d5b213c78d",
"score": "0.88773274",
"text": "def category13=(value)\n @category13 = value\n end",
"title": ""
}
] | [
{
"docid": "5e4d9c6cb14dd7a95f922cf4378f2484",
"score": "0.71859384",
"text": "def category12=(value)\n @category12 = value\n end",
"title": ""
},
{
"docid": "f3cbf551601491c459c1de042f452333",
"score": "0.7037807",
"text": "def category14=(value)\n ... |
938d9c053c9d3c6c88f978141ee83ece | Retrieve a Playback Restriction Retrieves a Playback Restriction associated with the unique identifier. | [
{
"docid": "3c2c72b3aebedeb0d4556e84454299a5",
"score": "0.7501063",
"text": "def get_playback_restriction(playback_restriction_id, opts = {})\n data, _status_code, _headers = get_playback_restriction_with_http_info(playback_restriction_id, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "9c9b4184e731ec42de239c3adcac1d3f",
"score": "0.6339512",
"text": "def get_playback_restriction_with_http_info(playback_restriction_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PlaybackRestrictionsApi.get_playback_restriction ...... |
0abbf98e1b4d97e0d6ae10ed58f59801 | Generates a random token encoded in base64. Returns a 48 character string of random letters within the base64 charset. | [
{
"docid": "f73ca6783691e860661eb2422319406e",
"score": "0.8152257",
"text": "def generate_token(length = 48)\n SecureRandom.base64(length)\n end",
"title": ""
}
] | [
{
"docid": "a4079510ff2768a13a39f3bedbba7dfc",
"score": "0.8012406",
"text": "def generate_secure_token_string\n SecureRandom.urlsafe_base64(25).tr('lIO0', 'sxyz')\n end",
"title": ""
},
{
"docid": "b6c27ddaaaa2b98379ade4720686924c",
"score": "0.7923421",
"text": "def random_toke... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "ddb15b97ec3613065aabc376ea15597f",
"score": "0.0",
"text": "def set_message\n @message = Message.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "d... |
252af13f9a97b8d05fe3e5e6b008b29e | Adds a mapping to the sequence. | [
{
"docid": "2f9579f6b985ee3e32eea42d2babe1a8",
"score": "0.73034096",
"text": "def mapping value\n handler.log { \"#{handler.indent}Adding mapping #{value} to sequence\" }\n @list.push value\n end",
"title": ""
}
] | [
{
"docid": "08192aa7bdcb5f96da0ee68cc46142d0",
"score": "0.67568314",
"text": "def add(input, output)\n @data.push(Mapping.new(input, output))\n end",
"title": ""
},
{
"docid": "9e3f65d5a149acf993cc9ab1487c9b8c",
"score": "0.65739447",
"text": "def add_map map\n self.tma... |