query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
4f9144cab793ca623df6a65498954522 | needed for form not to try to access db | [
{
"docid": "ab06980c3f6769d24fdb1466e3656c23",
"score": "0.0",
"text": "def persisted?\r\n false\r\n end",
"title": ""
}
] | [
{
"docid": "4c5ddadeffb8658af85b4d31d78c26f0",
"score": "0.66236055",
"text": "def form; end",
"title": ""
},
{
"docid": "4359f17cccd1b44ee098eeaaa38305d9",
"score": "0.63067406",
"text": "def form\n end",
"title": ""
},
{
"docid": "a66231c8093cacba4e12452f05171fa3",
... |
4dcc130a35233b6c03de4aede6986de5 | reads the given +file+ in chunks set though +chunk_size+ and yields the current chunk and whether it's the last chunk to iterate over. | [
{
"docid": "7db941f549aa35fae8c56a642caaa3b2",
"score": "0.7510487",
"text": "def each_chunk(chunk_size)\n File.open(@file_path, \"rb\") { |f| yield(f.read(chunk_size), f.eof?) until f.eof? }\n end",
"title": ""
}
] | [
{
"docid": "5a01908135c0761ba5a60e00fbf3624c",
"score": "0.7293245",
"text": "def each_chunk\n file.seek(0, IO::SEEK_END)\n while file.tell > 0\n if file.tell < @chunk_size # don't read beyond file size\n @chunk_size = file.tell\n end\n file.seek(-@chunk_size, IO::SEEK_CUR)\n... |
62bddaad72bae844dcf855497dfa8b3e | Find charge from shopify api by charge_id and project subscription type | [
{
"docid": "1c934a6cdbc2a8a9bab92b7439412d03",
"score": "0.80332977",
"text": "def find_charge_by_id\n if @project and @project.shopify_session\n case @project.sub_type\n when 'monthly'\n @charge = ShopifyAPI::ApplicationCharge.find(params[:charge_id])\n when 'yearly'\n ... | [
{
"docid": "02052527a07870a846e0b9938885abe0",
"score": "0.709158",
"text": "def get_project_by_charge_id\n data = $redis.hgetall(\"charges:#{params[:charge_id]}\")\n @project = data['project_id'] ? current_user.projects.find(data['project_id']) : nil\n end",
"title": ""
},
{
"docid":... |
b31bbc96716dcc3e807a074ff54b8a68 | Is this Tag a subTag of another one ? Parameters:: iOtherTag (_Tag_): The other Tag Return:: _Boolean_: Is this Tag a subTag of another one ? | [
{
"docid": "5feccdd689c90c11664d365da1ad4d29",
"score": "0.87164354",
"text": "def subTagOf?(iOtherTag)\n rFound = false\n\n lCheckTag = @Parent\n while (lCheckTag != nil)\n if (lCheckTag == iOtherTag)\n rFound = true\n break\n end\n lCheckTag = lChe... | [
{
"docid": "ae52ffa574abe85105e3f6595160ba04",
"score": "0.71101767",
"text": "def tags_match?(other)\n (self.respond_to?(:tags) and other.respond_to?(:tags)) ?\n self.tags == other.tags : true\n end",
"title": ""
},
{
"docid": "b66fb386561fe0c5ddc8b7e73ad2f0c8",
"score": "0.658... |
ca5fefd51814b8f6557a040a36d282dc | Converts published values to JSON if possible | [
{
"docid": "0a28ad64e7ca9a9c31d7a81869798e37",
"score": "0.0",
"text": "def payload_for(value)\n case value\n when Array, Hash\n JSON.dump value\n else\n value\n end\n rescue\n value\n end",
"title": ""
}
] | [
{
"docid": "094a881fedfa10406af811e6891293a3",
"score": "0.6760346",
"text": "def convert_before_write(value)\n value.to_json\n end",
"title": ""
},
{
"docid": "bb76a1250a7b61221a72b1f80ef5b5b2",
"score": "0.6690426",
"text": "def convert_before_write(value)\n ... |
dc09c7bfdc52403ea79d72385bd45387 | returns the locators for the minimum and maximum element as a twoelement array. If the queue is empty, [nil, nil] is returned. q = Depq.new p q.find_minmax_locator => [nil, nil] q.insert 3 q.insert 1 q.insert 2 p q.find_minmax_locator => [, ] | [
{
"docid": "77a734ee022e0539d4f202f93d486bf4",
"score": "0.7712057",
"text": "def find_minmax_locator\n return [nil, nil] if empty?\n use_minmax\n return mode_call(:find_minmax_loc)\n end",
"title": ""
}
] | [
{
"docid": "4192f264304b1e6620395d1665524f0e",
"score": "0.7784069",
"text": "def find_minmax\n loc1, loc2 = self.find_minmax_locator\n [loc1 && loc1.value, loc2 && loc2.value]\n end",
"title": ""
},
{
"docid": "18c6f3bbc476d4309eb79c416c1f71d7",
"score": "0.6261518",
"text": ... |
3cda6f2bf248ddafa11987b72511b241 | Get a single blob, fetching its content and encoding | [
{
"docid": "21ed53f11156bb35ea6d45b47dd38665",
"score": "0.66069937",
"text": "def blob(repo, blob_sha, options={})\n get(\"repos/#{Repository.new(repo)}/git/blobs/#{blob_sha}\", options)\n end",
"title": ""
}
] | [
{
"docid": "324e19674b9218ca23dc6980ddf56bfd",
"score": "0.7685124",
"text": "def blob\n response(:get).body\n end",
"title": ""
},
{
"docid": "b6ebd137b439e9ec566e1a324d8b85d3",
"score": "0.76423913",
"text": "def blob\n @blob ||= read_blob\n end",
"title... |
c49deff6e82f751210adc17eecf14860 | Collection of notification items returned for MassPay transactions | [
{
"docid": "8c4b02096ff0311f30ababbb4eb3855d",
"score": "0.64139056",
"text": "def items\n @items ||= (1..number_of_mass_pay_items).map do |item_number|\n MassPayItem.new(\n params[\"masspay_txn_id_#{item_number}\"],\n params[\"mc_gross_#{item_number}\"],\n ... | [
{
"docid": "1868b562f4e25871150f44e3028d0668",
"score": "0.6999038",
"text": "def notifications\n ensure_service!\n gapi = service.list_notifications name, user_project: user_project\n Array(gapi.items).map do |gapi_object|\n Notification.from_gapi name, gapi_object... |
951521c069c4c49877651d3c7f020081 | Prints first card in a player's hand | [
{
"docid": "42bdd07b9a4c483ab287b150072f4137",
"score": "0.7178694",
"text": "def print_top\n card = @hand[0]\n puts\n puts \"Top card in hand:\"\n printf(\" %8s\", \"-----------\")\n puts\n printf(\" + | %8s |\", card.rank.to_s)\n puts\n ... | [
{
"docid": "65b0910fa67804f953183e4efd53af00",
"score": "0.8264364",
"text": "def printDealerFirstCard \n @dealerHand.getCardAtIndex(0).printCard()\n end",
"title": ""
},
{
"docid": "d82420b34e5c05c3010ffc8a37f643f7",
"score": "0.8079632",
"text": "def show_card\n\t\tplayer1 = @h... |
0d82d90f098a30362f020cc8162c4fca | Gets the ignoreVersionDetection property value. When TRUE, indicates that the app's version will NOT be used to detect if the app is installed on a device. When FALSE, indicates that the app's version will be used to detect if the app is installed on a device. Set this to true for apps that use a self update feature. | [
{
"docid": "68a013931b8f97eb35dcd0ee9bd009e2",
"score": "0.78364086",
"text": "def ignore_version_detection\n return @ignore_version_detection\n end",
"title": ""
}
] | [
{
"docid": "0b657ceb541a9d110ff7359debaf3d40",
"score": "0.7653347",
"text": "def ignore_version_detection=(value)\n @ignore_version_detection = value\n end",
"title": ""
},
{
"docid": "0b657ceb541a9d110ff7359debaf3d40",
"score": "0.7653347",
"text": "def ig... |
b70be357da982808a482d94b4612f4db | Reset table that stores web crawler beer data | [
{
"docid": "96d4680303962e9824cb87a9e22b7476",
"score": "0.78007466",
"text": "def resetCrawlerTable\n @db.execute \"DROP TABLE IF EXISTS #{@crawlerTable};\"\n @db.execute <<-SQL\n CREATE TABLE \"#{@crawlerTable}\" (\n name varchar(40),\n price floa... | [
{
"docid": "b82b57d37c4718583bd8086c4c488882",
"score": "0.68318456",
"text": "def reset_data\n @pg_data_table = {}\n @gameview_data_table = {}\n @userlist_table = {}\n @last_parsed_pglist_data = []\n @last_parsed_userlist_data = []\n end",
"title": ""
},
{
"docid": "4a8db591... |
d2f281b998febccc842564b2937aeef5 | has_index? Query whether index(es) exist for object. | [
{
"docid": "b396a44859bb75f7ea101bc48af84a67",
"score": "0.7159697",
"text": "def has_index?( *index_names )\n \n has_index = false\n \n index_names.each do |this_index_name|\n break unless has_index = indexes.has_key?( this_index_name )\n end\n \n return has_index\n\n end",
... | [
{
"docid": "0da559b215b90424587489777628ca1e",
"score": "0.82728136",
"text": "def exist?\n @index_info.index_exists?\n end",
"title": ""
},
{
"docid": "491ae1bb0b8d4e7c50660a663ea5ba23",
"score": "0.8256532",
"text": "def index_exists?\n connection.index_exists?(index... |
e3971add2b8564ec835c543bc2897a7e | to get the gray headers to appear, we need to return their titles in another new dataSource method | [
{
"docid": "1b3bc0096e96c1fe4bab6ce6e67c7a6f",
"score": "0.6018163",
"text": "def tableView(tableView, titleForHeaderInSection:section)\n sections[section]\n end",
"title": ""
}
] | [
{
"docid": "85dea654f409a14dbe75fe82cc2f3751",
"score": "0.693829",
"text": "def header_cells; end",
"title": ""
},
{
"docid": "85dea654f409a14dbe75fe82cc2f3751",
"score": "0.693829",
"text": "def header_cells; end",
"title": ""
},
{
"docid": "a67c1cdcf86bdc451080ffae0316... |
536feaddf46b8b3c40204849e4e6d991 | Send notification for update of person | [
{
"docid": "994b1cf438abe5b6847240ceeea4114c",
"score": "0.7625108",
"text": "def notify_updated_person(conference, person)\n @person = person\n @conference = conference\n mail to: Settings['content_mail'],\n subject: I18n.t(\"mailers.content_list_mailer.notify_updated_person\")\n end"... | [
{
"docid": "b3adb1fa545d053f87f351cf7d41aa35",
"score": "0.75884825",
"text": "def update\n user = ::User.find(params[:user_id])\n person = ::Vdc::UserToPersonSyncService.new({user: user}).update_person_from_user(user)\n AdminMailer.updated_person_admin_notification(user).deliver\n ... |
6a9fa39712a88643287cbc7a57492a58 | POST /bottles POST /bottles.json | [
{
"docid": "9e100a87722bde5965ff0c7fc87654ad",
"score": "0.0",
"text": "def create\n coa_summary_id = Array.new\n @last_id = Bottle.last.id\n @bottle = Bottle.new(external_bottle_params)\n @bottle.stripped_barcode = create_external_id\n @bottle.barcode = @bottle.stripped_barcode\n @bot... | [
{
"docid": "b343856e1c32cfcc3fcedd781508b6aa",
"score": "0.7171802",
"text": "def create\n @bottle = Bottle.new(params[:bottle])\n\n respond_to do |format|\n if @bottle.save\n format.html { redirect_to @bottle, notice: 'Bottle was successfully created.' }\n format.json { render ... |
2e0d1d7748c12d70ccf57e3b55b31073 | Public: Set up queue and exchange for retrying failed jobs. Returns nothing. | [
{
"docid": "b3d558e9c4dcde1fafd5640d2fdfb2e2",
"score": "0.66907966",
"text": "def setup_retrier\n retrier.setup if self.class.queue_options[:retry]\n end",
"title": ""
}
] | [
{
"docid": "e6d669c2b2241a4855a6b832f5af2815",
"score": "0.70262617",
"text": "def retry\n failed\n queue.push self\n end",
"title": ""
},
{
"docid": "976af6d160fb21c0944b035626fec1bb",
"score": "0.6789",
"text": "def setup\n queue = @worker_class.new.queue\n\n ... |
dcb82118107f1fce23ef9c3e0e0233a3 | PATCH/PUT /shoppings/1 PATCH/PUT /shoppings/1.json | [
{
"docid": "16b4aeb5e6946025ffacc38b4884e694",
"score": "0.639236",
"text": "def update\n respond_to do |format|\n if @shopping.update(shopping_params)\n format.html { redirect_to @shopping, notice: 'Shopping was successfully updated.' }\n format.json { render :show, status: :ok, l... | [
{
"docid": "64595e3f800957e4ecf0ab7dcd4afa99",
"score": "0.68654436",
"text": "def update\n \n @shopping = Shopping.find(params[:id])\n\n respond_to do |format|\n if @shopping.update_attributes(params[:shopping])\n format.html { redirect_to admins_shoppings_url , :notice => 'O Shopp... |
2a427678c0ae8a381d81c1b94056ca0d | Compare objects based on timestamp | [
{
"docid": "ef904e10fe566146866e5e0753f880d7",
"score": "0.6561967",
"text": "def <=>(other)\n self.timestamp <=> other.timestamp\n end",
"title": ""
}
] | [
{
"docid": "f1dcebb0e2f5208dfda61438fb246ddf",
"score": "0.7241329",
"text": "def assert_timestamp atype, obj1, obj2\n ts1 = obj1.updated_at.to_i\n ts2 = obj2.updated_at.to_i\n if atype == :equal\n if ts1 == ts2\n assert_equal ts1, ts2\n elsif (ts1-ts2).abs == 1\n assert... |
57c67a5437c5b77b220e239b69c386fb | Changes the status of a set of instance variables Returns :first if this is the first process, else :continuation (ie, chained) For IOstyle, this returns always :first | [
{
"docid": "5876b373a9ded86205b410f9d82a1ed3",
"score": "0.49608535",
"text": "def normalize_status(inst_var)\n errmsg = \"WARNING: The file (#{@fname}) is reread from the beginning.\"\n\n case inst_var\n when :@is_edit_finished, '@is_edit_finished'\n warn errmsg if @outstr || @outary\n ... | [
{
"docid": "b6915030321bc96a8a74cf955364cd54",
"score": "0.5440081",
"text": "def setfirst\n @mode = :setfirst\n self\n end",
"title": ""
},
{
"docid": "1876591d36eba8afee5df54d351f2341",
"score": "0.54235107",
"text": "def first; set_to_begin; forward; end",
"... |
5d1b26cbe68f7bf7a05d39d4154b3bfd | Generates Twitter share link. | [
{
"docid": "54c7b824cef44ad7d8ed3d44aef51539",
"score": "0.72409695",
"text": "def twitter_share_button(picture, attributes = { :class => 'twitter-share' })\n options = {\n :url => picture_url(picture),\n :text => t('social_media.tweet_template', :url => picture_url(picture))\n }\n at... | [
{
"docid": "93529faac960dd738970ad3a05a7a31b",
"score": "0.7720501",
"text": "def share_on_twitter_url(object)\n url = member_url([@tier, @topic, object])\n title = object.title\n \"http://twitter.com/home?status=#{url}\"\n end",
"title": ""
},
{
"docid": "afbb964afb6c598fdf44b055c... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "ac8327fcb7254326d5c58327ab1fe2c7",
"score": "0.0",
"text": "def set_wording\n\t\t\t@wording = Wording.find(params[:id])\n\t\tend",
"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;... |
d47e3716b98512f0d25c5c4f5d0e9d3e | Creates the array that saves all descriptions +version+:: the current description | [
{
"docid": "6d0235fe6c45ce94c0671160b95c4fb4",
"score": "0.719914",
"text": "def initialize\r\n self.descriptions = Array.new\r\n @version = -2 #-2 inidcates that there is now description right after the creation\r\n end",
"title": ""
}
] | [
{
"docid": "3b2264265694c292164717730a69f891",
"score": "0.6363895",
"text": "def add_descriptions_to_describable_from_arr(describable, r)\n describable.descriptions.create!(\n language: Language.find_by_abbr(:en),\n name: get_v(r[2]),\n description: get_v(r[3])\n )\n\n ... |
37193986c6868e6e9785ae9b08528ae4 | Class Methods Instance Methods | [
{
"docid": "56694baa2033f8261233700bab9202c3",
"score": "0.0",
"text": "def active_model_serializer\n ServiceSerializer\n end",
"title": ""
}
] | [
{
"docid": "b5b25700e97a3ff8649acd443cb60f46",
"score": "0.7326875",
"text": "def instance; end",
"title": ""
},
{
"docid": "b5b25700e97a3ff8649acd443cb60f46",
"score": "0.7326875",
"text": "def instance; end",
"title": ""
},
{
"docid": "b5b25700e97a3ff8649acd443cb60f46",... |
ef3430c09c7417cf371e1c717c552c1d | Return the +size+ of the file. This will call the server, retrieve the necessary meta information and will return you the correct size in bytes for the file. This method calls the server, so the size should be cached. == Example file = Uv::Storage::File.new(:object => Photo.all.first) file.size => Returns the size in b... | [
{
"docid": "51889350f2a8fc1e688a6d6dbf475331",
"score": "0.72735953",
"text": "def size\n raise MissingFileMapping.new if mapping.blank?\n raise NodesMissing.new if mapping.nodes.blank?\n\n retrieve_meta!\n\n return self.meta['file_size'].to_i\n end",
"title": ""
}... | [
{
"docid": "937e42216f7e7b38f4425b2380b8b250",
"score": "0.8230906",
"text": "def file_size\n stream.size\n end",
"title": ""
},
{
"docid": "f5db59cb191775922da7c169b811c138",
"score": "0.8138837",
"text": "def size\n file.size\n end",
"title": ""
},
{... |
8ee72932ef69df11e88b53564d853e59 | Returns the object in the form of hash | [
{
"docid": "7f2e5dd34e628cb49304452d2dd73178",
"score": "0.0",
"text": "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end",
"title... | [
{
"docid": "027facb8b195665ceeb78f2c171e2881",
"score": "0.8270299",
"text": "def to_hash\n object\n end",
"title": ""
},
{
"docid": "3be090c3f17c8013e2dee4d50a9daa36",
"score": "0.78767854",
"text": "def hash\r\n return to_s.hash\r\n end",
"title": ""
},
{
... |
e474226d9dd6e5bcd0834e6015a38ae9 | Replaces the hash without the given keys. | [
{
"docid": "38b5a918da302fae032ad7b66744dcac",
"score": "0.5895159",
"text": "def except!(*keys)\n keys.each{|key| delete(key)}\n self\n end",
"title": ""
}
] | [
{
"docid": "8d70a99a2eeaf41eec94eccc888313b7",
"score": "0.7200486",
"text": "def hash_except(hash, *keys)\n dup_hash = hash.dup\n keys.each { |key| dup_hash.delete(key) }\n dup_hash\n end",
"title": ""
},
{
"docid": "ed1cc778bb5c48ba59a7794dd779b603",
"score": ... |
6a3e4b6a24af19ab401064e31a8dddae | o: equivalent integer to string e: '4321' == 4321 e: '570' == 570 do not worry about + or signs do not worry about invalid characters, assume numeric d: string, maybe array?, maybe hash as lookup? a: loop through characters in string a: look up integer value in a Hash a: multiply by power of ten, power determined by in... | [
{
"docid": "53ea2c4b8b3116aa0f649ad70bf0f88e",
"score": "0.6927599",
"text": "def string_to_integer(string)\n integer_hash = {\n '0' => 0,\n '1' => 1,\n '2' => 2,\n '3' => 3,\n '4' => 4,\n '5' => 5,\n '6' => 6,\n '7' => 7,\n '8' => 8,\n '9' => 9\n }\n\n output_array = []... | [
{
"docid": "a5a776ead4197856971fd02aeb65e9e3",
"score": "0.7081951",
"text": "def string_to_integer(str)\n num_hsh = {'1'=>1,'2'=>2,'3'=>3,'4'=>4,'5'=>5,'6'=>6,'7'=>7,'8'=>8,'9'=>9,'0'=>0,}\n arr = str.chars.reverse\n total = 0\n new_arr = []\n arr.each do |str|\n new_arr << num_hsh[str]\n end\... |
b56d1d60532cdfd6b113d591651ed696 | GET /orders GET /orders.xml | [
{
"docid": "14c1da5764ed798ab3c523882a9d4a11",
"score": "0.74358845",
"text": "def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @orders }\n end\n end",
"title": ""
}
] | [
{
"docid": "c83b4369464919ce264f239a38b36833",
"score": "0.7507695",
"text": "def get_all_orders() \n\tputs \"Getting all orders\"\n\tresponse = request_get(\"/api/order\")\n\tputs response.body\nend",
"title": ""
},
{
"docid": "f773c17b42284037dd690d535e08ac02",
"score": "0.74852616",
... |
50a26e6b5f8a198af750fb568fc5a0ea | Wait for current creating jobs to end if have one, otherwise return immediately. | [
{
"docid": "59f030f590400cb2502af620993bb529",
"score": "0.57682663",
"text": "def wait\n if @running\n @thread.join\n end\n end",
"title": ""
}
] | [
{
"docid": "490908775f5fd9ed791b23c3f617be6a",
"score": "0.7074244",
"text": "def wait\n @jobs_queue.wait(@subscription_group.id)\n end",
"title": ""
},
{
"docid": "4c5a7882c02a7771685e3a0e0a110704",
"score": "0.70163566",
"text": "def wait_for_jobs\n with_thread_pool ... |
c48e34a15beb8f4c6d5724f10abe9be0 | Convert string to url path | [
{
"docid": "e1c2fb4d72af6f6be4bf64a178ba9987",
"score": "0.6242127",
"text": "def urlpath\n path = cleanpath\n path.blank? ? '/root' : '/' + path\n end",
"title": ""
}
] | [
{
"docid": "89826458319640da62561d2e944d9016",
"score": "0.77634573",
"text": "def url_for(str)\n return str if str =~ /^[|[:alpha:]]+:\\/\\//\n File.join((uri.path.empty?) ? uri.to_s : File.dirname(uri.to_s), str)\n end",
"title": ""
},
{
"docid": "1cc48f64bdf533a3dea0a0749515fa31",
... |
15031ce2923ab5bf336ff6bdc47bebe2 | Builds a MIME::Type object from the +content_type+, a MIME Content Type value (e.g., 'text/plain' or 'application/xeruby'). The constructed object is yielded to an optional block for additional configuration, such as associating extensions and encoding information. When provided a Hash or a MIME::Type, the MIME::Type w... | [
{
"docid": "85ad6f75f87fa4e40bceeebfbdadd8b0",
"score": "0.6670798",
"text": "def initialize(content_type) # :yields: self\n @friendly = {}\n @obsolete = @registered = @provisional = false\n @preferred_extension = @docs = @use_instead = nil\n self.extensions = []\n\n case content_type\n ... | [
{
"docid": "60f23f723a838d389d1182f3e9ee3714",
"score": "0.7083834",
"text": "def from_mime_type(mime_type) #:yields the new MIME::Type:\n m = MIME::Type.new(mime_type.content_type.dup) do |t|\n t.extensions = mime_type.extensions.map { |e| e.dup }\n t.url = mime_type.url && mim... |
cad0a0843eb22b2d8536b0876e76f2fd | still returns 7. When I place a 'return' in the middle of the add_three method definition, it just returns the evaluated result of 'number + 3' = 7, without executing the next line. NOTE: 'return' word is not required in order to return something from a method. Example: | [
{
"docid": "de7db9c72cd31cf0c35962e3088c450d",
"score": "0.0",
"text": "def just_assignment(number)\n foo = number + 3\nend",
"title": ""
}
] | [
{
"docid": "af44d91aec9b34c19f6f829880038b41",
"score": "0.89068556",
"text": "def add_three(number)\n return number + 3\n number + 4 #It won't execute this line because there is a return above it\n end",
"title": ""
},
{
"docid": "fee8181b425826f91d6b1759c31a319e",
"score": "0.88... |
75cb0ed740182cc70245e32d3d6ba6ec | data byte[] return byte[] | [
{
"docid": "199cd2710efbed319d6b2e6328a401d1",
"score": "0.0",
"text": "def transceive(data)\n return Nfc.tech_NfcB_transceive(data)\n end",
"title": ""
}
] | [
{
"docid": "e6531002bcc4551f949d5804659b72b3",
"score": "0.75306535",
"text": "def data\n self.to_byte_array.to_a.map{|x| x & 0xFF}\n end",
"title": ""
},
{
"docid": "7672a628b6176c7ca51fcca32b675ff4",
"score": "0.7508228",
"text": "def data_as_bytes\n raise \"subclass respo... |
bcf72afcb7c803c0211f74186088682c | GET /tour_interest_lists/1 GET /tour_interest_lists/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "73c3c4caba42560a33187b318c783a15",
"score": "0.7636331",
"text": "def index\n @tour_interest_lists = TourInterestList.all\n end",
"title": ""
},
{
"docid": "639f3d05f63b3b0215fb439e4d0941ca",
"score": "0.7285919",
"text": "def set_tour_interest_list\n @tour_inter... |
d53b2204fdc7a4a5a4695e1ceb626863 | found by querying the size of the data store. This should almost always be 2 (m/z and intensities) | [
{
"docid": "8003b076f868fea820c993e7e873ae06",
"score": "0.0",
"text": "def size\n @data_arrays.size\n end",
"title": ""
}
] | [
{
"docid": "583a232704c7b45a6101197dc57cb5e4",
"score": "0.76327467",
"text": "def size\n @data_store.size\n end",
"title": ""
},
{
"docid": "8623588eb27fd17d659cac2bd4079bc6",
"score": "0.7217202",
"text": "def size\n store.size\n end",
"title": ""
},
{
"... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "567a06754792c08dddd110382efe9adf",
"score": "0.0",
"text": "def set_output_schema\n @output_schema = OutputSchema.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... |
01349ed83d0aab63ca1453aff91f2d30 | DELETE /admin/countries/1 DELETE /admin/countries/1.json | [
{
"docid": "92cf7645c8a11397e9bebad9fb5fe2b5",
"score": "0.766572",
"text": "def destroy\n @admin_country.destroy\n respond_to do |format|\n format.html { redirect_to admin_countries_url, notice: 'successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title"... | [
{
"docid": "6ab1edd69037ea4b23422c7653b13e9f",
"score": "0.7467228",
"text": "def destroy\n @country.destroy\n respond_to do |format|\n format.html { redirect_to countries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ab1edd69037ea4b23... |
4d6857d52ec571c23d3c8f122f8c81e8 | DELETE /subcode_prods/1 DELETE /subcode_prods/1.json | [
{
"docid": "12739aabc7bc63883756f399c866b59a",
"score": "0.6968108",
"text": "def destroy\n @product = Product.find(params[:product_id])\n @subcode_prod = @product.subcode_prods.find(params[:id])\n @subcode_prod.destroy\n redirect_to product_path(@product)\n end",
"title": ""
}
] | [
{
"docid": "a9cdf07abd2f7a88bb3bcc4c652167b8",
"score": "0.6954467",
"text": "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].eac... |
e20d4f07ff04af033d8434038e584d76 | Indica si el lote fue vendido o no. | [
{
"docid": "607c31354585e9b1bc45dfdc55ed4624",
"score": "0.0",
"text": "def estado\n if titular\n \"Vendido\"\n else\n \"Sin vender\"\n end\n end",
"title": ""
}
] | [
{
"docid": "4ea7175d0a7e924ca0f6948a22f686cd",
"score": "0.6673031",
"text": "def estValide?\n\t\t!self.statutVisible.isTente?\n\tend",
"title": ""
},
{
"docid": "e7044786dbafd869e74f8b7f8516b1a2",
"score": "0.65770596",
"text": "def peutRetourAvant?()\n return @indiceCoup < @tabC... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "f15e5e68ef3194aee23fce5ae8b21955",
"score": "0.0",
"text": "def member_check_in_params\n params.require(:member_check_in).permit(:member_id, :event_id, :check_in_date)\n end",
"title": ""
}
] | [
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.69497335",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6812623",
"text": "def strong_params\n params.require(:listing_member).permi... |
70c072207f0d9fcbf4fb7f5db18eac50 | Returns the value of the `name` attribute. | [
{
"docid": "78ef3675cda3cb80db60e9e90f806a4c",
"score": "0.0",
"text": "def name\n @name\n end",
"title": ""
}
] | [
{
"docid": "616d0a47df20e9cdc78e0ab89d486a95",
"score": "0.8692568",
"text": "def name\n @attrs[:name]\n end",
"title": ""
},
{
"docid": "d0d3658a5bdc9669e942d86266f65966",
"score": "0.8664805",
"text": "def name\n @attrs[:name]\n end",
"title": ""
},
{
... |
c2c51a95641b3344f53a2af9cd7c041a | validates :pay_type_id, inclusion: 1..PaymentType.count | [
{
"docid": "06da9a2232558c54f23affa9a030ce1b",
"score": "0.0",
"text": "def add_line_items_from_cart(cart)\n cart.line_items.each do |item|\n item.cart_id = nil\n line_items << item\n end\n end",
"title": ""
}
] | [
{
"docid": "be5529a8cf87fd7e8794fb8864edc1f5",
"score": "0.613547",
"text": "def one_conversation_cannot_have_multiple_payments\n payments = Payment.where(:conversation_id => conversation.id)\n if payments.size > 1 || (payments.size == 1 && payments.first.id != self.id)\n errors.add(:base, \"... |
abdfc0e778adfd06e6e11837e8037ae4 | PATCH/PUT /to_dos/1 PATCH/PUT /to_dos/1.json | [
{
"docid": "dd4a6e96624d60f7fb151f01d738e455",
"score": "0.66546637",
"text": "def update\n respond_to do |format|\n if @to_do.update(to_do_params)\n format.html { redirect_to :to_dos, notice: 'To do was successfully updated.' }\n format.json { render :show, status: :ok, location: ... | [
{
"docid": "488fe1d9246880e1d92655200009b1be",
"score": "0.66045874",
"text": "def update\n @to_do = ToDo.find(params[:id])\n\n if @to_do.update(params[:to_do])\n head :no_content\n else\n render json: @to_do.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},... |
e5bd9df5174e43d72be937f15dde596b | TODO: Clarify usage in comparison to Match.voteable? Validates that the match can be voted on, because the match is in the future | [
{
"docid": "801efde4af3ffb33f0b517f0c40cd622",
"score": "0.71550727",
"text": "def voteable?\n errors.add(:base, 'Cannot vote on past matches') unless match.in_future?\n end",
"title": ""
}
] | [
{
"docid": "8af9136f5b59e66d0c6acf376fc47c7e",
"score": "0.7701485",
"text": "def voteable?\n errors.add(:base, 'Cannot vote for matches in future.') unless match.voteable?\n end",
"title": ""
},
{
"docid": "a21aa92e914cb106062d9e7d9a3ddea5",
"score": "0.6120602",
"text": "def vo... |
7820de7fd1b4425eb6708e53742d1dfa | PATCH/PUT /dog_expenses/1 PATCH/PUT /dog_expenses/1.json | [
{
"docid": "f13dae75dd5b8c754e4e5dea722975f4",
"score": "0.7086296",
"text": "def update\n respond_to do |format|\n if @dog_expense.update(dog_expense_params)\n format.html { redirect_to @dog_expense, notice: 'Dog expense was successfully updated.' }\n format.json { head :no_conten... | [
{
"docid": "e47cedb6c347c31ec4a5f3a7c358bbb9",
"score": "0.6624278",
"text": "def update\n @dog.update(dog_params)\n render json: {dog: @dog}\n end",
"title": ""
},
{
"docid": "15bb585ffa0114df6f9765ced48e18a9",
"score": "0.65983576",
"text": "def update\n \n if... |
fb75aba7c768df08f9663e18020a588e | GET /quotes/1 GET /quotes/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "951b9e5cfb794d68d6f74ab66c9bbad1",
"score": "0.7585461",
"text": "def index\n @quotes = Quote.all\n json_response(@quotes)\n end",
"title": ""
},
{
"docid": "fcea6e470d5df3d85ac1fad7c6a398bc",
"score": "0.7573483",
"text": "def show\n @quote = Quote.find(param... |
79f220fcb938b425f999f1b2b76cd023 | 3.6 Test and build the edit action create the edit action in the profiles_controller remember that the user_id comes from the url /users/123/profile/edit | [
{
"docid": "915207ca8b6c4a1775eb9de847115e39",
"score": "0.8153776",
"text": "def edit\n user = User.find(params[:user_id])\n @profile = user.profile\n end",
"title": ""
}
] | [
{
"docid": "bf0414f2716cf962654df1670e375639",
"score": "0.82292175",
"text": "def edit\n @user = User.find(params[:user_id])\n @profile = @user.profile\n \n end",
"title": ""
},
{
"docid": "1c8190c63c0b009f1f32bac0a5587f56",
"score": "0.8139889",
"text": "def edit_profile\... |
a9547f489d2fd872000c85f0b0a05afa | use this method to enter top of incremental range of numbers to use | [
{
"docid": "faf74cfa2ce5beec39d13ba39237288f",
"score": "0.0",
"text": "def sum_of_squares(n)\n array = []\n i = 1\n n.times do\n array << i\n i += 1\n end\n sum = array.map { |x| x = x**2 }.inject(0, :+)\nend",
"title": ""
}
] | [
{
"docid": "17d43e9426eb6cd87939fe9792af2ca6",
"score": "0.6666096",
"text": "def auto_range(direction); end",
"title": ""
},
{
"docid": "f8e3bcc1ab4b30abdccd5079c7ded72a",
"score": "0.6547124",
"text": "def printing_numbers_v2(number, increment)\n numbers = []\n range = 0..number\... |
cc985a84346445485e1f1c1deeeb1dd5 | Get all unbonding delegations from a validator | [
{
"docid": "3bf7d0ee991a08e09a2348cd89c4d32e",
"score": "0.6777241",
"text": "def staking_validators_validator_addr_unbonding_delegations_get(validator_addr, opts = {})\n data, _status_code, _headers = staking_validators_validator_addr_unbonding_delegations_get_with_http_info(validator_addr, opts)\... | [
{
"docid": "4e024580b36b0e378472868693ecc5a6",
"score": "0.65797466",
"text": "def get_indirect_delegates(g)\n direct = get_direct_delegates(g)\n delegates = get_delegates(g)\n delegates.remove_all(direct)\n return delegates\n end",
"title": ""
},
{
"docid": "680bb3234... |
de815188a1387a4fd2ad5f0161468d11 | GET /habitacions/1 GET /habitacions/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "d03d5d6287bdf80065a8e69e668cdaa3",
"score": "0.7444065",
"text": "def show\n render json: @habit\n end",
"title": ""
},
{
"docid": "da186d435ac0f1a1507d4f97549822f1",
"score": "0.73347336",
"text": "def show\n @habitacione = Habitacione.find(params[:id])\n\n res... |
305309bdffe2a87e7fa165c309034d3c | Download a fitnesse.jar into the given path. | [
{
"docid": "d527742a7b31f737994ba5bda66cbc15",
"score": "0.8762791",
"text": "def download_fitnesse(path)\n puts \"Downloading fitnesse.jar version #{FITNESSE_VERSION} ...\"\n Dir.chdir(path) do\n `wget --quiet #{FITNESSE_DOWNLOAD} -O fitnesse.jar`\n end\n end",
"title": ""
}
] | [
{
"docid": "e056f89245a3a0612f4bb504db55b76a",
"score": "0.589805",
"text": "def download!(url, path)\n raise CommandFailed unless download(url, path)\n end",
"title": ""
},
{
"docid": "cc7deab3f80e3b820b59f9556331a5cb",
"score": "0.5888191",
"text": "def download_artifact(pa... |
ed549b25e0b7e16895fb3d382e00bcaa | => nil, because the sum of all elements is 10 and there is no 5 in the array Anagrams Write a method anagrams? that takes in two words and returns a boolean indicating whether or not the words are anagrams. Anagrams are words that contain the same characters but not necessarily in the same order. Solve this without usi... | [
{
"docid": "1d4654940411377b6cf620f70962d478",
"score": "0.8303456",
"text": "def anagrams?(word1, word2)\n\tarr1 = word1.split(\"\")\n \tarr2 = word2.split(\"\")\n\n count = Hash.new(0)\n \tcount2 = Hash.new(0)\n\n \tarr1.each {|word| count[word] += 1}\n \tarr2.each {|word| count2[word] += 1}\n\n... | [
{
"docid": "08b7d86c541252e9d541274ce31652f1",
"score": "0.8426942",
"text": "def are_anagrams?\n # for all inputs, split them to an array, and return an array of the sorted characters\n # then find out how many unique arrays we have\n # the words are all anagrams IFF we have an array of ... |
58ed4cff1947abd96e5dd90215cc73c5 | read all the junk from .ods | [
{
"docid": "d917e6fa8a0de96b58d97b015473b06a",
"score": "0.5622377",
"text": "def ods_read(file_name)\n s = SimpleSpreadsheet::Workbook.read(file_name)\n s.selected_sheet = s.sheets.first\n\n rows = []\n s.first_row.upto(s.last_row) do |cell_line|\n one_row = []\n for coli in 1..20 do\n c... | [
{
"docid": "2704ad8733068e2df50449bb38ad5c0a",
"score": "0.598153",
"text": "def SKIP_test_from_stream_openoffice\n after Date.new(2009,1,6) do\n if OPENOFFICE\n filecontent = nil\n File.open(File.join(TESTDIR,\"numbers1.ods\")) do |f|\n filecontent = f.read\n p f... |
b5eca5cf7527abc669a06e105e367b11 | PATCH/PUT /consolas/1 PATCH/PUT /consolas/1.json | [
{
"docid": "f0e1c6e988d91f697579661a96f3fe36",
"score": "0.68400306",
"text": "def update\n respond_to do |format|\n if @consola.update(consola_params)\n format.html { redirect_to @consola, notice: 'Consola was successfully updated.' }\n format.json { render :show, status: :ok, loc... | [
{
"docid": "61f1daf095a795c2d797321aae83de08",
"score": "0.66298735",
"text": "def update\n respond_to do |format|\n if @cola.update(cola_params)\n format.html { redirect_to @cola, notice: 'Cola was successfully updated.' }\n format.json { render :show, status: :ok, location: @cola... |
a9a6cb06b99487e84f4e14f24806acc6 | Return the default state | [
{
"docid": "d2b8e7070c969b1c933dc931faa3a552",
"score": "0.85802877",
"text": "def default_state; @__default_state; end",
"title": ""
}
] | [
{
"docid": "1ee988a2e846637f60e16e7c4ef3103c",
"score": "0.8403512",
"text": "def default_state\n :initial\n end",
"title": ""
},
{
"docid": "e83ccfde8eeefb9414400b6ef11d16b3",
"score": "0.821397",
"text": "def default_state_value\n @default_state_value ||= states.... |
85d806d305d4835d7412f259fb42c9f1 | The scope that this class should return for the select array of Renderables for swapping nodes. This is not a scope because it returns elements outside the class, BUT IT MUST RETURN A SCOPE | [
{
"docid": "3af4937171bfa0d1f84c157f5edc7d9e",
"score": "0.0",
"text": "def node_options(node, opts = {})\n Renderable.for_region(node.region).not_of_type(:banner).for_roleable(opts[:user])\n end",
"title": ""
}
] | [
{
"docid": "b6c28fa31e52ed85ce7fd7b19d3eb4be",
"score": "0.6232839",
"text": "def scope\n Array self.class.scope\n end",
"title": ""
},
{
"docid": "a497026830ca25ae6fb46ba12a85b043",
"score": "0.61451054",
"text": "def scope\n @scope ||= [self]\n end",
"title": ""... |
f4381007bad3a053e9c0cf62cc58b38c | The column number of the parser's current position. | [
{
"docid": "9bfd51b9a7c804c6ddb33e35e1b7dbd9",
"score": "0.0",
"text": "def offset; end",
"title": ""
}
] | [
{
"docid": "3d5a32aeccf7c2259c7a9c99a0da7c02",
"score": "0.8558929",
"text": "def column_number()\n if line_number() == 1 then\n return @position + 1\n else\n return @position - @line_endings[0]\n end\n end",
"title": ""
},
{
"docid": "9e710... |
9d6631e75a683d925cb133a711274731 | GET /elders/1 GET /elders/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "24601f768d7dcde00f4a79863e966826",
"score": "0.70252436",
"text": "def index\n @elders = Elder.all\n end",
"title": ""
},
{
"docid": "e5491d2975929f72bf6f5d1fd00a3399",
"score": "0.6896463",
"text": "def get_elder_data\n @user_id = JSON.parse(request.body.read)\n ... |
6907ed2822b0a651a331ad361357b017 | A random string creator that draws from all printable ASCII and High ASCII characters from 33 to 256. Default length is 10 characters. | [
{
"docid": "e1445f4dea3441bfa34850a99626a838",
"score": "0.85752374",
"text": "def random_high_ascii(length=10, s=\"\")\n length.enum_for(:times).inject(s) { s << rand(223) + 33 }\n end",
"title": ""
}
] | [
{
"docid": "62a2cade101f2c0849d29f799773273d",
"score": "0.85385215",
"text": "def random_high_ascii(length=10, s=\"\")\n length.enum_for(:times).inject(s) do |result, index|\n s << rand(223) + 33 \n end\n end",
"title": ""
},
{
"docid": "d54e42eac5948104d760c6df9ae600b4",
"s... |
c5bbac7ade764807760f7c0dcaee9d17 | GET Shape by Id /gtfs/shapes/shapeId/:shape_id | [
{
"docid": "df072d72feeab279e025753d46aa06f7",
"score": "0.85461825",
"text": "def route_by_shape_id(shape_id)\n get \"/gtfs/shapes/shapeId/#{shape_id}\"\n end",
"title": ""
}
] | [
{
"docid": "04398e311703e3941652e33c9c4d448c",
"score": "0.8181155",
"text": "def route_shape_by_geometry_id(shape_id)\n get \"/gtfs/shapes/geometry/#{shape_id}\"\n end",
"title": ""
},
{
"docid": "38f0b166e9268be4a057e5e6552a6c13",
"score": "0.7693485",
"text": "def route_sh... |
bc8a5dd83352b19b7b5c94d94329072f | lists exhibits from museum. Will change to scraped info one scraper class built | [
{
"docid": "1519bc3c17eaa0f0cccb7689d98be660",
"score": "0.62271273",
"text": "def list_exhibits\n puts \" 1) Vangogh - Through July 2017\"\n puts \" 2) Monet - Through Oct 2018\"\n puts \" 3) Warhol- Through Nov 2018\"\n end",
"title": ""
}
] | [
{
"docid": "ec262b3f45cb2d84c8072f65ef6b4193",
"score": "0.6321142",
"text": "def index\n @museum = Museum.find params[:museum_id]\n @exhibitions = Exhibition.all\n end",
"title": ""
},
{
"docid": "239ef2bf256791437769132754fc801b",
"score": "0.6115792",
"text": "def show\n ... |
49da1f866ad149ad8015b219e795e3d7 | Custom attribute writer method with validation | [
{
"docid": "4f3eb4e1e3468aa5eb4a51adbfd98135",
"score": "0.0",
"text": "def shipto_first_name=(shipto_first_name)\n if !shipto_first_name.nil? && shipto_first_name.to_s.length > 30\n fail ArgumentError, 'invalid value for \"shipto_first_name\", the character length must be smaller than or eq... | [
{
"docid": "5a0bcdaca95c21b13aacca36f9fad742",
"score": "0.6955513",
"text": "def _write_attribute(attr_name, value); end",
"title": ""
},
{
"docid": "5812dd7a37c0eccc3d9481c23d74c649",
"score": "0.69278884",
"text": "def write_attribute(attr_name, value); end",
"title": ""
},
... |
51e579a46f03f3b0d0502dc5d28c424a | Used internally to stuff the item into the schedule sorted list. +timestamp+ can be either in seconds or a datetime object. The insertion time complexity is O(log(n)). Returns true if it's the first job to be scheduled at that time, else false. | [
{
"docid": "fe5406a1e8a6f37b937962b5e76131df",
"score": "0.55847543",
"text": "def delayed_push(timestamp, item)\n # First add this item to the list for this timestamp\n redis.rpush(\"delayed:#{timestamp.to_i}\", encode(item))\n\n # Store the timestamps at with this item occurs\n ... | [
{
"docid": "b11feca65d7928f0897b5a01d9f086fb",
"score": "0.63837075",
"text": "def scheduled?() job && job.run_at > job.created_at end",
"title": ""
},
{
"docid": "08226908c7efd29c9aaf5a38a422f255",
"score": "0.61899567",
"text": "def monotonic?\n prev_time = nil # arg... |
0eeef6a7f9596b3f225494cfe301a674 | POST /portfolios or /portfolios.json | [
{
"docid": "0e15a8dcf5b0fd0666d40992ff161e5a",
"score": "0.0",
"text": "def create \n @portfolio = Portfolio.create(portfolio_params)\n @strengths = @portfolio.strength\n\n respond_to do |format|\n if @portfolio.save\n format.html { redirect_to @portfolio, notice: \"Portfolio was s... | [
{
"docid": "cdba1d329718916860bad7ac7c395c72",
"score": "0.711475",
"text": "def portfolios options = {}\n perform_get(\"/me/portfolios\", options)\n end",
"title": ""
},
{
"docid": "1f97fb1daedfee713b755eb514c13bfb",
"score": "0.6872262",
"text": "def portfolios options ... |
0265af3bdacc0c2d3ae4d7696c96a25a | title of the current page | [
{
"docid": "130b412ae9981823a904969301cf78f5",
"score": "0.8451149",
"text": "def title\n @global_page.title\n end",
"title": ""
}
] | [
{
"docid": "a48b4df2c3211068f73473525263498c",
"score": "0.836361",
"text": "def page_title\n page.title\n end",
"title": ""
},
{
"docid": "018eeb80f07f7ec1877c9cae04f8f449",
"score": "0.83094066",
"text": "def page_title\n end",
"title": ""
},
{
"docid": "... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "a9f4bbbb41b17d9141fc97632ef57ae7",
"score": "0.0",
"text": "def set_list\n @list = List.find(params[:list_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... |
656e606f5cd34768aaeee5b426828b47 | POST /companies POST /companies.json | [
{
"docid": "4fba48df4cd4131b1e7e1d5e29a6e73c",
"score": "0.62437177",
"text": "def create\n @company = Company.new(params[:company])\n @company.create_default_infos\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company successfully crea... | [
{
"docid": "b898c2fa65abd666971b2f50a2edd2c2",
"score": "0.75086176",
"text": "def create\n render json: Company.create(params[\"company\"])\n end",
"title": ""
},
{
"docid": "0f0a69a99ad286f874bb552b0e865616",
"score": "0.7454409",
"text": "def create\n if @company = Company.... |
1ac401ff8d779bcf59e5afa890f683be | POST /arduinos POST /arduinos.xml | [
{
"docid": "24e838789e1fff1b459d7d0d4f6aaa1e",
"score": "0.5423472",
"text": "def create\n @arduino = Arduino.new(params[:arduino])\n @arduino.user_id = current_user.id\n @arduino.device_key = Arduino.generate_device_key\n\n respond_to do |format|\n if @arduino.save\n flash[:noti... | [
{
"docid": "fa8fcc23911ab0c33dc007eceacc29f5",
"score": "0.613412",
"text": "def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"title": ""
},
{
"docid": "c78e0b38d566040be... |
5c5d564fa4329dec35eead22d153488c | POST /post345s POST /post345s.xml | [
{
"docid": "98466e4fc06ebc9cc47966220ca699de",
"score": "0.5899283",
"text": "def create\n @post345 = Post345.new(params[:post345])\n\n respond_to do |format|\n if @post345.save\n format.html { redirect_to(@post345, :notice => 'Post345 was successfully created.') }\n format.xml ... | [
{
"docid": "adbd4063f9795c23205a346f6dfd3f22",
"score": "0.7018137",
"text": "def post uri, args = {}; Request.new(POST, uri, args).execute; end",
"title": ""
},
{
"docid": "ff64f712ca5c171b73151901dc47c4f6",
"score": "0.66723424",
"text": "def postRequest\n assertRequestData\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.0",
"text": "def set_subscription\n @subscription = Subscription.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;... |
eda2388524a637ffb9a78d8692455697 | DELETE /groups/1 DELETE /groups/1.json | [
{
"docid": "ae3a368a746657cbe16df3ec9d5a3f86",
"score": "0.0",
"text": "def destroy\r\n @subgroup.destroy\r\n respond_to do |format|\r\n format.html { redirect_to groups_path, notice: 'Apakšgrupa veiksmīgi dzēsta' }\r\n end\r\n end",
"title": ""
}
] | [
{
"docid": "a5e8a4421953376febab0141008a7c88",
"score": "0.80835795",
"text": "def DeleteGroup id\n \n APICall(path: \"groups/#{id}.json\",method: 'DELETE')\n \n end",
"title": ""
},
{
"docid": "22ed06d7595ed890646c3511f62595b6",
"score": "0.7981873",
"text"... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "339bd099a06059fbf0cf90ba702b0c4c",
"score": "0.0",
"text": "def order_params\n params.require(:order).permit(:bike, :price, :days, :total, :bike_id, :profile_id)\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... |
a838e131cd01fd0fca6a7d74aeae8420 | POST /patient_vaccines POST /patient_vaccines.json | [
{
"docid": "c442f41604169566b6f5b41527b704f2",
"score": "0.69078285",
"text": "def create\n @patient_vaccine = PatientVaccine.new(patient_vaccine_params)\n\n respond_to do |format|\n if @patient_vaccine.save\n format.html { redirect_to @patient_vaccine, notice: 'Patient vaccine was suc... | [
{
"docid": "0d96838e01e887b7b5b8235ce5c36bea",
"score": "0.67344916",
"text": "def patient_vaccine_params\n params.require(:patient_vaccine).permit(:patient_id, :vaccine_id)\n end",
"title": ""
},
{
"docid": "4b1484d4b9628c1ac323822800fe7bcf",
"score": "0.6634671",
"text": "d... |
1b39cd3ea048eacad4e44708fe0aaa0f | def cache_delivery_id shop, delivery_id account = Account.find_by(insales_subdomain: self.prepare_domain(shop)) account.delivery_id = delivery_id account.save end def get_delivery_id shop Account.find_by(insales_subdomain: self.prepare_domain(shop)).delivery_id end | [
{
"docid": "f0c6b2266f7596bddcbe2dd47436a0c5",
"score": "0.0",
"text": "def uninstall shop, password\n account = Account.find_by(insales_subdomain: self.prepare_domain(shop))\n return true unless account\n return false if account.password != password\n\n account.destroy\n true\n... | [
{
"docid": "1c8223fc05fe44ce67cb8a87959485f1",
"score": "0.67179835",
"text": "def set_delivery\n @delivery = Delivery.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "56f4aad3662e5a4177436546c0f14a95",
"score": "0.67013776",
"text": "def cache_delivery_pricing!\... |
c4eb478763d90528ed37f6715c1d80d1 | Loads a YAML translations file. The data must have locales as toplevel keys. source://i18n//lib/i18n/backend/base.rb251 | [
{
"docid": "64f2042977e9ebfb8561d5622c8679f8",
"score": "0.6920773",
"text": "def load_yaml(filename); end",
"title": ""
}
] | [
{
"docid": "b19516e1228e294002b5a70c74ec8e2b",
"score": "0.72406995",
"text": "def load_yml(filename); end",
"title": ""
},
{
"docid": "8c532e28499a27b6bed4ad0dc0d1175a",
"score": "0.6987751",
"text": "def load_i18n\n res = YAML.load_file(File.join(File.dirname(__FILE__), 'i... |
0d3303aa3945e0bbd64e2a6ae58ca330 | POST /application_cargos POST /application_cargos.json | [
{
"docid": "b1840b32852eebdab58b68a284d55e0e",
"score": "0.61008084",
"text": "def create\n @application_cargo = ApplicationCargo.new(params[:application_cargo])\n\n respond_to do |format|\n if @application_cargo.save\n format.html { redirect_to @application_cargo, notice: '申请表货物创建成功' ... | [
{
"docid": "5cbca6155fc9120628ad059ae1f0dc92",
"score": "0.66047966",
"text": "def index\n @application_cargos = @application.application_cargos\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @application_cargos }\n end\n end",
"title": ""
... |
6e098ea89f11e29cfcf6d2273df514e7 | Retrieves a loyalty reward. | [
{
"docid": "cb7430d6f1a6585e1e052629269c1afe",
"score": "0.764997",
"text": "def retrieve_loyalty_reward(reward_id:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/loyalty/rewards/{reward_id}'\n _query_builder = APIHelper.append_url_with_templa... | [
{
"docid": "b042f5890bc883713d3cfb30edefa139",
"score": "0.64420265",
"text": "def redeem_loyalty_reward(reward_id:,\n body:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/loyalty/rewards/{reward_id}/redeem'\n _que... |
18b45ca4361f27577723aa91c4853f6e | ......................................................................................................... roster management ......................................................................................................... | [
{
"docid": "14533798f2b375f35628da799d1cc5c8",
"score": "0.0",
"text": "def on_roster_result(pipe, stanza)\n process_roster_items(pipe, stanza)\n end",
"title": ""
}
] | [
{
"docid": "6ae3b7a0428ccffb72c540a34e88d108",
"score": "0.77416235",
"text": "def roster \n @roster\n end",
"title": ""
},
{
"docid": "a6c57a3b46a435f1a0e5c6d3ea2bca5e",
"score": "0.7488519",
"text": "def roster\n @roster\n end",
"title": ""
},
{
"doc... |
fe281a7f8c5f3494f07211ea11d60bca | Overwritten methods from devise (login/logout urls) | [
{
"docid": "d79be6f19bb0a1227e0e6d0c857559b7",
"score": "0.0",
"text": "def after_sign_in_path_for(resource)\n admin_bands_url\n end",
"title": ""
}
] | [
{
"docid": "cc67149c0aaaff18145503917a5f8acb",
"score": "0.7071012",
"text": "def user_logout\n \"/users/logout\"\nend",
"title": ""
},
{
"docid": "7b47c38a2c587fc5c5dcb5b2c4a85452",
"score": "0.7054946",
"text": "def _before_logout; end",
"title": ""
},
{
"docid": "a1397... |
5a5a77deed2659fa66f9747027e99bc7 | Sets the +value+ on the +Stack+, which is always the value returned by the last completed expression or function body. If the given +value+ is another +Stack+, this new stack replaces the state of the receiver; this takes place when a +Continuation+ is called. If the +value+ is a +Frame+, it is pushed onto the stack an... | [
{
"docid": "8ac30604965297752364a7e6e76afab5",
"score": "0.8299516",
"text": "def value=(value)\n @value = value\n @unwind = (Stack === @value)\n @tail = (Frame === @value)\n restack!(value) if @unwind\n end",
"title": ""
}
] | [
{
"docid": "f47a896c98ec5716a57f3fae426d8596",
"score": "0.7171752",
"text": "def with_current_value(value)\n begin\n @current_value_stack << value\n yield\n ensure\n @current_value_stack.pop\n end\n end",
"title": ""
},
{
"docid": "472a80... |
5df2a8de1d3ab44d46eef2eeee063597 | Get merchant sales report | [
{
"docid": "e3d85755e6bc61693dab358ff31401a7",
"score": "0.7240386",
"text": "def getSalesReport(year, month)\n #url = sprintf('https://market.android.com/publish/salesreport/download?report_date=%04d_%02d', year, month)\n url = sprintf('https://play.google.com/apps/publish/salesreport/download?re... | [
{
"docid": "c2a0c9afd9b9cca0f8246e7a373385d1",
"score": "0.70900077",
"text": "def sales\n FarMar::Sale.get_by(\"vendor\", id)\n end",
"title": ""
},
{
"docid": "3e478da33cf234c583edeb5acfe37119",
"score": "0.6914474",
"text": "def sales\n Sale.find_all_by_vendor_id(@id)\n en... |
67d9366a66b5f8f461b8442d19cb50e0 | Return the atoms in this unit cell. By default returns only the visible atoms, but this method will return all of the atoms if called with (visibleOnly = false) | [
{
"docid": "076aa1c60747a9b2a057af228d49c94e",
"score": "0.76375145",
"text": "def atoms(visibility = :visibleOnly)\n if (visibility == :visibleOnly) and (0 < @clip_planes.size)\n @visibleAtoms\n else\n @atoms\n end\n end",
"title": ""
}
] | [
{
"docid": "8185794ef954b5b2782c5704b9642c55",
"score": "0.731214",
"text": "def atoms\n unit.atoms\n end",
"title": ""
},
{
"docid": "8185794ef954b5b2782c5704b9642c55",
"score": "0.731214",
"text": "def atoms\n unit.atoms\n end",
"title": ""
},
{
"docid":... |
b90b847c4fe1e5113e480e01085e1afd | Yield each line in the range. | [
{
"docid": "cd6c96ed6a2f386f41f7509a259478aa",
"score": "0.0",
"text": "def each(&block)\n to_a.each(&block)\n end",
"title": ""
}
] | [
{
"docid": "6a2a85a6b0f6e5af820a6ba4a6806266",
"score": "0.8171482",
"text": "def range_by_lines(range); end",
"title": ""
},
{
"docid": "572af596969ec5b7849d0a42f0c55c8f",
"score": "0.73131806",
"text": "def each\n current_line = 1\n update do\n until current_line >... |
6f3409ac7105e5bf24b56edf309e16b3 | DELETE /creator_metrics/1 DELETE /creator_metrics/1.json | [
{
"docid": "225cebb5ba8c133cb9ec43681601d06e",
"score": "0.74454",
"text": "def destroy\n \n @creator_metric.destroy\n respond_to do |format|\n #@creator_metrics=CreatorMetric.select(\"creator_exts.avatar,creator_exts.category_id,users.sex,users.username,users.description,users.user_comment,... | [
{
"docid": "ae032290a9d347ef4e3b89c92129c190",
"score": "0.74232644",
"text": "def destroy\n metric.destroy\n\n respond_with(metric)\n end",
"title": ""
},
{
"docid": "7f86ce0305c3cfdf088da7e0f157b7d4",
"score": "0.7221236",
"text": "def destroy\n @metric.destroy\n respo... |
66d26d9690be17ec54254dc1ca0dfcb1 | +yy +zz xyz What is 'z'? | [
{
"docid": "f0e8d46389baeb629d03f2a9b31b51cc",
"score": "0.5181564",
"text": "def find_xyz\n x = 0\n y = 0\n z = 0\n\n while x.to_s.length <= 2\n while y.to_s.length <= 2\n while z.to_s.length <= 2\n puts \"X: #{x}, Y:#{y}, Z:#{z}\"\n if x.to_i + y.to_i + z.to_i == \"#{x.to_s[0... | [
{
"docid": "9e2250d509e8c705b87b452f20338490",
"score": "0.6206777",
"text": "def z(a,t)\n ((a-t)+$o)%26 + t\nend",
"title": ""
},
{
"docid": "199eec707674ab25e79ad78e7eee0228",
"score": "0.6066317",
"text": "def asciicode\n\t\"z\".ord\nend",
"title": ""
},
{
"docid": "5... |
20fb2f8e8123c205742912051da1e65a | Iterates through options declared as deprecated, maps values to their replacement options, and prints deprecation warnings. | [
{
"docid": "27a36cf4915f515e1a0551f50d862568",
"score": "0.78147346",
"text": "def handle_deprecated_options(show_deprecations); end",
"title": ""
}
] | [
{
"docid": "ccf92b25daa62485718ef185b05e81ad",
"score": "0.7478735",
"text": "def deprecated_options_warning\n ::Guard::UI.deprecation(WATCH_ALL_MODIFICATIONS_DEPRECATION) if options[:watch_all_modifications]\n ::Guard::UI.deprecation(NO_VENDOR_DEPRECATION) if options[:no_vendor]\n end",
... |
5ff179412069b9879939f5b39aebc439 | POST /messages POST /messages.json | [
{
"docid": "d4974f9f0263fe596326d5eb377c7693",
"score": "0.0",
"text": "def create\n @message = Message.new(message_params)\n\n if @message.save\n redirect_to messages_url, notice: \"Message was successfully created.\"\n else\n redirect_to messages_url, alert: \"Message was un... | [
{
"docid": "e18d18e71266c27bcbba27d76e6fe2b4",
"score": "0.7465386",
"text": "def post(content)\n post_to(\"/api/v1/messages/\", {:body => content})\n end",
"title": ""
},
{
"docid": "0d382a399c00f58d58fd4c7a76bcbd9d",
"score": "0.71694404",
"text": "def create\n message = Mes... |
0af8f83068947048d6d461a4f6ed599f | => 4202692702.....8285979669707537501 Using fast doubling algorithm | [
{
"docid": "d3ed8d2a98d5a7b2bb0b37f95cfef655",
"score": "0.5753554",
"text": "def fibonacci_fast_doubling(n)\n return 1 if n <= 2\n\n nums = []\n while n > 0\n nums << n\n n /= 2\n end\n\n a = 0 # F(n) = F(0)\n b = 1 # F(n + 1) = F(1)\n\n until nums.empty?\n n = nums.pop\n c = a *... | [
{
"docid": "91266abbc0608a7b867cb820f7f9667a",
"score": "0.6872687",
"text": "def sturges\n len = array.length\n return 1.0 if len == 0\n\n # return (long)(ceil(Math.log2(n)) + 1);\n return Math.log2(len).ceil + 1\n end",
"title": ""
},
{
"docid": "7580ee4b3bb65a573c0e6df70314d4... |
9f15ca059d8c0a8600e1febb9cdb768b | Gets all special page aliases. | [
{
"docid": "945300454b2fdb55657880cb25a7a501",
"score": "0.8615994",
"text": "def get_special_page_aliases\n response = get_siteinfo('specialpagealiases')\n ret = {}\n response['query']['specialpagealiases'].each do |i|\n ret[i['realname']] = i['aliases']\n ... | [
{
"docid": "75d02e457c5e91262241222303cf8a01",
"score": "0.7100489",
"text": "def get_aliases\n resp = get do |req|\n req.url \"/_aliases\"\n end\n resp.body\n end",
"title": ""
},
{
"docid": "68d8866bbb3f83a93266927b81806bb1",
"score": "0.67948896",
"text": ... |
a33dc87e1a35fd63f27e2a94ef89ea3f | PUT /projects/1 PUT /projects/1.xml | [
{
"docid": "5856dae898c7c1bce8dfd121613313ad",
"score": "0.61547166",
"text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:project])\n format.html { redirect_to(@document, :notice => 'Project was successfully u... | [
{
"docid": "fe2a0e0ebaafeeb29a99a865a9a8cd81",
"score": "0.7653758",
"text": "def test_should_update_project_via_API_XML\r\n get \"/logout\"\r\n put \"/projects/1.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n ... |
a8a8773f9bb7cafc8b695b416c4b60e6 | This function acts like belongs_to association | [
{
"docid": "0d32a6a125c823e06a350b54f3929d76",
"score": "0.0",
"text": "def moment_category\n MomentCategory.find(self.moment_category_id)\n end",
"title": ""
}
] | [
{
"docid": "8eed518c3bf241590321c2a71213d959",
"score": "0.789343",
"text": "def belongs_to?; end",
"title": ""
},
{
"docid": "029f1da1ad0bc5189382a8ff031a6586",
"score": "0.76549053",
"text": "def belongs_to\n associated_models :belongs_to\n end",
"title": ""
},
{
... |
13f4f49d75fb06ce6ae14ef7364ae80c | Return true if the file contains a section with name NAME | [
{
"docid": "1be4795204c29630d4ddba85e9061db3",
"score": "0.573251",
"text": "def include?(name)\n ! self[name].nil?\n end",
"title": ""
}
] | [
{
"docid": "750f5ff43d9d0638bb8d0e9988abb827",
"score": "0.8180163",
"text": "def has_section?( section_name )\n\n KeyError.not_new( section_name, self )\n\n raise ArgumentError.new \"No file found at [ #{@file_path} ]\" unless File.exists? @file_path\n the_text = File.read @file_path\n ... |
b6fac619bfd579c715940f09f0de5549 | OPTIMIZE: This method should not be redefined here! | [
{
"docid": "b2b91a6a5b16a80fab2c673a087fc2c7",
"score": "0.0",
"text": "def admin_user\n typus_users(:admin)\n end",
"title": ""
}
] | [
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.6625348",
"text": "def used; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.6625348",
"text": "def used; end",
"title": ""
},
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"sc... |
f377be7fbe6ace95009050c297ca21b2 | GET /posts GET /posts.xml | [
{
"docid": "994c3949df6da8e477ea190ec4c7e195",
"score": "0.0",
"text": "def index\n @posts = Post.all\n #BEG ADD\n session[:current_location] = posts_path\n #END ADD\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
... | [
{
"docid": "96353a9632432f29bdb1830a6be90489",
"score": "0.7288356",
"text": "def index\n @posts = Post.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "f2ee44b73f3580e582... |
358aad152b7e2375b4daa0e8642ec927 | GET /items/:id GET /items/:id.json | [
{
"docid": "a6510721b7f868afb684f9a26642898c",
"score": "0.0",
"text": "def edit\n @item = Vger::Resources::Suitability::Item.find(params[:id], :methods => [:item_type])\n respond_to do |format|\n format.html\n end\n end",
"title": ""
}
] | [
{
"docid": "54748291efc0ecbbc050090a2600e1b8",
"score": "0.81715053",
"text": "def show\n @items = Item.find(params[:id])\n render json: @items\n end",
"title": ""
},
{
"docid": "eb354ffc8205e277e16c339add996ccd",
"score": "0.79645485",
"text": "def show\n item = Item.find(... |
c225b5f64741b6fad42d381c947f91e8 | Get Customer by ID | [
{
"docid": "a5d42bc0f2af7229441cb8583db767a0",
"score": "0.65693206",
"text": "def get_customer_by_id_with_http_info(project_key, id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.get_customer_by_id ...'\n end\n # verify the... | [
{
"docid": "360133f338e28c4eaa1bbb88f8184876",
"score": "0.8832006",
"text": "def get_customer(id)\n get(\"customers/#{id}\")\n end",
"title": ""
},
{
"docid": "360133f338e28c4eaa1bbb88f8184876",
"score": "0.8832006",
"text": "def get_customer(id)\n get(\"customers/#{id}\")\n ... |
f5ed9ac65771478f4d03d3d2682db2bb | Put javascripts to the htmlhead | [
{
"docid": "93ed2fd55ea09c3d8c667c289e5fdcf9",
"score": "0.70331943",
"text": "def javascript(*args)\n content_for(:head) { javascript_include_tag(*args) }\n end",
"title": ""
}
] | [
{
"docid": "03f9a45b48a0b3810259adfca85d0ae3",
"score": "0.76149",
"text": "def head_prepend_javascript\n [init_javascript(:head_prepend)].delete_if{|s| s.blank?}.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "4b3c297d95dcc7f2f0fb6de444d0dbf5",
"score": "0.7440965",
"text":... |
e7acbe6c633f9f725c87d135988b6eab | Calculates predicted deaths based on population density and population by using conditional logic. Also prints the data. | [
{
"docid": "7cd16ee80c9008e51b1b57eba5888d77",
"score": "0.0",
"text": "def predicted_deaths\n # predicted deaths is solely based on population density\n\n if @population_density >= 200 \n incrementer = 0.4 \n elsif @population_density >= 150\n incrementer = 0.3\n elsif @populatio... | [
{
"docid": "29c86e2fec4ca5f018f3a07571be736b",
"score": "0.8417511",
"text": "def predicted_deaths\n # predicted deaths is solely based on population density\n if @population_density >= 200\n print \"#{@state} will lose #{(@population * 0.4).floor} people in this outbreak\"\n elsif @popula... |
e634d119d1dd3e44c6d4cc4137c3d54b | POST /singers or /singers.json | [
{
"docid": "4dd6794369753389152b958f5c09c234",
"score": "0.70630765",
"text": "def create\n @singer = Singer.new(singer_params)\n\n respond_to do |format|\n if @singer.save\n format.html { redirect_to @singer, notice: \"Singer was successfully created.\" }\n format.json { render... | [
{
"docid": "230adb063170ba073e62a21f983b489e",
"score": "0.6538406",
"text": "def create\n @singer = Singer.new(params[:singer])\n\n respond_to do |format|\n if @singer.save\n format.html { redirect_to singers_path }\n else\n flash[:notice] = \"Enter the name\"\n for... |
b58ca598570a2c903df8dbdcbeb9c36e | POST /likes_tutors_by_subjects POST /likes_tutors_by_subjects.json | [
{
"docid": "74f624d693ed518850d2f60411c86621",
"score": "0.7164394",
"text": "def create\n\n @likes_tutors_by_subject = LikesTutorsBySubject.new(likes_tutors_by_subject_params)\n\n respond_to do |format|\n if @likes_tutors_by_subject.save\n format.html { redirect_to @likes_tutors_by_su... | [
{
"docid": "f3a022a3b7a1207e118fa69f3b3b41e2",
"score": "0.73913085",
"text": "def set_likes_tutors_by_subject\n @likes_tutors_by_subject = LikesTutorsBySubject.find(params[:id])\n end",
"title": ""
},
{
"docid": "1f4ad67331387dc9e303b183c63b9def",
"score": "0.7347728",
"text... |