query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
1c622a89c0a016a127756ce9d2434d3c | Show story GET /api/v1/stories | [
{
"docid": "80699fbf3d1c8c9a96ae184312eed55f",
"score": "0.79320854",
"text": "def show\n @story = Story.find(params[:id])\n\n respond_with(@story)\n end",
"title": ""
}
] | [
{
"docid": "32b346e5ef1b1ae3dd03582f7dc2eb69",
"score": "0.8449843",
"text": "def stories(options = {})\n # v1/public/stories\n get('stories', options)\n end",
"title": ""
},
{
"docid": "f3c2b6d3b59753e2c8a0dfb0abe08a86",
"score": "0.837953",
"text": "def story(id, optio... |
6c87688a8730bbaeb84998d5ebdc5e86 | ================ commodities code ================ | [
{
"docid": "a6a0170e48c7b07ebe88497da78e166c",
"score": "0.5952187",
"text": "def list_commodities\n\treturn if authorise_for_web(program_name?,'read') == false \n\n \tif params[:page]!= nil \n\n \t\tsession[:commodities_page] = params['page']\n\n\t\t render_list_commodities\n\n\t\t return \n\telse\n\t\... | [
{
"docid": "99bd1f959518eb9a3631ec67ad5e3fcb",
"score": "0.6990123",
"text": "def commodities\n @commodities.values\n end",
"title": ""
},
{
"docid": "90d41df5fec6fa28fe5762c7730c4ef8",
"score": "0.6795472",
"text": "def commodities\n %x|#{self.ledger} commodities #{['--file... |
61f0f0b8818998d297240c06a43eb672 | Triggers a new incident in PagerDuty. See the PagerDuty API for more details. | [
{
"docid": "2c8d8f9709a042db184b9e02f4ebcf86",
"score": "0.60421056",
"text": "def trigger(description, incident_key=nil, details=nil)\n request 'service_key' => service_key,\n 'incident_key' => incident_key,\n 'event_type' => 'trigger',\n 'description' =>... | [
{
"docid": "65f164e4d41b08aab366cb1a856b4517",
"score": "0.65588635",
"text": "def post_incident(payload)\n begin\n payload_json = JSON.dump(payload)\n resp = pagerduty.incidents_api.post(payload_json, :content_type => :json)\n answer = JSON.parse(resp, :symbolize_names => true... |
e8b82326455139cddbc359b3cd1ae5d6 | navigation :wagons GET /wagons GET /wagons.xml | [
{
"docid": "b9db340053b40139fa4cf06ccca6b1c6",
"score": "0.7146859",
"text": "def index\n \t## @wagons = Wagon.all\n \t@wagons = Wagon.paginate :page => params[:page], :order => 'id DESC'\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wagons }\n ... | [
{
"docid": "2deeaa3371e8be73a8e20fd22bd795b2",
"score": "0.6318749",
"text": "def wagtail\n \"wag\"\n end",
"title": ""
},
{
"docid": "f7e0134e66aa514b20883a08b97f1343",
"score": "0.6283095",
"text": "def index\n @navigations = @site.navigations\n end",
"title": ""
},
... |
c2350108c1b0d888db1f63034445b308 | define what happens when the measure is run | [
{
"docid": "e18e49b360248b90ee27ba3780ae18e5",
"score": "0.0",
"text": "def run(workspace, runner, user_arguments)\n super(workspace, runner, user_arguments)\n\n # use the built-in error checking\n return false unless runner.validateUserArguments(arguments(workspace), user_arguments)\n\n zon... | [
{
"docid": "99ab945a1927e84fe17934e1440b9eb0",
"score": "0.7556993",
"text": "def measure(&block); @measure = block; end",
"title": ""
},
{
"docid": "98be183bacea0b93f865dcb476b3ac9c",
"score": "0.71152234",
"text": "def measure(&block)\n @measure = block\n end",
"title": ""
... |
7fe555af9aa1f15d599a36f0d66c208b | ! Feature SubCategory View ! Displays all items in chosen subcategory | [
{
"docid": "606d7da010173616f9966282863828f3",
"score": "0.7064614",
"text": "def sub_category_view(prompt, categories, inventory)\r\n \r\n system 'clear'\r\n \r\n # Asks user which sub_category they'd like to view\r\n choose_sub_categories = []\r\n categori... | [
{
"docid": "07e93bd6d2341801f81e4fdd86e3f334",
"score": "0.7958613",
"text": "def index\n @subcategories = @category.subcategories\n end",
"title": ""
},
{
"docid": "54fb2a2fff7db0b2715e5a222050566a",
"score": "0.7815608",
"text": "def index\n @sub_sub_categories = SubSubCateg... |
ec71193b2809c4371efc7815527b7832 | Get all item list GET /items | [
{
"docid": "f9d944a555f760688bb1c996205236db",
"score": "0.0",
"text": "def index\n # List all of the Items that are owned by the logged in User's Business\n if current_business.present?\n @items = current_business.items\n else\n # If business not yet created, redirect to create a new b... | [
{
"docid": "d57502db186679bf451e04276f7c18d6",
"score": "0.8726215",
"text": "def items\n get_request configure_payload('/items')\n end",
"title": ""
},
{
"docid": "560c4655e41c14fb7933668c11585082",
"score": "0.807775",
"text": "def list_items(params = nil, headers = nil)\n ... |
20a59749f9270a23f26c408e51216ec7 | Returns true when a request has been successful my_class = MyClass.new my_class.create_server('example.com') my_class.successful? => true | [
{
"docid": "c09112758ffb958ef1f4d0c2f6fc40ec",
"score": "0.5975991",
"text": "def successful?\n returned_parameters['status'] == 'success'\n end",
"title": ""
}
] | [
{
"docid": "b0897ae08654c8713dd1f244ff3792dd",
"score": "0.6595511",
"text": "def successful?\n success\n end",
"title": ""
},
{
"docid": "0375cb8e5719ccdde0fd531f1652cc2d",
"score": "0.65631485",
"text": "def successful?\n true\n end",
"title": ""
},
{
"docid": "... |
a9253afe7e6117935224c787dc4b3d86 | Returns an array of zeros in the specified frame. | [
{
"docid": "5f180927f46d18afc295157880f9e294",
"score": "0.6548767",
"text": "def default_nil_value(format, frame)\n Array.new(frame, 0)\n end",
"title": ""
}
] | [
{
"docid": "9eb2073799cd9852e859d4c19083eba1",
"score": "0.61494386",
"text": "def zeros(rows, cols)\n\t\tArray.new(rows) do |row|\n\t\t\tArray.new(cols, 0)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3f1e8116f246d7d4105e02839d4aa2b1",
"score": "0.5738985",
"text": "def get_zeros_ta... |
d28c19136824487d01f01839b71e4ff1 | Find emails in a IMAP mailbox. Without any options, the 10 last received emails are returned. Possible options: mailbox: mailbox to search the email(s) in. The default is 'INBOX'. what: last or first emails. The default is :first. order: order of emails returned. Possible values are :asc or :desc. Default value is :asc... | [
{
"docid": "8b8b035d315f3ef798022f24f18885a8",
"score": "0.0",
"text": "def find(options = T.unsafe(nil), &block); end",
"title": ""
}
] | [
{
"docid": "d2d6ffdf6a52ed31ddd5647401fe3b0a",
"score": "0.78211534",
"text": "def find(options = {}, &block)\n options = validate_options(options)\n \n start do |imap|\n imap.select(options[:mailbox])\n uids = imap.uid_search(options[:query].split(\" \"))\n \n ... |
50411806505e6f65ee542379a7750291 | POST /coupons POST /coupons.json | [
{
"docid": "ab46ecc7b7cf40902a122a759e44069c",
"score": "0.6504694",
"text": "def create\n params[:coupon][:code] = (params[:coupon][:code]).downcase\n params[:coupon][:valid_category] = (params[:valid_category]||{}).to_json\n params[:coupon][:valid_product] = (params[:valid_product]||{}).to_js... | [
{
"docid": "810e1d7995711d3073e6ba74a2fc91f8",
"score": "0.70953745",
"text": "def create\n @coupon = @conference.coupons.new(coupon_params)\n\n respond_to do |format|\n if @coupon.save\n format.html { redirect_to admin_conference_coupons_path(@conference), notice: 'Coupon was ... |
ff98542c767765b9f42a2b44dd25a953 | pulls all the statements by the candidate from the db for that issue. | [
{
"docid": "133fe0ab98982efcc5eae79d7741cd50",
"score": "0.5529316",
"text": "def statement_by_issue(issue)\n statements.joins(:issues).where('issues.name = ?', issue).first.try(:stance)\n end",
"title": ""
}
] | [
{
"docid": "cf5074710e7b99a619509cf6559d1e0d",
"score": "0.56579924",
"text": "def query(statement)\n collection = []\n @repos.each do |repo|\n self.class[repo].query(statement).each do |row| \n collection << row\n end\n end\n collection\n end",
"title":... |
9a03da1c99fceb8fa3cfe5ed62c3035b | Does the params hash contain a parent resource ID? params A Hash of params to send to the API. Returns Boolean | [
{
"docid": "ea1bc3538a45ab94c99d133ba03d4c7b",
"score": "0.8673613",
"text": "def params_include_parent_resource_id?(params)\n parent_resource_param(params).present?\n end",
"title": ""
}
] | [
{
"docid": "dcaa8840698120b9eec800a90b4a1699",
"score": "0.7463014",
"text": "def resource_has_parents?(resource, params)\n if !resource.persisted?\n params[:parent_id]\n else\n resource.decorate.respond_to?(:decorated_parent) && !resource.decorate.decorated_parent.nil?\n end\n end",... |
c70fffdf12d341bcf1b29d000c3702df | GET /events/1 GET /events/1.json | [
{
"docid": "1ffbcabbaaff54fa07c30334726a9a2c",
"score": "0.0",
"text": "def show\n @event = Event.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "2d5580b43c7c18bcd8a06713fa4be0f1",
"score": "0.75926495",
"text": "def show\n\t\tevent_id = params[:id]\n\t\tif event_id.present?\n\t\t\t@event = Com::Nbos::Events::Event.active_events.where(:id => event_id)\n\t\t\trender :json => @event\n\t\telse\n\t\t\trender :json => {status: 400, message... |
cb70224c17dbfa2e2cee0ddc33b9dc8d | Sets the given value as the value of this parameter. | [
{
"docid": "e5274868d305b28d9a15931f1da55bcc",
"score": "0.70856386",
"text": "def value=(value)\n validate(value)\n\n @value = munge(value)\n end",
"title": ""
}
] | [
{
"docid": "fe61adf3744b2b94fde27db3e4c0cb10",
"score": "0.81716937",
"text": "def set_value(value)\n @value = value\n end",
"title": ""
},
{
"docid": "069d14fd420d3830d83eadc8c7c0c55d",
"score": "0.8104704",
"text": "def set(value)\n @value = value\n end",
"t... |
c78d36209e1677004f57eea8d36a40b9 | POST /scan_images POST /scan_images.json | [
{
"docid": "57cef9473d800c15fac667334a2d992f",
"score": "0.5786949",
"text": "def create\n @scan_image = ScanImage.new(scan_image_params)\n @scan_image.user_id = current_user.id\n\n if @scan_image.save!\n @scan_image.scanned_image.attach(params[:scan_image][:scanned_image])\n @scan_im... | [
{
"docid": "b10fe0a6abac608f91a847ecac149de9",
"score": "0.6708768",
"text": "def scan_images\n assert_privileges(\"image_scan\")\n showlist = @lastaction == \"show_list\"\n ids = find_records_with_rbac(ContainerImage, checked_or_params).ids\n process_scan_images(ids)\n showlist... |
ac36e073e57dcf2908376976cd0d502b | store a subscribed message and its processing method in a catalog | [
{
"docid": "61194952eeb7df6c8eefdf7e4cf3328f",
"score": "0.73351246",
"text": "def insert_into_catalog(message_class, process_method)\n debug_me{[ :message_class ]}\n if @@catalog.include? message_class\n @@catalog[message_class] << process_method\n else\n @@catalog[message_... | [
{
"docid": "02641f63b5a864986686d53ba2aaec4e",
"score": "0.68691826",
"text": "def dispatch_via_catalog(message_class, payload)\n debug_me{[ :message_class, :payload ]}\n\n raise ::SmartMessage::Errors::UnknownMessageClass if message_class.nil?\n\n if @@catalog.include? message_class\n ... |
57cf7496057cc1aa45e6618d35cfe589 | POST /asset_loss_entries POST /asset_loss_entries.json | [
{
"docid": "281cc0eb6ceacdae723326681329d5b3",
"score": "0.70274585",
"text": "def create\n @asset_loss_entry = AssetLossEntry.new(asset_loss_entry_params)\n\n respond_to do |format|\n if @asset_loss_entry.save\n format.html { redirect_to @asset_loss_entry, notice: 'Asset loss entry wa... | [
{
"docid": "3669548ff6552ea006b909d8ab495dbf",
"score": "0.7039304",
"text": "def index\n @asset_loss_entries = AssetLossEntry.all\n end",
"title": ""
},
{
"docid": "ada76bcd1bed637849e053a64f2138e3",
"score": "0.6624124",
"text": "def set_asset_loss_entry\n @asset_loss_entr... |
510348f622dd3ad429be69eaa00c8709 | Create or update a ServiceEntry If a service entry with the serviceentryid is not already present, create a new service entry. If it already exists, update the service entry. | [
{
"docid": "81a473c9803fd832aaded6c8b238254b",
"score": "0.5797688",
"text": "def update_service_entry_with_http_info(service_id, service_entry_id, service_entry, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PolicyApi.update_service_entry ...\... | [
{
"docid": "2e4c311e9767eecd5bac0b071bf5e365",
"score": "0.681829",
"text": "def set_service_entry\n @service_entry = ServiceEntry.find(params[:id])\n end",
"title": ""
},
{
"docid": "752d54a49fcfe5373f2b7fdd8c1fd5cb",
"score": "0.68173677",
"text": "def update_service_entry_... |
61a6427458794443106ea9afdf9bfd55 | Inline requests do not get a layout, otherwise use the default layout. | [
{
"docid": "72ceb233cece3924ba00899acfa388bf",
"score": "0.8280081",
"text": "def layout_to_use\n inline_request? ? false : nil\n end",
"title": ""
}
] | [
{
"docid": "0db45cbf5fed9a2c6ee401beed4a0172",
"score": "0.689925",
"text": "def use_layout\n request.xhr? ? false : 'base'\n end",
"title": ""
},
{
"docid": "6afef982c42420348c7ed0d3a8ae82f9",
"score": "0.67946714",
"text": "def layout\n nil\n end",
"title": ""
},
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "556f1a5fce8214e179437a8554c16b51",
"score": "0.0",
"text": "def conversation_params\n params.require(:conversation).permit(:author_id, :companion_id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
81b01889371180a6cdc8ebeaf7d10749 | GET /survey_tungs/new GET /survey_tungs/new.xml | [
{
"docid": "a6287965030636682ee0de5a94cd032e",
"score": "0.60269445",
"text": "def new\n @survey_tung = SurveyTung.new\n\n #3.times do\n question = @survey_tung.question_tungs.build\n 2.times { question.answers.build }\n #end\n\n respond_to do |format|\n format.html # new.html.erb... | [
{
"docid": "110e07f6aa5d213a218b3c4cae64a332",
"score": "0.6946534",
"text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end",
"title": ""
},
{
"docid": "110e07f6aa5d213a218b3c4ca... |
a74f6e24ff00a4975b8cc7503a161b7b | this method asks user for character limit | [
{
"docid": "c0a865fbdcfb9a03d00b2183d13e6596",
"score": "0.63252795",
"text": "def length_selected\n puts \"Enter max number of characters\"\n num = STDIN.gets.chomp.to_i\n @students.each do |student|\n if \"#{student[:name]}\".length <= num\n puts \"#{student[:name]} (#{student[:cohort]} coh... | [
{
"docid": "7b805cdf71eba6f2de6807f8294aefe6",
"score": "0.7363302",
"text": "def char_limit; end",
"title": ""
},
{
"docid": "62f6f34cac5b870b4d55d4596c9eb130",
"score": "0.6729363",
"text": "def character_limit?\n @max_characters > 0\n end",
"title": ""
},
{
"docid"... |
205081746fc3d72a4d54960d2b3441b4 | GET /teaching_equipaments/1 GET /teaching_equipaments/1.json | [
{
"docid": "251045489d9104f611a084d024859a7e",
"score": "0.62897116",
"text": "def show\n @dept = Dept.find((params[:dept_id]))\n @teaching_equipament = TeachingEquipament.find(params[:id])\n #Checks if the dept is owner of this aequipament\n if @teaching_equipament.dept_id == @dept.id\n ... | [
{
"docid": "180f7561a0333a4bf09e54151e389cc4",
"score": "0.7432533",
"text": "def index\n @dept = Dept.find((params[:dept_id]))\n @teaching_equipaments = TeachingEquipament.where(\"dept_id = ?\", params[:dept_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json... |
ee280fb5c90e82da566abdd7ff8a5881 | handlePDUSent description UTILITY: Function will handle PDU Sent cases. INPUT: A byte array RETURNS: No returns. EXCEPTIONS: Can raise exception if input error or if it can't build a PDUPacket end function description | [
{
"docid": "0ff3d074d0b680ca0b0db473321b78d6",
"score": "0.5988057",
"text": "def handlePDUSent(pduPacket)\n\n @transactionsMutex.synchronize {\n\n Utils_visiona.verifyInput(CFDP::PDUPacket, pduPacket.class)\n\n transaction = get_transaction(pduPacket)\n\n unless transaction.ni... | [
{
"docid": "3450595282353b8666f989e77f116302",
"score": "0.61154425",
"text": "def process_pdu(pdu)\n case pdu\n when Pdu::DeliverSm\n write_pdu(Pdu::DeliverSmResponse.new(pdu.sequence_number))\n logger.debug \"ESM CLASS #{pdu.esm_class}\"\n if pdu.esm_class != 4\n # MO messa... |
ee2a790ad702c5077e192e5eac571ac4 | POST: add a new participant to current conversation | [
{
"docid": "627ad39c076d9c2629df185ef52dc1e2",
"score": "0.0",
"text": "def join_conversation\n authorize! :modify, @conversation\n @conversation.add_participant(params[:user_ids], current_user)\n render nothing: true\n end",
"title": ""
}
] | [
{
"docid": "4453c7dbc52aa560966e321903603e2e",
"score": "0.7524074",
"text": "def create\n @participant = Participant.create(participant_params)\n end",
"title": ""
},
{
"docid": "797f38d823622e8f4242eab317825618",
"score": "0.7510512",
"text": "def create\n @participant = Par... |
ef7460224c2a935107792a1a7bf7eeec | DELETE /investigationcosts/1 DELETE /investigationcosts/1.json | [
{
"docid": "60f3d3fb607957fc99c6eb96f8c2004b",
"score": "0.7579562",
"text": "def destroy\n @investigationcost.destroy\n respond_to do |format|\n format.html { redirect_to investigationcosts_url, notice: 'Investigationcost was successfully destroyed.' }\n format.json { head :no_content }... | [
{
"docid": "d5b9c8dead2889cb914b333fb85618ce",
"score": "0.7323261",
"text": "def destroy\n @line_investigation.destroy\n respond_to do |format|\n format.html { redirect_to line_investigations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid"... |
9661c152e405ff4316b94198a43d8fb4 | Retrieve a single page of UserConversationInstance records from the API. Request is executed immediately. | [
{
"docid": "3ec5dfddc55eeac1537e28ff1eac91e5",
"score": "0.0",
"text": "def page(page_token: T.unsafe(nil), page_number: T.unsafe(nil), page_size: T.unsafe(nil)); end",
"title": ""
}
] | [
{
"docid": "fb5425a7cdc9ea92f9a0e4c8cfc39bfa",
"score": "0.6528095",
"text": "def index\n @conversations = Conversation.participating(current_user.id).page(params[:page])\n end",
"title": ""
},
{
"docid": "762058d063d8b6f95da8042263fe4f42",
"score": "0.6341489",
"text": "def fetc... |
c6105563a5cf6b1ef0283a2890cbe787 | def render_object_errors(object) render_error object.errors.full_messages.to_sentence end | [
{
"docid": "24e98c5eaa9dea764681c10d8ff23dd1",
"score": "0.0",
"text": "def render_error(text)\n render_notification text, 'alert'\n end",
"title": ""
}
] | [
{
"docid": "6d814870f5819af096125e9deb3baea6",
"score": "0.8374099",
"text": "def display_errors(object)\n render partial: 'shared/error_messages', locals: { object: object }\n end",
"title": ""
},
{
"docid": "bf85f86c397c316b4f5596d940a1a378",
"score": "0.83266103",
"text": "def... |
52017b842e04fd2c2c160a9c02960abc | Format a datetime prettily | [
{
"docid": "f2796e0a3e106966458b7930a1ce1e52",
"score": "0.0",
"text": "def get_date_and_time(datetime)\n\n %W(#{get_time_of_event(datetime)} #{get_date_for_event(datetime)}).join \" on \"\n end",
"title": ""
}
] | [
{
"docid": "dd1c6e447d36c3ac4406b4c08e07ff68",
"score": "0.78801537",
"text": "def format_datetime(t)\n format DFORMAT, t.day, t.mon, t.year, t.hour, t.min, t.sec, t.zone\n end",
"title": ""
},
{
"docid": "211f3c42729fc94b111b1b94030ba31c",
"score": "0.77592814",
"text": "def... |
04954b9977d023750f93e61b1663dcb3 | Methods to create virtual attributes | [
{
"docid": "2a1ea4e2b3d2acf194138bae94f168d1",
"score": "0.0",
"text": "def year\n\t\treturn ssu.psu.strat.domain.year\n\tend",
"title": ""
}
] | [
{
"docid": "7a53241e5abb38a98a4dceb1dd071f2c",
"score": "0.72873425",
"text": "def attribute_factory; end",
"title": ""
},
{
"docid": "7a53241e5abb38a98a4dceb1dd071f2c",
"score": "0.72873425",
"text": "def attribute_factory; end",
"title": ""
},
{
"docid": "7a53241e5abb38... |
69e253015124b559091d8e53e162f5fe | int = '' string.each_char.with_index do |char, idx| int += string[char] end return int end puts dynamic_duos('bootcamp') | [
{
"docid": "d72ad2dfabc4ed24230a4eb6d9bfc881",
"score": "0.0",
"text": "def clever_char(string)\n string_hash = Hash.new(0)\n arr = []\n\n string.each_char do |char|\n string_hash[char] += 1\n end\n\n string_hash.each do |key, val|\n if val > 2\n arr << key\n ... | [
{
"docid": "58370eabddf271f39586574d5b76206b",
"score": "0.68755656",
"text": "def atoi(word)\n results = []\n word.chars.each do |char|\n letter = change_letter(char)\n results << letter\n end\n results.each do |integer|\n print integer\n end\n puts \"\"\nend",
"title": ""
},
{
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "7c2c633c372e6458fc32e03c04ee9c1b",
"score": "0.0",
"text": "def quote_params\n params.permit(:author, :content)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "42002bc27007a54b1101e97b6316c940",
"score": "0.0",
"text": "def update!(**args)\n @basic_config = args[:basic_config] if args.key?(:basic_config)\n end",
"title": ""
}
] | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update... |
4e8ef01638acf556318233c0d98e97d1 | layout 'new_application' GET /text_messages GET /text_messages.xml | [
{
"docid": "2594ef53e6733a65ba7d71696cddc3f5",
"score": "0.57048726",
"text": "def index\n @text_messages = @profile.text_messages.paginate(:all, :page => params[:page], :order => 'created_at desc', :per_page => 15)\n\n respond_to do |format|\n format.mobile\n format.html # index.html.er... | [
{
"docid": "9979bce9ec56f83bc182e7973cda2fbf",
"score": "0.6435254",
"text": "def app_layout\n layout_content = read_view :layouts => :application \n [:alert, :notice].each{|name| insert_flash_displayer name, layout_content}\n end",
"title": ""
},
{
"docid": "d6343a... |
82d3219cfd7a90c85b4cf976b7ffae1c | MatchDatapost_match mtch.post_match => str Returns the portion of the original string after the current match. Equivalent to the special variable +$'+. m = /(.)(.)(\d+)(\d)/.match("THX1138: The Movie") m.post_match => ": The Movie" | [
{
"docid": "6fb72f5ac44285955e540fa9d3558568",
"score": "0.5330213",
"text": "def post_match\n end",
"title": ""
}
] | [
{
"docid": "3fe9bf3b8fe8fb2cd38240d4c9e7b113",
"score": "0.5864506",
"text": "def post_match\n m = @match\n m.post_match if (not m.equal?(nil))\n end",
"title": ""
},
{
"docid": "14f6cf2fa94f8b3e6d4844f607dc12a0",
"score": "0.58269566",
"text": "def post_match() end",
"tit... |
d5ed6835e4e2a7b5853d9337689729b3 | Be carefull this could have later unpredictable consequences on stdin | [
{
"docid": "2131953f4e800fb81eea8b74a3124134",
"score": "0.0",
"text": "def select_choice\n # @process.write(' ')\n @process.write(\"\\r\")\n # @process.write(\"\\r\\n\")\n end",
"title": ""
}
] | [
{
"docid": "5115de2c9a054fbbe7bbe32d26c97abc",
"score": "0.76414406",
"text": "def stdin; end",
"title": ""
},
{
"docid": "77f92dd856abaf33005f4788620be909",
"score": "0.7409804",
"text": "def get_input; $stdin.gets.strip; end",
"title": ""
},
{
"docid": "c8499d5f529fc2... |
907104c10a6554e45447ff12eb0a7751 | Shifts start_at of relevant lesson plan items and resets the bonus_end_at and end_at of the same items. The amount shifted is based the learning rate precomputed. The expected precomputed_data is the default data from precompute_data. | [
{
"docid": "ca748c39ac4de9f4904fc75c60584915",
"score": "0.5910957",
"text": "def execute(course_user, precomputed_data, items_to_shift = nil) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength\n return if precomputed_data[:learning_rate_ema].nil?\n\n @course_tz = course_user.course.time_zone... | [
{
"docid": "e6758d3216c516fbca7215254e8fd1b0",
"score": "0.6042611",
"text": "def execute(course_user, precomputed_data, items_to_shift = nil) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength\n return if precomputed_data[:learning_rate_ema].nil?\n\n @course_tz = course_user.course.time_zone... |
0391b5b1feda37967bc4d336c029ab29 | Initializes a new hook Takes a hash of parameters | [
{
"docid": "16d470d2be5c11e502635b3c3d86155c",
"score": "0.0",
"text": "def initialize(options)\n @name = options[:name]\n @type = options[:type]\n @commands = options[:commands]\n end",
"title": ""
}
] | [
{
"docid": "433f67080373238853b82190661a3758",
"score": "0.7760486",
"text": "def initialize(hook)\n @hook = hook\n end",
"title": ""
},
{
"docid": "030c05e72ab2f684ae007b54ff11f037",
"score": "0.73405486",
"text": "def initialize(id, hook, &block)\n unless HOOKS.i... |
bdf5be0a6745cae23944c5a3e9649ffc | Quick and dirty postgres configuration that avoids having to download a chef installer when we bring a box up. | [
{
"docid": "31d36449941b61a26cb1bcef7e141a74",
"score": "0.7511752",
"text": "def configure_postgres\n<<BASH\necho \"deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main\" > /etc/apt/sources.list.d/pgdg.list\nwget --quiet https://www.postgresql.org/media/keys/ACCC4CF8.asc\napt-key add ACCC4CF8.... | [
{
"docid": "776822bbd57f410a9dcb55451d41bd8a",
"score": "0.8009029",
"text": "def pg_configure\n files = %w[ pg_hba.conf pg_ident.conf postgresql.conf ]\n files += %w[ environment pg_ctl.conf ] if distro.is_a?( Debian )\n files = files.map { |f| File.join( 'postgresql', f ) }\n rpu... |
87343fa1fb12a1f902409fdaffdc51d7 | Public: sends REPLACE query data Array of Hashes Returns nothing | [
{
"docid": "1816531bafa69a9f33feb5601828ccfa",
"score": "0.67192996",
"text": "def replace(data)\n query_data = Array.wrap(data)\n\n query_keys = query_data.first.keys\n\n raise ArgumentError.new('invalid schema of data') unless query_data.all? { |item| item.keys == query_keys... | [
{
"docid": "5ab2fee0d320d7c3293ec70199753548",
"score": "0.6777972",
"text": "def replace(data)\n if !data.respond_to?(:each_pair) && data.respond_to?(:each)\n data = array_to_hash data\n end\n\n data = normalize_types data\n transaction { |db| db.replace data }\n end",
"title": ""... |
1d9cc5f97ec4b67cc7a5a9bf42a382eb | if it doesn't the core app tests will break. Not strictly necessary but we'll enforce it with this test for now. | [
{
"docid": "2e7ad4757e589b2343d56c51d8b79b93",
"score": "0.0",
"text": "def test_trace_entry_returns_segment\n segment = @builder.trace_entry(Time.now)\n assert segment, \"Segment should not be nil\"\n assert segment.is_a?(NewRelic::TransactionSample::Segment), \"Segment should not be a #{segme... | [
{
"docid": "68572aaec5761c9c840ccd0e851527a1",
"score": "0.6487079",
"text": "def fail_install_on_purpose_in_test!\n return unless ENV[\"_TEST_APPSIGNAL_EXTENSION_FAILURE\"]\n\n raise \"AppSignal internal test failure\"\nend",
"title": ""
},
{
"docid": "8060e529546dc92549d52056b20ca895",
... |
702b22d85bc5154f1d5d54d4101b1ffc | check if a mailbox is defined | [
{
"docid": "eafee5c3dfa48f0939871ddffdfd532a",
"score": "0.75779146",
"text": "def has_mailbox?(name)\n @mailboxes.each do |mailbox|\n return true if mailbox[:name] == name\n end\n false\n end",
"title": ""
}
] | [
{
"docid": "93b61f0695a227519372a592c383b6a2",
"score": "0.72963446",
"text": "def mailbox_exists?(username)\n mailbox = ::Postfix::Mailbox.find_by_username(username)\n !mailbox.nil?\n end",
"title": ""
},
{
"docid": "4476412616b2b0e34caeac15da4b2e0c",
"score": "0.67231363",... |
57afec0e3b6f1a6da04e7ff08085a7db | (Re)build the list of tokens. Every token is: `[value, token_name]`. | [
{
"docid": "221f2c44d953cee0ec1fd7374279a0eb",
"score": "0.7248263",
"text": "def build_tokens\n @tokens = []\n @tokens += find_tokens until @base.eos?\n @tokens << [false, false] # Last token, meaning EOS.\n debug(\"Built tokens: `#{@tokens}`.\")\n end",
"title": ""
}
] | [
{
"docid": "e9b1ee32b1f30fda9835732452a3eaf1",
"score": "0.7216856",
"text": "def build_tokens\n @tokens = []\n @tokens += find_tokens until @base.eos?\n @tokens << [false, false] # Last token, meaning EOS.\n debug(\"Built tokens: `#{@tokens}`.\")\n end",
"title": ""
},
{
"doci... |
f46a942b7051c6bba38500aab60057dc | GET /tipo_gastos GET /tipo_gastos.xml | [
{
"docid": "f511340b5b890b491b435bdafd33712e",
"score": "0.71418834",
"text": "def index\n @tipo_gastos = TipoGasto.find_by_user(current_user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipo_gastos }\n end\n end",
"title": ""
}
] | [
{
"docid": "6a11aafdbffd746b122842ea2f2f187b",
"score": "0.7166492",
"text": "def show\n @tipo_gasto = TipoGasto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_gasto }\n end\n end",
"title": ""
},
{
"docid":... |
7b253c1b08d4925da425cc376e40f41e | DELETE /sorties/1 DELETE /sorties/1.xml | [
{
"docid": "6fd9e36ebb5ba854f51cd20ba64a8c6e",
"score": "0.689622",
"text": "def destroy\n @sortie = Sortie.find(params[:id])\n @sortie.destroy\n\n respond_to do |format|\n format.html { redirect_to(sorties_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "e1d6f603cb5ea1e475ea71422432aeae",
"score": "0.6304476",
"text": "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"title": ""
},
{
"docid": "289e6d2ddb249c0f9a74a908fcfb562e",
"score": "0.62053144",
"text": "def delete_all(xpa... |
67c8fffe4b9be2e0ddd622c036cdb7e8 | ////////////////////////////////////////////////////////////////////////// Public Methods ////////////////////////////////////////////////////////////////////////// Update text : text to display | [
{
"docid": "b19a90c7d9cf00f472410397f60df1b2",
"score": "0.70705307",
"text": "def window_update(text)\n if text != nil\n @cTitle.text = text\n end\n refresh()\n end",
"title": ""
}
] | [
{
"docid": "a269fa5c1d00d7522ffa1c1113a852d3",
"score": "0.79894453",
"text": "def update_text( hash )\r\n call_function( 'UI.update_text', hash )\r\n end",
"title": ""
},
{
"docid": "3ed91fcf6855c76340564f8c5ba469f7",
"score": "0.7709797",
"text": "def update(text)\n ... |
1d05716a4fe62865115801521dc91809 | Read an unsigned 40bit (5byte) bigendian integer. | [
{
"docid": "39c1ccaac607e63fe3079f95cd89f457",
"score": "0.8589217",
"text": "def read_uint40_be\n a, b = reader.read(5).unpack(\"NC\")\n (a << 8) + b\n end",
"title": ""
}
] | [
{
"docid": "a46908da7d0e1078fcc147d984db516e",
"score": "0.83431613",
"text": "def read_uint40\n a, b = reader.read(5).unpack(\"CV\")\n a + (b << 8)\n end",
"title": ""
},
{
"docid": "b7fc94218bba2f6e164a0882e15f7efa",
"score": "0.7077652",
"text": "def readU32; io.read(... |
a183d95e8b0fb328d70be0760c3acfe8 | Draws an enemy's droppable items. | [
{
"docid": "90bc0403e09aac24258e86815e1a51a2",
"score": "0.7422689",
"text": "def draw_drops(cols = 1, w = 1)\n x = (max_width * w - text_size('Drops').width) / 2\n draw_text_ex(x, @draw_y * line_height, '\\c[16]Drops')\n @draw_y += 1\n if @enemy.enemy.bestiary_show?(:dro)\n cwid = max_... | [
{
"docid": "a595b73e1046767d3e933c14943e464c",
"score": "0.6894311",
"text": "def draw_drops_content\n y = draw_drops\n draw_steals(y)\n if enemy.robbery_amount > 0\n draw_steal_gold(contents_height - line_height)\n end\n end",
"title": ""
},
{
"docid": "4089d367b2d49305fa2... |
a2c7cee8673e68caebc56d1b2bbd4ec4 | POST /agendas POST /agendas.json | [
{
"docid": "e3b9e798f3004c601860cd4187e98524",
"score": "0.54283655",
"text": "def create\n cliente = Cliente.find(params[:cliente_id])\n\n @agenda = cliente.agendas.create(agenda_params)\n\n if @agenda.save\n redirect_to([@agenda.cliente, @agenda], notice: 'Agenda criada com sucesso!'... | [
{
"docid": "835f4ce5ef65c4521ea1ee729d435b2e",
"score": "0.73868746",
"text": "def create\n @agendas = Agendas.new(agendas_params)\n\n respond_to do |format|\n if @agendas.save\n format.html { redirect_to @agendas, notice: 'Agendas was successfully created.' }\n format.json { re... |
80fb20a85eae12615f83c98fae815262 | seq = "AAATTTCCCGGG" intr = ["TTT", "CG"] puts remove_introns(seq, intr) | [
{
"docid": "ead308f3652e9c284785fa12aca176a4",
"score": "0.0",
"text": "def translate(dna_seq)\n protein_seq = []\n codons_aa_hash = YAML::load_file \"codons_aa.txt\" # {codon: [aa, aa_name]}\n codons_array = get_codons(dna_seq)\n codons_array.each do |codon|\n aa = codons_aa_hash[codon][0]\n ... | [
{
"docid": "d04c6d64ee93615e92afa8e0472905d2",
"score": "0.801756",
"text": "def eliminate_introns(dna_seq, introns)\r\n template = dna_seq\r\n introns.each do |intron|\r\n template = template.split(intron)\r\n template = template.join(\"\")\r\n end\r\n return template\r\nend",... |
57e3d9440f394ff01316abbfd872383f | GET /business_accounts GET /business_accounts.json | [
{
"docid": "5311a092f822b2b9ad739b99aff498eb",
"score": "0.6235261",
"text": "def index\n redirect_to(new_business_account_path)\n end",
"title": ""
}
] | [
{
"docid": "3d3ff04ef8494c8c36fbe48c94bdaeb2",
"score": "0.78092295",
"text": "def accounts\n get(ROBINHOOD_ACCOUNTS_ROUTE, return_as_json: true)\n end",
"title": ""
},
{
"docid": "d23c6e99f4ce125da99456952480f1f5",
"score": "0.7248118",
"text": "def show\n @business_account =... |
ff752d31dfaa9a1c1f189a93ddc1c73c | got an error, couldn't figure out why | [
{
"docid": "fdbf140da652c7a82368a2a227082cf0",
"score": "0.0",
"text": "def generate_fallback; end",
"title": ""
}
] | [
{
"docid": "6d967e0574a93ad1a7a438ecf62b646c",
"score": "0.65564007",
"text": "def ex; end",
"title": ""
},
{
"docid": "6d967e0574a93ad1a7a438ecf62b646c",
"score": "0.65564007",
"text": "def ex; end",
"title": ""
},
{
"docid": "49560b3ade41bfbe4a3b9d6b401dd517",
"scor... |
a301dac7b098dd0f2b59f92767707353 | pair of days representing the best day to buy and the best day to sell. Days start at 0. > stock_picker([17,3,6,9,15,8,6,1,10]) => [1,4] for a profit of $15 $3 == $12 time complexity = O(n^2) | [
{
"docid": "0608bab41ea1ed31d79f2e651f51ec9e",
"score": "0.81328046",
"text": "def stockPicker(prices)\n pair = [0,0]\n profit = 0\n prices.each_with_index do |buy, i|\n # Find highest sell day\n sell = prices[i..-1].max\n if profit < (sell-buy)\n pair[0] = i... | [
{
"docid": "851e54655efb6ea01016c70e7a6b9f71",
"score": "0.86570835",
"text": "def stock_picker(prices) \n min_price = Float::INFINITY\n day_min_cost = 0\n max_price = -Float::INFINITY\n profit = -Float::INFINITY\n best_days = []\n\n prices.each_with_index do |price, day|\n if p... |
e15c7223556756965a228df5838d7773 | Advances expires_at by 12 hours past active_as_of if people are chatting about this tag. No effect if expires_at 12+ hours away Returns expires_at | [
{
"docid": "013b0e0391c1be64ac8ccc4ecf3a018b",
"score": "0.74734986",
"text": "def update_expires_at\n if messages.count(\"DISTINCT user_id\") >= 5\n self.expires_at = [active_as_of + 12.hours, expires_at].max\n end\n self.expires_at\n end",
"title": ""
}
] | [
{
"docid": "62af90c80a3360007cd059b1e4607ea2",
"score": "0.6956955",
"text": "def update_activity_time\n session[:expires_at] = 5.minutes.from_now\n end",
"title": ""
},
{
"docid": "5ac420ee3dd6b5559382d7c956e4c83a",
"score": "0.69374925",
"text": "def expires_at; end",
"titl... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "4352633c081e7739ff0af3c14755ef0c",
"score": "0.0",
"text": "def personality_analyze_params\n params.require(:personality_analyze).permit(:user_id, :user_data)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
ce86eed889efd605f9f1d3ee4a5d480c | GET /items/1 GET /items/1.json | [
{
"docid": "4898e228668a06d40c31662e142d6bfb",
"score": "0.696822",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json\n end\n end",
"title": ""
}
] | [
{
"docid": "54748291efc0ecbbc050090a2600e1b8",
"score": "0.77359843",
"text": "def show\n @items = Item.find(params[:id])\n render json: @items\n end",
"title": ""
},
{
"docid": "196801831a75757e64bd58ddbfa8c969",
"score": "0.75480026",
"text": "def get_item( item )\n @se... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "2704fd0e60bface68d2ba0032d903bbf",
"score": "0.0",
"text": "def set_block\n @block = Block.find(params[:id])\n @inf = @block.inform_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... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "c1d63afd393608b269cd55b6da03721f",
"score": "0.0",
"text": "def village_activity_params\n params.require(:village_activity).permit(:name, :village_id, :activity_id, :user_id, :start_date, :end_date)\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... |
2ba7b02e80404eee9684c43a42270331 | GET /festivals/new GET /festivals/new.json | [
{
"docid": "ee91b67bf134c1f6467cb3b9489e6469",
"score": "0.71514684",
"text": "def new\n @festival = Festival.new\n \n fy = @festival.festival_years.build\n e = fy.events.build\n a = e.build_address\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json {... | [
{
"docid": "d57acb28c34185f6be6fa6ec1b0d12e4",
"score": "0.7258916",
"text": "def new\n @fortune = Fortune.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fortune }\n end\n end",
"title": ""
},
{
"docid": "5750318842114331ea3d5298... |
a43fdb98599bb115f0954731b05c3f23 | GET /jewelry_items/1 GET /jewelry_items/1.json | [
{
"docid": "505fb1fe63dd4247e1e60e3ba8d5bf72",
"score": "0.75117403",
"text": "def show\n @jewelry_item = JewelryItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jewelry_item }\n end\n end",
"title": ""
}
] | [
{
"docid": "e1c27975201b6ad07dae3ee5ade61c14",
"score": "0.76917374",
"text": "def index\n @jewelry_items = JewelryItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jewelry_items }\n end\n end",
"title": ""
},
{
"docid": "416... |
d190728ed43feeb8fd8c5aef209daa94 | The alias tag name. Required for the forms | [
{
"docid": "d4157512887b402be5ce2ac49e40b6b5",
"score": "0.8351319",
"text": "def alias_tag\n self.alias_id && self.alias ? self.alias.name : \"\"\n end",
"title": ""
}
] | [
{
"docid": "7ee12659c42a254c5e132947e9d6308f",
"score": "0.73815423",
"text": "def alias_name; end",
"title": ""
},
{
"docid": "7ee12659c42a254c5e132947e9d6308f",
"score": "0.73815423",
"text": "def alias_name; end",
"title": ""
},
{
"docid": "fa4fe177932376929121201cff57... |
e2eed95268b9516a11ad37549769b660 | Insert a new node before a target node | [
{
"docid": "eea9df1094647a452430124e9c858738",
"score": "0.0",
"text": "def insert(node, at_node)\n node.prev = at_node.prev\n node.next = at_node\n at_node.prev.next = node\n at_node.prev = node\n\n if at_node == @head\n @tail = node\n end\n end",
"title": ""
}
] | [
{
"docid": "b5395523cb98a00d85a4bf8f32da5d78",
"score": "0.81117904",
"text": "def insert_before(reference_node, inserted_node)\n end",
"title": ""
},
{
"docid": "2506856796a232ad5aaaa8036c95bfef",
"score": "0.800097",
"text": "def insert_before(new_node)\n # Interface me... |
f5aa2fb9eaadd88307844419a4d69f8b | [Classroom] [Assignment] relevant abilities | [
{
"docid": "53bcfc3fac339cec36a286e7f6dbf90f",
"score": "0.6842967",
"text": "def assignment_abilities\n # Can manage assignment if user is the owner or collaborator\n can :manage, Coursewareable::Assignment do |assignment|\n assignment.classroom.collaborators.include?(@user) or\n ... | [
{
"docid": "291cd3363ab38483d5086af07d886ed3",
"score": "0.6652818",
"text": "def restrictions\n classroom_and_grade_restrictions + schoolwide_restrictions\n end",
"title": ""
},
{
"docid": "68a1c78e70f6432f4f3ec151b1cc9bfd",
"score": "0.6629422",
"text": "def abilities\n @a... |
15f81de788faf006f2fa466b7df7d932 | Get an authentication key for the user based on a nonce from the server. | [
{
"docid": "5bb337950f03ae383a73f132892cb00a",
"score": "0.7583343",
"text": "def auth_key(nonce)\n Digest::MD5.hexdigest(\"#{nonce}#{name}#{hashed_password}\")\n end",
"title": ""
}
] | [
{
"docid": "1df4f4cf4d62300c70d8a1fea20503d6",
"score": "0.624454",
"text": "def get_user_key()\n uri = build_uri('storage/crypto/keys')\n ret = @tools.process_get_request(uri, @user_obj.encrypted_login, @user_pwd).body\n ret_hash = JSON.parse(ret)\n payload = JSON.parse(ret_hash['payload'])... |
decbe17d35235e75ca497c5e8e0c56e3 | Transactions are not yet supported by Mongo, so this method simply yields to the given block. | [
{
"docid": "a940b73021b400dbd39dcdf0ce38eec3",
"score": "0.7036084",
"text": "def transaction(start_db_transaction=true)\n yield\n end",
"title": ""
}
] | [
{
"docid": "b4660ee164b5db9d7f39e6f38fa48e1b",
"score": "0.80865544",
"text": "def transaction(&block)\n yield\n end",
"title": ""
},
{
"docid": "b4660ee164b5db9d7f39e6f38fa48e1b",
"score": "0.80865544",
"text": "def transaction(&block)\n yield\n end",
"title": ""... |
7bd040e54a7d5f01e0303efeb193d509 | news loop TODO: by current date? | [
{
"docid": "5c4d2855cad9dcf8eb920d36d67f9ac2",
"score": "0.6001279",
"text": "def check_news()\n #TODO is this stupid? Globals?\n newslist = $newslist\n time_left = $time_left\n readchoice = \"None\"\n while readchoice.downcase != \"exit\"\n puts(\"ID Headline\\n\")\n for... | [
{
"docid": "09937fb8739a1d4fd32d024b84aa202d",
"score": "0.7509429",
"text": "def display_news\n system(\"clear\")\n puts \"\\n Daily Prophet News\"\n\n news= News.items\n\n puts \"\\n\"\n \n news.each.with_index(1) do |news_item, index|\n puts \"#{index}. #{news_item.title} - #{n... |
73b81a88e4217f7faf7209d132c9ce2f | GET /mfarmakos/1 GET /mfarmakos/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "ad4b1818bdb1f0c649afcebea630516e",
"score": "0.70073545",
"text": "def index\n @mfarmakos = Mfarmako.all.find_each\n end",
"title": ""
},
{
"docid": "251689c639f4c96b81408b4613162118",
"score": "0.6706497",
"text": "def index\n @murais = Mural.all\n\n respond_to... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "b464b1978cc50f8693fd60c7dc14f9dc",
"score": "0.0",
"text": "def set_inquiry\n @inquiry = Inquiry.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;... |
98fb384db8642f1d97e4e19936a35be2 | GET /scheduals/1 GET /scheduals/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "da608a4efecce30df61ca9c81e22c20d",
"score": "0.7115364",
"text": "def set_schedual\n @schedual = Schedual.find(params[:id])\n end",
"title": ""
},
{
"docid": "38caf39ec3f50136a067091a07b7bcb8",
"score": "0.68026954",
"text": "def create\n @schedual = Schedual.n... |
1acf6f9467e5a232acccae9e929c8e47 | Get importable wild VMs in the host | [
{
"docid": "bf4d36fe1b073d2617f77c6eb643164e",
"score": "0.0",
"text": "def importable_wilds\n wilds.select {|w| Hash === w && w['IMPORT_TEMPLATE'] }\n end",
"title": ""
}
] | [
{
"docid": "a7fb6caf1e149064bee793de06758966",
"score": "0.64768785",
"text": "def find_available_hosts(folder, datastore)\n hosts = find_compute_resources(folder)\n hosts.select! { |host| host.datastore.include?(datastore) }\n hosts\nend",
"title": ""
},
{
"docid": "b1bd70ff64333ef99332a... |
e49a4f773d942df91c0d78ad372f7fc9 | Internal: Step of serving Clients when they are being served by teller. Returns nothing. | [
{
"docid": "89bd702c34520b330c7dba2a450c4e63",
"score": "0.5188944",
"text": "def perform_tasks_asked_by_clients\n clients_being_served.each { |client| client.serving_duration += 1 }\n end",
"title": ""
}
] | [
{
"docid": "da3cc119aaf2332fe07a31a379a5feaa",
"score": "0.70334727",
"text": "def serve_clients\n clients_arrive\n say_hello_to_clients\n perform_tasks_asked_by_clients\n while_other_clients_wait_in_line\n say_goodbye_to_clients\n end",
"title": ""
},
{
"docid": "054c0722024... |
a52609053a383c501806b914edbea93e | GET /event_pictures/1 GET /event_pictures/1.json | [
{
"docid": "fba7d3b79ba6d9e46eaa83cc3ea0eeab",
"score": "0.7481789",
"text": "def show\n @event_picture = EventPicture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_picture }\n end\n end",
"title": ""
}
] | [
{
"docid": "0fd60292bcef0c55100a576899fa6195",
"score": "0.72276735",
"text": "def index\n @events_pictures = EventsPicture.all\n end",
"title": ""
},
{
"docid": "ab1a1f72c94f6be196b8328d0575843d",
"score": "0.69463396",
"text": "def index\n if params[:type].present?\n @p... |
1887cacf20fb3cf73e477d0d35f621c8 | Search groups using the q64 value returned from a previous search | [
{
"docid": "a50d0dd533348a67487938dbc720fb6e",
"score": "0.5714678",
"text": "def get_groups_search(q64, opts = {})\n data, _status_code, _headers = get_groups_search_with_http_info(q64, opts)\n return data\n end",
"title": ""
}
] | [
{
"docid": "7095f9d77b4655d00d465aefef243db6",
"score": "0.6764696",
"text": "def search_groups(group)\n\t\tif (@GAFYD)\n\t\t\tpage = @scraper.get(@@GAFYD_BASE + @GAFYD_DOMAIN)\n\t\telse\n\t\t\tpage = @scraper.get(@@BASE)\n\t\tend\n\t\t\n\t\tform = page.form('gs2')\n\t\tform.q = group\n\t\tpage = @scrap... |
3cb7902c6f7be7d71ae4fe56a612f00a | === Abstract Adapter (Misc Support) =========================== | [
{
"docid": "cd140fa391c9aa2c73ffea0fe646ff90",
"score": "0.0",
"text": "def tables_with_referential_integrity\n schemas_and_tables = select_rows <<~SQL.squish\n SELECT DISTINCT s.name, o.name\n FROM sys.foreign_keys i\n INNER JOIN sys.objects o ON i.parent_object_id = o... | [
{
"docid": "58ec4c21e4b57a09fee1072af94b8985",
"score": "0.78242725",
"text": "def adapter\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "fb26c7ad205460690e5f3d91431625ca",
"score": "0.7620861",
"text": "def adapter; end",
"title": ""
},
{
... |
e3550e0ee1b4b9af83d8edc4ee86a7d9 | Collapses a foreign key | [
{
"docid": "1f4f8894328bccee431177986dd68142",
"score": "0.7358348",
"text": "def collapse_foreign_key(fkey)\n with_collapse_helper(fkey.relation_variable){|h| h.foreign_key(fkey)}\n end",
"title": ""
}
] | [
{
"docid": "93fa870a7e411460ed7a6cb17230ad49",
"score": "0.6503806",
"text": "def foreign_key; end",
"title": ""
},
{
"docid": "93fa870a7e411460ed7a6cb17230ad49",
"score": "0.6503806",
"text": "def foreign_key; end",
"title": ""
},
{
"docid": "21e68cfdaca3b9d1d56b13cb8332... |
4889b45561508f3762a3b07c9577f653 | GET /stores GET /stores.json | [
{
"docid": "6d67bb2bbbb8db9cf388a69a73892e41",
"score": "0.0",
"text": "def index\n if params[:search]\n @stores = Store.search_result(params[:search])\n elsif params[:tag]\n @stores = Store.tagged_with(params[:tag]) \n else \n @stores = Store.all.order(:region_id)\n end ... | [
{
"docid": "ab8b36e0e8eedd1067d8b58772370d6f",
"score": "0.7952376",
"text": "def index\n @stores = Store.all\n\n render json: @stores\n end",
"title": ""
},
{
"docid": "047a4fbfcf6c64f36278f678e6513b85",
"score": "0.7877035",
"text": "def index\n @stores = Store.all\n j... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "13ea0605985168f512f2dbb0f5173a98",
"score": "0.0",
"text": "def update!(**args)\n @base_column = args[:base_column] if args.key?(:base_column)\n @column_id = args[:column_id] if args.key?(:column_id)\n @column_json_schema = args[:column_json_schema] if args.key?(:c... | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update... |
082c6a61f1293c5cd434d831f1320e0d | Check if our person has met other person before | [
{
"docid": "c56ef7fef593d001d13afde043b6675f",
"score": "0.7304826",
"text": "def have_met?(other_person)\n\t\treturn @knows.include? other_person\n\tend",
"title": ""
}
] | [
{
"docid": "a61ee7417811ff635d44a531229e0736",
"score": "0.64923626",
"text": "def meet(other_person)\n\t\tif have_met? other_person\n\t\t\tputs \"They already know each other!\"\n\t\tend\n\n\t\t@knows << other_person\n\n\t\tother_person.knows << self\n\tend",
"title": ""
},
{
"docid": "42b6... |
649dd214333f033b516a2255f459985d | PATCH/PUT /products/1 PATCH/PUT /products/1.json | [
{
"docid": "2d59e4f3e806ee895d596415db51c75c",
"score": "0.6544882",
"text": "def update\n\t\trespond_to do |format|\n\t\t\tif @product.update(product_params)\n\t\t\t\tformat.html { redirect_to client_products_path(client_id: @product.client.id), notice: 'Product was successfully updated.' }\n\t\t\t\tfo... | [
{
"docid": "306087ac201b8c728342c4a66d77b684",
"score": "0.7247898",
"text": "def update\n uri = \"#{API_BASE_URL}/products/#{params[:id]}\"\n payload = params.to_json\n rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n begin\n rest_resource.put payload , :content_type... |
bc318296a19e5e25c6b1d8651db0702d | If no aquery parameters are present, returns a URL corresponding to the app server. If 'app_host' is specified, then the URL points to the app_host server. Example: | [
{
"docid": "6a94b4a133da81692612a0044c93eb81",
"score": "0.6242662",
"text": "def launch_url(app_name)\n if params[\"app_host\"]\n \"https://#{params['app_host']}/canvas/embedded/#{app_name}\"\n else\n url_for(only_path: false, action: 'embedded', url: app_name)\n end\n end",
"ti... | [
{
"docid": "f39e6aa0eae0f9c078b8c08243d9fc24",
"score": "0.68114865",
"text": "def app_host\r\n @app_host\r\n end",
"title": ""
},
{
"docid": "8d93d911e20c516cc522afb801e54304",
"score": "0.6754353",
"text": "def application_url\n tenant = use_shared_configservers ? @ten... |
8521b9d61e9ad871b905200e6c2d6d9e | update each timers counts, call any blocks that are over their interval | [
{
"docid": "41d49db88cc6a5729db7d2bf79b227f4",
"score": "0.6189665",
"text": "def update_timers(time_delta)\n # TODO handle overwriting the same timer name...\n @timers ||= {}\n if @new_timers\n @timers.merge!(@new_timers) \n @new_timers = nil\n end\n @timers.each do |name, time... | [
{
"docid": "a62fefae1de92293f5bf000d7db6fa61",
"score": "0.66245806",
"text": "def update\n @time +=@inc\n yield\n @timers.start\n end",
"title": ""
},
{
"docid": "adfc90eeb48440fef131c86a016e3621",
"score": "0.6590057",
"text": "def update_countdowns\n\t\t\... |
28af245c797c0ce1748419fd625a4e5d | Main Purpose of this method is updating Lease Rent Roll table basing on changes of lease status. | [
{
"docid": "bdea45cf0d701be45b2b3b2e4b1b945a",
"score": "0.6761903",
"text": "def check_status_change\n if self.status_changed?\n if (self.status==\"Vacant\")\n property_lease_suite = self.property_lease_suite\n if property_lease_suite.present? && property_lease_suite.suite_ids?\n ... | [
{
"docid": "eb6a3e53cc4a3b5ae1ade931178ca153",
"score": "0.6694449",
"text": "def update_and_post_ledgers\n update_result = false\n transaction do\n Ledger.delete(ledgers)\n journal_line_items.reload\n\n if old_voucher?\n journal_line_items.each do |line_item|\n rand... |
9807cdb54578f43d17e17d916710d71d | Start, stop or return the status of a WebSphere profile instance | [
{
"docid": "a5ae3e8be6a674724edba6ed0b0edd69",
"score": "0.0",
"text": "def profile(run_action)\n opts = { user: new_resource.owner, group: new_resource.group }\n shell_out!(run_action.flatten.join(' '), opts).stdout.split(\"\\n\")\n end",
"title": ""
}
] | [
{
"docid": "e0a645d096cf193bc9a9e4bba448bc78",
"score": "0.72165704",
"text": "def action_start\n if @current_resource.running\n Chef::Log.debug \"#{new_resource.profile_name} already running\"\n else\n converge_by \"Starting WebSphere profile #{new_resource.profile_name}\" do\n p... |
9d3d392aeee4dcf6a72d3d399a219dfc | Produces the code to create the header line using topend menu for columns and pagination management | [
{
"docid": "515b0caf171821149128cb33a5c879fb",
"score": "0.70580757",
"text": "def header_code\n code = ''\n code << \"'<thead><tr>\"\n if table.selectable?\n code << '<th class=\"list-selector\"><input type=\"checkbox\" data-list-selector=\"all\" /></th>'\n discla... | [
{
"docid": "abc8c14ea66d5b050fbab129801f7136",
"score": "0.6903942",
"text": "def build_pdf_header(pdf)\n pdf.font \"Helvetica\" , :size => 8\n $lcCli = @company.name \n $lcdir1 = @company.address1+@company.address2+@company.city+@company.state\n\n $lcFecha1= Date.today.strftime(\"%d/... |
609991133e381ffaab5b77a8fd158ac0 | Load existing pins to remove it from creating and editing | [
{
"docid": "de98952001f10a31a591fe64a0be25cd",
"score": "0.73133516",
"text": "def load_pins\n objects = Control.all\n pins = [ 4, 5, 6, 12, 13, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 ]\n existing_pins = []\n if objects\n for obj in objects\n exist... | [
{
"docid": "35c310a36a4111b6ee5413d190f536fb",
"score": "0.57398915",
"text": "def unpin\n @pinned = false\n end",
"title": ""
},
{
"docid": "d1fd31679ae4c530051521998f67b660",
"score": "0.5668428",
"text": "def destroy\n @pin.destroy\n end",
"title": ""
},
{
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "3a3be02f62906026efda555290a69033",
"score": "0.0",
"text": "def spell_params\n params.require(:spell).permit(:name, :mana)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
f0c2e12be8f49735044b86119e85ad79 | Get an array of constant names. | [
{
"docid": "35051f8f978655ec4c23e163c138226f",
"score": "0.58458203",
"text": "def get_constants namespace, root\n response = send_get_constants namespace, root\n response['data']\n end",
"title": ""
}
] | [
{
"docid": "2b4ac9d50aa0be1fd16c894f98ce0d0f",
"score": "0.7847186",
"text": "def local_constant_names\n local_constants.map(&:to_s)\n end",
"title": ""
},
{
"docid": "a9c1945f322baa715ec02a662d022503",
"score": "0.777356",
"text": "def constant_names(node)\n node ? constant... |
af34beb0174d6bdd39ad171d14a76d92 | GET /XmlStatusReport.aspx This action returns the current build status for all of the main projects in the system | [
{
"docid": "a3052fe2e7db6551e0d24e7ac70de0df",
"score": "0.6707059",
"text": "def status_report\n @projects = Repository.all.map { |repo|\n Project.where(:repository_id => repo.id, :name => repo.name).first.decorate\n }.compact\n end",
"title": ""
}
] | [
{
"docid": "d4a5734472536fb03e677111cb426b0c",
"score": "0.6819878",
"text": "def index\n @hudson_build_statuses = HudsonBuildStatus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @hudson_build_statuses }\n end\n end",
"title": ""
}... |
5b61a1f51944e5d133b5a12303055bfe | POST /movie_happenings POST /movie_happenings.json | [
{
"docid": "7c2a688f6ee6316cae391d670b0fc566",
"score": "0.67155564",
"text": "def create\n # avoid creating duplicates:\n @movie_happening = MovieHappening.where(:movie_name => params[:movie_happening][:movie_name], \n :venue_name => params[:movie_happening][:venue_name],... | [
{
"docid": "a2f60274b8043abba87e3a5d340827ad",
"score": "0.65230393",
"text": "def show\n @movie_happening = MovieHappening.find(params[:id])\n\n render json: @movie_happening\n end",
"title": ""
},
{
"docid": "93bf4a0946f20a8ea446eaca3b3e7e37",
"score": "0.65175956",
"text": ... |
705f66c6133c51f446126885c7c9d8e7 | If the quality response was lower than 3 then start repetitions for the item from the beginning without changing the EFactor | [
{
"docid": "a00cdc6a4f92a6fb06beacc02595aea1",
"score": "0.0",
"text": "def forgot_card\n { review_date: Date.today + 1, interval: 0, success_reviews: 0 }\n end",
"title": ""
}
] | [
{
"docid": "999126c309458f1abf94c2bbbe64b4e6",
"score": "0.61860675",
"text": "def increase_quality_by1(item)\n item.quality += 1\n end",
"title": ""
},
{
"docid": "a2c13a0debf487cf6331971ca6ccedc9",
"score": "0.58633655",
"text": "def update_e_factor\n ef = @e_factor + (0.1 -... |
69ac94f44ddb107a61fd47492d7f1162 | Creates an iCal for a personal nsf file +db+, between the Time +from+ and +to+ | [
{
"docid": "5df9869f9e2d583e3655d9eb49aa7a6b",
"score": "0.5653385",
"text": "def personal(from=nil, to=nil)\n today = Time.now.midnight\n from ||= today.plus_day(-30)\n to ||= today.plus_day(365)\n \n login\n path = \"#{@db_url}/iNotes/Proxy/?OpenDocument&Form=s_ReadView... | [
{
"docid": "f6516b7d7392d9657d088993d4c6f382",
"score": "0.5657528",
"text": "def make_invoice\n from_s = Readline.readline(\"#{@strmaker.blue('From')} (dd-mm-yyyy) \")\n to_s = Readline.readline(\"#{@strmaker.blue('To')} (dd-mm-yyyy) \")\n\n from_d = DateTime.parse(from_s)\n to_d = Date... |
a230bddb9c3b009b054c21c58426b972 | Returns the SI unit for the same physical quantity which is represented by self, e.g. | [
{
"docid": "fc5f7bbd0c1969bb5efcdc8cb9152177",
"score": "0.77238065",
"text": "def si_unit\n return self if self.dimensions.is_dimensionless?\n @dimensions.si_unit\n end",
"title": ""
}
] | [
{
"docid": "3c59675ea1693aad923de7d71fa3a721",
"score": "0.73203975",
"text": "def si_unit\n return Unit.steridian if describe == 'solid angle'\n return Unit.radian if describe == 'plane angle'\n\n val = si_base_units\n return nil unless val\n return val[0] if val.length == 1... |
64d72d9063217755a27edb96b2aae8ad | deliver(start_address, end_address) This method will take two house numbers and return the amount of money earned on this delivery as a floating point number. It should also update the paperboy's experience! Let's assume that the start_address is always a smaller number than the end_address As a stretch exercise you ca... | [
{
"docid": "c5f135755e9329c267dd3733990a78ee",
"score": "0.84327084",
"text": "def deliver(start_address, end_address)\n total_houses = end_address - start_address\n new_earnings = (total_houses.abs.to_f/4.0)\n return \"$#{new_earnings}\"\n @experience += total_houses.abs\n ... | [
{
"docid": "87cc65a919b9cd979c156c4372e154d6",
"score": "0.87267697",
"text": "def deliver(start_address, end_address)\n houses = (end_address - start_address)\n if houses <= quota\n pay = (0.25 * quota) - 2\n else\n houses > quota\n pay = (0.25 * quota) + ((houses - qu... |
c663efac0160034e091155bd6c9cce1f | Iterates the given block for each RDF quad in the input. This results in flattening each quad into a triple. | [
{
"docid": "f1679a183bf4a55ab9f7aed86d7210af",
"score": "0.7085644",
"text": "def each_triple(&block)\n if block_given?\n each_statement do |statement|\n block.call(*statement.to_triple)\n end\n end\n enum_for(:each_quad)\n end",
"title": ""
}
] | [
{
"docid": "4b985603a7e0cc0e8c3867f508bbde57",
"score": "0.6718299",
"text": "def each_quad(&block)\n if block_given?\n each_statement do |statement|\n block.call(*statement.to_quad)\n end\n end\n enum_for(:each_quad)\n end",
"title": ""
},
{
"docid":... |
50e9fb9e2219fc2d6740dc0aa238703d | Generates target (without compression extension) path from path. | [
{
"docid": "7f15a5f253244603f08318751341ade3",
"score": "0.6717559",
"text": "def target_path\n if self.compressed?\n extension = self.compression[:extension]\n result = self.path[0...-(extension.length + 1)]\n else\n ... | [
{
"docid": "995996d0326e8a67b910be3a795f19b7",
"score": "0.70864505",
"text": "def target_path(path)\n parts = File.basename(path.to_s).split(\".\")\n path = path.to_s\n\n # Always return .html directly as it will cause too much trouble otherwise\n return Pathname.new(path) if parts.... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "4eda8f8c2fae69b308ad2f9fa11385a8",
"score": "0.0",
"text": "def menu_tem_params\n params.require(:menu_tem).permit(:name, :price, :restaurant_id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74964964",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957765",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
6e831e7f15bb2c84e1c186dcada0ca58 | Try to find an existing generic stat. If none exists, create a new one. Return the stat that was found or created | [
{
"docid": "ead59694a95b1166192111ee4bb42767",
"score": "0.72441655",
"text": "def find_or_create_stat(stat_key, stat_value)\r\n # Find or create a stat\r\n stat = Model::Stat.find_by_key(stat_key)\r\n if (stat == nil)\r\n stat = Model::Stat.create(key: stat_key, title: stat_key)\r\n en... | [
{
"docid": "728328b8c1be2c9ca8bccd9563779bba",
"score": "0.61231816",
"text": "def stat\n return @stat unless @stat == :needs_stat\n\n @stat = begin\n File.stat(self[:path])\n rescue Errno::ENOENT => error\n nil\n rescue Errno::EACCES => error\n warning \"Could not stat; permi... |
72cb77918e50127156fd2bcdd0b409fa | when an athlete update is successful | [
{
"docid": "fd6f55e6792708fa0fb4f00c9f4c8d8a",
"score": "0.6219303",
"text": "def stub_athlete_update_success(options = {})\n url = 'https://www.strava.com/api/v3/athlete'\n status = options.fetch(:status, 200)\n response_body = options.fetch(:response_body,\n j... | [
{
"docid": "e031f91be69053c329390ff699f4e469",
"score": "0.73589635",
"text": "def update\n respond_to do |format|\n if @athlete.update(athlete_params)\n format.html { redirect_to @athlete, notice: 'Athlete was successfully updated.' }\n format.json { render :show, status: :ok, loc... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "2f835ca6dc5a05268db57b7491ecbfad",
"score": "0.0",
"text": "def artist_params\n params.require(:artist).permit(:name, :age)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7477736",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.7169702",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist =... |