query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
3b0c1683f9deab7681a2dd0beb5cbdcb | Internal: Indica si el archivo es un pdf Retorna un Boolean. | [
{
"docid": "168ae1ae91d584843cbc0650beea7a96",
"score": "0.81412697",
"text": "def is_pdf?\n self.image_file_name.split('.').last == 'pdf'\n end",
"title": ""
}
] | [
{
"docid": "28e9b72081124f50435b42760d5296f9",
"score": "0.81255955",
"text": "def pdf_ver_ok?(file)\n reader = PDF::Reader.new(file)\n (reader.page(1).raw_content.lines.count != 1) ? true : false\n end",
"title": ""
},
{
"docid": "7f3851f85005d365f448493c31f0523f",
"score": "0.81... |
6bd89f182f33d7b18133018f6fed3f93 | , :show, :edit ] | [
{
"docid": "dc9bd41c83bc84dc062da56c8326590d",
"score": "0.0",
"text": "def index\n @workplace_associations = []\n @workplace_associations = @workplace.inbound_associations if params[ :kind_of_route ] == :inbound\n end",
"title": ""
}
] | [
{
"docid": "cfcda622f95666515729fabc6cf212f8",
"score": "0.8079784",
"text": "def show\n edit\n end",
"title": ""
},
{
"docid": "cfcda622f95666515729fabc6cf212f8",
"score": "0.8079784",
"text": "def show\n edit\n end",
"title": ""
},
{
"docid": "2bf14303acc13a70bf... |
36c95242857ac68e615b3cd2d35fc1e9 | Upon the purchase of the sixth share, the remaining 4 shares are dumped into the market and the corporation is immediately paid for the 4 shares; kinda like 18Chesapeake | [
{
"docid": "6a93c570e70452f05a79618e171939c9",
"score": "0.7052433",
"text": "def sixth_share_capitalization(corporation)\n funding = 4 * corporation.share_price.price\n @log << \"#{corporation.name}'s remaining shares are transferred \"\\\n \"to the Market and receive... | [
{
"docid": "d24ca746bcd9e29f9feca611087c4513",
"score": "0.68295753",
"text": "def buys_market_share count\n price = context.market_share.calculate_price(count)\n\n Account::TransfersMoney.call(context.src_account, context.dst_account, price)\n Portfolio::AddsMa... |
567ff38b8be2b8137803e8fd8fd63099 | GET /posts or /posts.json | [
{
"docid": "ed89808d0cd08b7db0ba7d92e0f7c972",
"score": "0.0",
"text": "def index\n @posts = Post.all\n end",
"title": ""
}
] | [
{
"docid": "e3c4ae91ea263e2b4ef7b28dc95c8c5c",
"score": "0.6997458",
"text": "def posts(opts)\n response = get(\"posts\", opts)\n response\n end",
"title": ""
},
{
"docid": "915c0178f9e4347098d8a463c2cbe6b0",
"score": "0.6996869",
"text": "def show\n @posts = Po... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "287e02ba964d9302c714bbcbe1ddbf7a",
"score": "0.0",
"text": "def update!(**args)\n @attribute_removed = args[:attribute_removed] if args.key?(:attribute_removed)\n @attribute_set = args[:attribute_set] if args.key?(:attribute_set)\n @label_added = args[:label_added]... | [
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"t... |
cb80bf506ca7fffe7eee0229caa03367 | Generate policy for stack | [
{
"docid": "de1809e96275122ae9090777b27f1237",
"score": "0.68120974",
"text": "def generate_policy\n {}\n end",
"title": ""
}
] | [
{
"docid": "0c79e29ce674e34b7bf93ebffdc64718",
"score": "0.69087857",
"text": "def generate_policy\n statements = []\n compile.resources.keys!.each do |r_name|\n r_object = compile.resources[r_name]\n if(r_object['Policy'])\n r_object['Policy'].keys!.each do |effect|\n st... |
48019f3ca401cd12addb9bb04274dd5c | this is using the new themeable bits for the email templates. themeable templates come into play once you set the publisher, like the first line below. | [
{
"docid": "f9e0d49f98d7fa2f5c5d7373cd221a13",
"score": "0.0",
"text": "def activation_request(consumer)\n publisher consumer.publisher\n I18n.locale = consumer.preferred_locale if consumer.preferred_locale.present?\n # ¡Aviso! Por favor verifíque la dirección de su correo electrónico.\n sub... | [
{
"docid": "a233437c1d27c611f50ef6921b7483bb",
"score": "0.5869498",
"text": "def adhoc_mailing\n setup_adhoc_render_default\n end",
"title": ""
},
{
"docid": "8011b711275d44e262984189313b5161",
"score": "0.58441985",
"text": "def mailto_body_template\n Liquid::Template.pars... |
0f6b0a3f0f4195235a4b52188b4f2567 | GET /reunions/1 GET /reunions/1.json | [
{
"docid": "f6541117c3c65656a5a2e3c6c61741b7",
"score": "0.5556751",
"text": "def show\n reunion= Reunion.find_by_id params[:id]\n if reunion!= nil\n render(json: reunion, status: 200) \n else\n head 404\n end \n end",
"title": ""
}
] | [
{
"docid": "79ffae6e2817113592f32004d2e575b7",
"score": "0.6157748",
"text": "def show\n @reunion = Reunion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reunion }\n end\n end",
"title": ""
},
{
"docid": "ea73234c... |
b034d4fc9720e02e1b2ec5dbdf9ff99e | POST /registration_costs POST /registration_costs.json | [
{
"docid": "f7f1edabe2297a827ab42f3b426cee02",
"score": "0.66172326",
"text": "def create\n @registration_cost = RegistrationCost.new(registration_cost_params)\n creator = CreatesRegistrationCost.new(@registration_cost)\n\n respond_to do |format|\n if creator.perform\n format.html {... | [
{
"docid": "b6d38c45ac03677a16e24949d0ef9a78",
"score": "0.6799362",
"text": "def create\n @registration_cost = RegistrationCost.new(registration_cost_params)\n creator = CreatesRegistrationCost.new(@registration_cost)\n\n if creator.perform\n redirect_to registration_costs_path, notice: '... |
61ddfa3253397c8b2bb8948ae5590fdc | returns the mean average of perdiction error | [
{
"docid": "3a4942cf18098eaf216faa103caa44a2",
"score": "0.72157294",
"text": "def mean \n\t\ttotal = 0\n\t\t@ratings_test.each do |x|\n\t\t\ttotal = total + (x[3].to_f-x[2].to_f).abs\n\t\tend\n\t\ttotal/@ratings_test.length\n\tend",
"title": ""
}
] | [
{
"docid": "a39fff7ffcf86c6c4ee36a320206679f",
"score": "0.8716119",
"text": "def mean\n sum = 0\n pred_error.each{|e| sum += e}\n sum/pred_error.length.to_f\n end",
"title": ""
},
{
"docid": "9bb24950ba6a83460282154ab45c974a",
"score": "0.85944104",
"text": "def mean()\n\t... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "74e33a1d29fba5411279a6674c470a34",
"score": "0.0",
"text": "def set_user_field\n @user_field = UserField.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;... |
53b35ecd7f362596aef090853576d52e | POST /post_comments POST /post_comments.json | [
{
"docid": "f5405f6ecedd4fc382a9911e348fc126",
"score": "0.0",
"text": "def create\n # 写评论\n @post_comment = current_user.post_comments.new(post_comment_params)\n @post_comment.post_id = @post.id\n is_post_comment_saved = @post_comment.save\n # 更新post\n new_weight = @post.weight + 1\n ... | [
{
"docid": "7a5e2ae143eef89070cd377bf64f9190",
"score": "0.7752391",
"text": "def create\n @comment = @post.comments.new(comment_params)\n if @comment.save\n render json: @comment, status: :created\n else\n render json: @comment.errors, status: :unprocessable_entity\n end\n\n end"... |
2a201343889bcd05348797a1b642cbc1 | dank helper function that returns an array of hashes from execute2 output | [
{
"docid": "ff97115ca261212668117fa7fb23a30d",
"score": "0.0",
"text": "def create_query_hash(array)\n names = array.shift\n rval = []\n array.each do |r|\n row = {}\n names.each_with_index { |column, idx| row[column] = r[idx] }\n rval << row\n end\n rval\nend",
"title": ""
}
] | [
{
"docid": "8fbc5a4416e3c4f8791f93ad87ff21b4",
"score": "0.66684866",
"text": "def knife_output_as_array(sub_cmd)\n execute(knife_cmd(sub_cmd)).split(/\\n/).reject(&:empty?)\nend",
"title": ""
},
{
"docid": "c29b6d660cde56c1e20dbc80db7f0b51",
"score": "0.6125343",
"text": "def knife... |
1efce2c897660efee59868fafcf8aac2 | Key where each user has one code associated with his ID | [
{
"docid": "b8bf355e10181446c51340ae6531f1fa",
"score": "0.63775086",
"text": "def person_code_key(person_id)\n \"offers:person:code:#{person_id}\"\n end",
"title": ""
}
] | [
{
"docid": "82680429aaa0a0c1ea744e849d22ffbb",
"score": "0.65617806",
"text": "def code_person_key(code)\n \"offers:code:person:#{code}\"\n end",
"title": ""
},
{
"docid": "b0b4b7df2f9392be907391cb5602acca",
"score": "0.65477085",
"text": "def key\n\t\t\tself.class.key(user)\n\t\... |
640e09f2654ec8e9057d3a805112f6ee | PATCH/PUT /boletos/1 PATCH/PUT /boletos/1.json | [
{
"docid": "44288348799498182703847f46f37848",
"score": "0.6395561",
"text": "def update\n respond_to do |format|\n if @boleto.update(boleto_params)\n format.html { redirect_to @boleto, notice: 'Boleto foi atualizado com sucesso!' }\n format.json { render :show, status: :ok, locati... | [
{
"docid": "99c17fb6fb94298daa06b720e5517db2",
"score": "0.695744",
"text": "def update\n @boleto = Boleto.find(params[:id])\n\n respond_to do |format|\n if @boleto.update_attributes(params[:boleto])\n format.html { redirect_to @boleto, notice: 'Boleto was successfully updated.' }\n ... |
dd87968ddbae6246facd445feeaecb85 | Whether the rest event should fire | [
{
"docid": "9db26c7f7a999a8738a88b9766672689",
"score": "0.59017426",
"text": "def rest?(pointer, data)\n !@rest.nil? && @rest.call(pointer, data)\n end",
"title": ""
}
] | [
{
"docid": "4a05b304e96694a197171ad2cbd74570",
"score": "0.688477",
"text": "def rest?\n false\n end",
"title": ""
},
{
"docid": "40f898c700fb7f8c7d807485b8f89b68",
"score": "0.64836055",
"text": "def rest?\n @duration < 0\n end",
"title": ""
},
{
... |
3875e36259689f542a60c5b88c052ea0 | Takes a screenshot of the current state of the page if the scenario failed. | [
{
"docid": "4b351ecaa7989e07256f50c952c28dc0",
"score": "0.7686384",
"text": "def save_failure_screenshot(scenario)\n name = \"FAILED_#{scenario.name.gsub(' ', '_').gsub(/[^0-9A-Za-z_]/, '')}\"\n save_page_screenshot name\nend",
"title": ""
}
] | [
{
"docid": "435b8ee8dff3a551fc61088f70a06e69",
"score": "0.7892644",
"text": "def take_screenshot_if_failed(scenario)\r\n #if (scenario.failed?)\r\n # scenario_name = scenario.to_sexp[3].gsub(/\\ /, \"_\")\r\n # time = Time.now.strftime(\"%Y-%m-%d-%H%M\")\r\n # screenshot_path = 'c:\\\\scorebig\\... |
caffc9bb34f89548ec0d687979bad75d | Returns an array containing a list of the queries used by the prop. Each query is a string representing the query key. | [
{
"docid": "5b675ae88e58b0539213dc5a406dd575",
"score": "0.7068079",
"text": "def queries\n match = File.read(@mapping.path).match(/@queries: (?<queries>[^\\]]+)/)\n\n if match.blank? then [] else\n match[:queries].gsub(/\\[\\s*/, '').split(/\\n|,/).map do |query|\n query.strip... | [
{
"docid": "d472e17fc98d4bd68e5c229a920d9673",
"score": "0.6742097",
"text": "def query_objects\n queries.values\n end",
"title": ""
},
{
"docid": "0f5b70a89eb0ebd2ad38d69b2ec54b07",
"score": "0.6501963",
"text": "def get_queries\n @queries\n end",
"title": ""
},
{
... |
da858345608ab83662f95b791125f3be | Write a method that will take a string and return an array of vowels used in that string. Example: count_vowels("The quick brown fox") should return ["e","u","i","o","o"] count_vowels("Hello World") should return ["e","o","o"] Check your solution by running the tests: ruby tests/09_vowels_test.rb | [
{
"docid": "afdb01e876a336ed463ddb53cfceb135",
"score": "0.0",
"text": "def vowels(input_string)\r\nresult_array = Array.new\r\ninput_array = input_string.downcase.split('')\r\nresult_array = input_array.keep_if { |v| v =~ /[aeiou]/ } \r\nreturn result_array\r\n#after stash\r\n#result = {}\r\n#vowels_ar... | [
{
"docid": "85d3e342fa048d4cb754196dd137b889",
"score": "0.8366634",
"text": "def count_vowels(string, vowels = ['a','e','i','o','u', 'A', 'E','I','O','U'])\r\n string_array = string.split('')\r\n vowels_in_string = []\r\n for character in string_array\r\n for vowel in vowels\r\n if character... |
c175ca82951a84fb236b9e1423f8a8dc | Returns the right operand | [
{
"docid": "98073cf72fdef24b3b3357e80fccb332",
"score": "0.0",
"text": "def right\n Iterator.coerce(datasets.last, environment)\n end",
"title": ""
}
] | [
{
"docid": "591b311f241ce124acea4dd59a9feefd",
"score": "0.83163995",
"text": "def right\n operands.last\n end",
"title": ""
},
{
"docid": "bf19baa5f6e432ba2693248c32cafab1",
"score": "0.74514025",
"text": "def wrap_right\n wrap_operand(operand.right)\n ... |
df47e8cbcacba0be42bd7cab97921d26 | Print the error message | [
{
"docid": "2e49b5d166baae55647004b100e611e7",
"score": "0.0",
"text": "def ruby_prof_print_exception( exception )#:nodoc:\n error_message = \"AN ERROR HAS OCCURRED WHILE PROFILING:\\n\"\n error_message << \"#{ exception.class }: #{ exception }\\n\" if exception\n error_message << exception.ba... | [
{
"docid": "b27d1eaff9e5778abd7b75b8c8e14e82",
"score": "0.79941136",
"text": "def error\n\tputs \" - Désolé #{@name}, ce n'est pas possible, rejoue ! \"\n\tputs \" \"\n end",
"title": ""
},
{
"docid": "79e8346b712b10ea81f6820c2f7251e3",
"score": "0.78700083",
"text": "def print_e... |
66a7a2fbc8db68d562d64a8a07f5df88 | [Brief] Initializes variables [Receive] Nothing [Return] Nothing | [
{
"docid": "fc3c8f06f035542f748b076228bcd0fa",
"score": "0.0",
"text": "def initialize\n @msg_win = MessageWindow.new\n @opts_win = OptionsWindow.new\n @board_win = BoardWindow.new\n end",
"title": ""
}
] | [
{
"docid": "94d26a3e40b7b72f709c78b48a24102e",
"score": "0.67561233",
"text": "def init()\n\t$numCharges = 0\n\t$numGiftCards = 0\n\t$giftCardAmount = 0\n\t$discountPercentage = 0\n\t$total = 0\n\t$labor = 0\nend",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0... |
e33852befd4418df43f46116e1c4766f | Sends an event up to SQS | [
{
"docid": "949c5e1fc108903fe0d37fc177d26d1a",
"score": "0.71206117",
"text": "def call(event)\n client.send_message(queue_url: queue_url, message_body: event)\n end",
"title": ""
}
] | [
{
"docid": "809fba5f263ef3a5d31ca47f70334e55",
"score": "0.701399",
"text": "def send msg\n verify_config\n\n options = Hash.new\n [:access_key_id, :secret_access_key, :region].each do |arg|\n if @config['sqs'].has_key? arg.to_s\n options[arg] = @config['sqs'][ar... |
be31c210cfadab810f5714a91b7618dd | iterates through an array, performs computations on odd indeces, and returns output | [
{
"docid": "5675a0608cb22d47ce3ed040deebd0cd",
"score": "0.0",
"text": "def double_every_other_digit(card_num)\n card_num.each_with_index do |num,index|\n if index.odd?\n card_num[index] = double_a_digit_string(num)\n card_num[index] = convert_to_single_digit(card_num[index])\n... | [
{
"docid": "cb4287a754e583ffeb46baa01837fd51",
"score": "0.7595044",
"text": "def array_translate(array)\n\n odd = []\n even = [] \n new=\"\"\n\n array.each_with_index do |ele1, idx1|\n if idx1 % 2 == 0 \n odd << ele1\n elsif idx1 % 2 != 0\n even << ele1\n... |
3b1e56dda55c2dab1b35c4648e9b40ab | here's the last resort. take a string and manually, slowly, gently, turn it into some fuckedup thing that we at least know is ascii. the sad reality is that email messages often have the wrong content type, and then we have to do this in order to make them actually displayable. we could improve this with some encoding ... | [
{
"docid": "b84cba8d43e2c827090f41242bbde6e2",
"score": "0.6181006",
"text": "def force_to_ascii s\n out = \"\"\n s.each_byte do |b|\n if (b & 128) != 0\n out << \"\\\\x#{b.to_s 16}\"\n else\n out << b.chr\n end\n end\n #out.force_encoding Encoding::UTF_8 if in_r... | [
{
"docid": "e4cc3dfd0180f642005eca4905ee4f10",
"score": "0.6915543",
"text": "def make_readable(string)\n # See String#encode\n encoding_options = {\n :invalid => :replace, # Replace invalid byte sequences\n :undef => :replace, # Replace anything not def... |
456605ab2ffc8d6460119ab425744ce9 | Returns an inspect string. | [
{
"docid": "42a889101ee632825b8b52178b3ec136",
"score": "0.0",
"text": "def inspect\n \"#<#{self.class}:#{object_id} key=#{key.inspect} default=#{default.inspect} long=#{long.inspect} short=#{short.inspect}>\"\n end",
"title": ""
}
] | [
{
"docid": "41d25ab77066b1e00a8ccabd990b5e80",
"score": "0.74426395",
"text": "def inspect\n redacted_string(:inspect)\n end",
"title": ""
},
{
"docid": "41d25ab77066b1e00a8ccabd990b5e80",
"score": "0.74426395",
"text": "def inspect\n redacted_string(:inspect)\n ... |
4b1e12e33668f3a8e41f614275748106 | PUT /tasks/1 PUT /tasks/1.json | [
{
"docid": "a7e99d9a9880d46e94668fcead46b06a",
"score": "0.0",
"text": "def update\n @project = Project.find(params[:project_id])\n @task = Task.find(params[:id])\n\n if request.format == 'application/json' # handle files upload\n @attach = Attachment.create(:task_id => @task.id, :file => ... | [
{
"docid": "cac9c96d9b119273d80222fef2554029",
"score": "0.761173",
"text": "def update\n @task.update!(task_params)\n json_response(@task)\n end",
"title": ""
},
{
"docid": "099e7266a80d49d1d0e30816e04aff39",
"score": "0.759024",
"text": "def update\n task = Task.find(para... |
74d040b522aca1632ca77e71cd7d1280 | new room type mapping | [
{
"docid": "05f111ce3be1635f85df42d918024856",
"score": "0.0",
"text": "def new\n session[:room_type_channel_mapping_params] = {}\n session[:room_type_channel_mapping_params][:channel_id] = Channel.find(params[:channel_id]).id\n session[:room_type_channel_mapping_params][:room_type_id] = RoomTy... | [
{
"docid": "6eb0ab8a88a1437f6a1e050fc5f29220",
"score": "0.6528339",
"text": "def room_type\n # Can't change, so a permanent cache is ok\n return @room_type if @room_type_retrieved || @room_type\n\n @room_type_retrieved = true\n @room_type ||= creation_info[:type]\n end",
"tit... |
9bce4dd00f88c04887bdc91fe69642c9 | GET /admin/product_site_elements/new GET /admin/product_site_elements/new.xml | [
{
"docid": "829acf7d24aa425ad82285cc28e4d16d",
"score": "0.8069996",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @product_site_element }\n end\n end",
"title": ""
}
] | [
{
"docid": "16aaf058e994c041c3359c98a3dfdd73",
"score": "0.70398456",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @product_software }\n end\n end",
"title": ""
},
{
"docid": "1b297a8a51f362e77988e701e... |
142209a792d424089987bd1ea87b7079 | Deletes all VLAN groups. | [
{
"docid": "a22caad6f4dd06290e24e28d62e96751",
"score": "0.82344645",
"text": "def delete_all_vlan_groups\n super\n end",
"title": ""
}
] | [
{
"docid": "f5477513603a133747dc477a12205374",
"score": "0.71810913",
"text": "def delete_all_node_groups\n delete_node_group_descendents(get_node_group(Rootuuid))\n end",
"title": ""
},
{
"docid": "132beb9e1a82e3b8630fd79f3f2f954b",
"score": "0.69966286",
"text": "def re... |
3a243fdccc6d36455dbba93c3525c50b | We use 0 or nil to determine that the price of a variation should be the same as the base product. | [
{
"docid": "6b22ad99d24a3c839218450c208b3c93",
"score": "0.0",
"text": "def test_same_price_as_base_doesnt_save\n @v.price = @v.product.price\n assert @v.save\n assert_nil @v.read_attribute('price')\n end",
"title": ""
}
] | [
{
"docid": "54fe70ed02ca5bf4ea289c71b6799a36",
"score": "0.7311788",
"text": "def product_or_first_variant_price\n if self.has_variants\n first_variant.price\n else\n price\n end\n end",
"title": ""
},
{
"docid": "a8267f64cbf95b14a4c5367bf0a0b0d0",
"score": "0.7144732... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "b76aaf4b227b4dea1ae17d607bed0f46",
"score": "0.0",
"text": "def set_favourite\n @favourite = Favourite.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;... |
aa7aeb67e1c5a68b07ef2fa92893dbc8 | POST /maintenance_cycles POST /maintenance_cycles.json | [
{
"docid": "7c5494b4c2b00d93a8897836afee1daf",
"score": "0.7171666",
"text": "def create\n @maintenance_cycle = MaintenanceCycle.new(params[:maintenance_cycle])\n\n respond_to do |format|\n if @maintenance_cycle.save\n format.html { redirect_to @maintenance_cycle, notice: 'Maintenance ... | [
{
"docid": "4be14f5274840a433010193570e79299",
"score": "0.65502673",
"text": "def new\n @maintenance_cycle = MaintenanceCycle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @maintenance_cycle }\n end\n end",
"title": ""
},
{
"doc... |
41ae54657bf2e92d521a76ad51b179fe | Has the value of the expression changed? We use the prettyprinted string represenation to detect differences as this avoids problems with dup (causes too many differences) and == (causes too few) | [
{
"docid": "60c5c16b05c409fae0592d486a5a23de",
"score": "0.65558684",
"text": "def changed?\n (value != previous_value)\n end",
"title": ""
}
] | [
{
"docid": "a49b366e79587cb9fb4b143a7fca0e99",
"score": "0.70617646",
"text": "def changed?\n return !@diff.to_s.empty?\n end",
"title": ""
},
{
"docid": "786b5bf24e585351c6ed57add5a927e8",
"score": "0.6594864",
"text": "def changed?\n prev_value != @new_value\n end",
... |
49256940f3fddcc2fa7e022a2950bdaf | DELETE /featured_images/1 DELETE /featured_images/1.json | [
{
"docid": "c7b205b13ef945adb147317b74e0c2f4",
"score": "0.77582103",
"text": "def destroy\n @featured_image.destroy\n respond_to do |format|\n format.html { redirect_to featured_images_url, notice: 'Featured image was successfully destroyed.' }\n format.json { head :no_content }\n en... | [
{
"docid": "2b578b287d8c49db5b2c8e83e7b51d76",
"score": "0.7455413",
"text": "def destroy\n @featureimg.destroy\n respond_to do |format|\n format.html { redirect_to featureimgs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "99682da49eee0... |
c566cb6db92705dece6977271a772c67 | POST /breads POST /breads.json | [
{
"docid": "c0460d1ceb6085effb954b62a1e810e2",
"score": "0.54771703",
"text": "def create\n @bread = Bread.new(bread_params)\n @bread.bread_store_id = current_bread_store_manager.bread_store.id\n\n respond_to do |format|\n if @bread.save\n format.html { redirect_to @bread, notice: '... | [
{
"docid": "0d868feee734966b65697ef42ba11e3a",
"score": "0.6160422",
"text": "def create(bin_params)\n @rest.post('save', bin_params)\n end",
"title": ""
},
{
"docid": "236c1a9ce5dba766a47a3bf85b73f4c9",
"score": "0.58054984",
"text": "def create\n @bloom = Bloom.new(params[:b... |
3e8246ba1db1ef698d2178fe4366c819 | Determine a status to represent the collective orders for this collection. | [
{
"docid": "d7e0b022887e3afb22ff8e9e65bfa82a",
"score": "0.6455674",
"text": "def order_status\n # Default order status\n current_status = 'creating'\n\n current_status = 'in progress' unless orders.any? { |o| o.order_status == 'creating' }\n current_status = 'failed' if orders.all? { |... | [
{
"docid": "dc8910bd621a8ee108277c4d40a1e093",
"score": "0.659564",
"text": "def collection_status=(value)\n if value == 'Complete' then\n specimens.each { |spc| spc.collection_status = 'Collected' if spc.pending? }\n end\n setCollectionStatus(value)\n end",
"title": ""
},... |
0e95049c27e04972f60532f90e3d1ea1 | POST /captures POST /captures.json | [
{
"docid": "287bcd6e943d1ef4d0b05949091c2b6a",
"score": "0.6517154",
"text": "def create\n @capture = Capture.new(capture_params)\n\n respond_to do |format|\n if @capture.save\n format.html { redirect_to @capture, notice: 'Capture was successfully created.' }\n format.json { ren... | [
{
"docid": "3f75d7c8492a785ed1a2e0a1b28e1dc4",
"score": "0.6825025",
"text": "def capture(params = {})\n update_attributes(WebPay.client.post([path, 'capture'].join('/'), params))\n end",
"title": ""
},
{
"docid": "525b82fb1324f9e02a3b30edcb19ea60",
"score": "0.6731063",
"tex... |
82bc3975f1172a2d63469a950a76f25e | return depth of the head block | [
{
"docid": "a665504b8758fbedf3a6dc0b6068b719",
"score": "0.6965125",
"text": "def get_depth\n raise \"Not implemented\"\n end",
"title": ""
}
] | [
{
"docid": "c8c4d4320bf9bd854f2469f9b09770bc",
"score": "0.7514826",
"text": "def depth()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "f2b3a2223a91ca6b0454ac7de1ba7ff4",
"score": "0.7200412",
"text": "def depth; end",
"... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "3a7350dca3c30a3ca0391633c4a29f3d",
"score": "0.0",
"text": "def api_v1_answer_upvote_params\n params.fetch(:api_v1_answer_upvote, {})\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... |
b3b89bfc09d890c50db0c26399aadb3b | GET /resource/edit def edit super end PUT /resource | [
{
"docid": "9492f84ef022e065824927ab75e695ea",
"score": "0.0",
"text": "def update\n begin\n self.resource = resource_class.to_adapter.get!(send(:\"current_#{resource_name}\").to_key)\n prev_unconfirmed_email = resource.unconfirmed_email if resource.respond_to?(:unconfirmed_email)\n re... | [
{
"docid": "da8f9ab6f67466b608158cce61743bd8",
"score": "0.82021475",
"text": "def edit\r\n @r = Resource.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "3ee6901d0c71c8ab825d9c59699a4d8e",
"score": "0.819061",
"text": "def edit\n\tputs \"edit\"\n @resource = Resource.fi... |
5a9c0598b6d5006c26d7a5de631fc8d0 | Override from Hyrax:app/controllers/concerns/hyrax/curation_concern_controller.rb Hyrax default behavior is that a user cannot see their own work if the document is "suppressed", which means Hyrax::Workflow::ActivateObject has not been called. In Emory's case, they do not want the object activated until the student has... | [
{
"docid": "5a2039923507ad0c949233b979c17ce3",
"score": "0.0",
"text": "def document_not_found!\n doc = ::SolrDocument.find(params[:id])\n # Render the document if the current_user == the depositor of the document\n return doc if current_user && current_user.user_key == doc[\"depositor_ss... | [
{
"docid": "80be78d76f8fcd8d44fcd1e263811c68",
"score": "0.6140883",
"text": "def activate_owner \n owner and owner.activate!\n end",
"title": ""
},
{
"docid": "b541eab58fd8ab7f3e7dcf97179c30a8",
"score": "0.6026032",
"text": "def approve\n Authorization::Maintenance:... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "73f56fa26333d368d3bd543e5bacdc26",
"score": "0.0",
"text": "def update!(**args)\n @location_name = args[:location_name] if args.key?(:location_name)\n @ownership = args[:ownership] if args.key?(:ownership)\n end",
"title": ""
}
] | [
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"t... |
a045f6048d2c2f8d7ef3124ee34a0bad | PUT /vms/1 PUT /vms/1.json | [
{
"docid": "a2f0e8387fd3e2cccf3ef7a79f672d75",
"score": "0.61906034",
"text": "def update\n @vm = Vm.find(params[:id])\n\n @vms = Vm.all\n respond_to do |format|\n if @vm.update_attributes(params[:vm])\n format.js { redirect_to :protocol =>'https://', :controller =>'vms', :action=>'... | [
{
"docid": "d9fff6e9f96464fb3337246bb2c7ce9a",
"score": "0.6956132",
"text": "def put_vm(id, name, options)\n body = Fog::Generators::Compute::VcloudDirector::Vm.new(options.merge(:name => name)).generate_xml\n request(\n :body => body,\n :expects => 202,\n ... |
90f36f36ce6b84c25b9fe6cb92fbe375 | DELETE /clients/1 DELETE /clients/1.json | [
{
"docid": "378fab01059d123cf9ccb0a85fc2d9b6",
"score": "0.7799133",
"text": "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "9d43b417dd5e319aae919c64ea4154d1",
"score": "0.77840954",
"text": "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "201a69f9e6ca4cdf9914... |
d3f47c387f89c10afe365d3f68320212 | DELETE /candidate_statuses/1 DELETE /candidate_statuses/1.json | [
{
"docid": "c6752a2173bc0ed69045692bf6cdb1d4",
"score": "0.76828325",
"text": "def destroy\n @candidate_status = CandidateStatus.find(params[:id])\n @candidate_status.destroy\n\n respond_to do |format|\n format.html { redirect_to candidate_statuses_url }\n format.json { head :no_conte... | [
{
"docid": "7801b1ad0734a5034f29f4db20473a9f",
"score": "0.71896493",
"text": "def destroy\n @status = current_user.statuses.find(params[:id])\n @status.destroy\n\n respond_to do |format|\n format.html { redirect_to(statuses_url) }\n format.xml { head :ok }\n end\n end",
"tit... |
e9af3c73825553f99f33c15b354a8a40 | Hardwire all MACs in order to avoid NSpacekts | [
{
"docid": "804765270730802cc8cd7091785f794c",
"score": "0.6547195",
"text": "def write_mac_list(macs_by_ll)\n macs_by_ll.each_pair do |ll,mac|\n i_face = Collectd.config['ping']['interface']\n # ip -6 neigh add fec0::1 lladdr 02:01:02:03:04:05 dev eth0\n system \"sudo /sbin/ip -6 neig... | [
{
"docid": "25ac5584461c34683dff1191f8d95661",
"score": "0.6856072",
"text": "def mac_addresses\n requires :raw\n macs(@raw[:fission])\n end",
"title": ""
},
{
"docid": "3bcfc16a283c2db6cb879b85318ee191",
"score": "0.6817294",
"text": "def mac_spoofing\n ... |
ed314c7fd7c142ccf90402eda7d24447 | SEED MATCHES AMONG TEST_USER and Tom | [
{
"docid": "6091f79e03bdacceb5223894edac495f",
"score": "0.0",
"text": "def tom_likes_walker\n Swipe.create!({\n swiped_yes: true,\n swiper_id: 23,\n swipee_id: 24\n })\nend",
"title": ""
}
] | [
{
"docid": "0ec095035f10bc647674907b54e598b2",
"score": "0.6024368",
"text": "def test_create_seed\n r1 = create_seed 123\n r2 = create_seed 123\n assert_equal r1, r2\n end",
"title": ""
},
{
"docid": "361e0cfd99a0254f7f2377854c615d19",
"score": "0.595851",
"text": "def tes... |
118b3fc8d4db011e4a886804ff6fcefd | Backbone of the tables and views support. | [
{
"docid": "afb0b849493cdca34fe4ae45b16a6566",
"score": "0.0",
"text": "def information_schema_tables(type, opts)\n m = output_identifier_meth\n metadata_dataset.from(Sequel[:information_schema][:tables].as(:t)).\n select(:table_name).\n where(:table_type=>type, :table_sc... | [
{
"docid": "d94955607794c1448b69e690db6c7427",
"score": "0.6890085",
"text": "def view_table\n\n\tend",
"title": ""
},
{
"docid": "94d37ef71e804b6e644e27bd6bc01e44",
"score": "0.67766255",
"text": "def collection\n raise 'Implement here the collection data for the tableview'\n en... |
36adbef888796ad88b0c7a3fd66d55b9 | GET /bedrijfs/1 GET /bedrijfs/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "6989d00bbce442902239e9a3cac1c238",
"score": "0.69939154",
"text": "def show\n @bewertung = Bewertung.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bewertung }\n end\n end",
"title": ""
},
{
"docid": "c... |
bf632475070c4c536cce54775c05ed5f | Unknown line indicator found. Overwrite this method if you want to add line indicators to the Slim parser. The default implementation throws a syntax error. | [
{
"docid": "309e11ad7a5fa36f70b4987786f4fe9b",
"score": "0.86627924",
"text": "def unknown_line_indicator\n syntax_error! 'Unknown line indicator'\n end",
"title": ""
}
] | [
{
"docid": "41cd4ecae805e8207632aa9d4c1a8ca7",
"score": "0.82086754",
"text": "def unknown_line_indicator; end",
"title": ""
},
{
"docid": "04a8ae0747a4c4c0625c79a278a8b8f1",
"score": "0.66668594",
"text": "def unknown(line)\n end",
"title": ""
},
{
"docid": "7455011... |
6beaf42342d30d994f0f4bd9b4c34298 | get the subnet used for nodes | [
{
"docid": "87a8e92bd5097cde6c07962ac367bc6d",
"score": "0.71916425",
"text": "def GetSubnet()\n # puts \"Error. GetSubnet not defined\"\n # exit 1\n return @rstack.GetSubnet()\n end",
"title": ""
}
] | [
{
"docid": "4a04b96210bf4461225dfeb10616d467",
"score": "0.8135283",
"text": "def GetSubnet()\n \"192.168.0.0/16\"\n end",
"title": ""
},
{
"docid": "4a04b96210bf4461225dfeb10616d467",
"score": "0.8135283",
"text": "def GetSubnet()\n \"192.168.0.0/16\"\n end",
"title"... |
8795dac8c1790fff9f3f8d0d1fa45013 | Used to set the 'Open all as tabs' global option. | [
{
"docid": "78a06520c3f5673dd01c99fec12fb10c",
"score": "0.7138559",
"text": "def menus_open_tabs=(val)\n set('menus_open_tabs', val ? 1 : 0)\n end",
"title": ""
}
] | [
{
"docid": "0ef04507b8628312cdb448a1a73b0b10",
"score": "0.66930616",
"text": "def open_tabs\n end",
"title": ""
},
{
"docid": "977904000a466063066ef6d3b3178af0",
"score": "0.636471",
"text": "def open_tab\n end",
"title": ""
},
{
"docid": "165c75466aea250b1674d7c... |
7354224eee462990f3e53d0771f22b7f | restituisce gli admin del gruppo | [
{
"docid": "03581541d542fc514325d2620c143b98",
"score": "0.0",
"text": "def admins\n User.where(id: memberships.admin.pluck(:user_id)).all\n end",
"title": ""
}
] | [
{
"docid": "ee3ed234f4863daf711b690c0c13e6b1",
"score": "0.64429235",
"text": "def admin\n #TODO\n end",
"title": ""
},
{
"docid": "3099942e9264fe15b1ed124fb6b96b9e",
"score": "0.6395226",
"text": "def graficas\n end",
"title": ""
},
{
"docid": "db2dfae624d1b925cc460... |
c3d89e685a61e726a1afdc36ba4399c5 | POST /fichaselementos POST /fichaselementos.xml | [
{
"docid": "de692d73f605b572c30f1c1c4ccca2e5",
"score": "0.65054786",
"text": "def create\n @fichaselemento = Fichaselemento.new(params[:fichaselemento])\n\n respond_to do |format|\n if @fichaselemento.save\n format.html { redirect_to(@fichaselemento, :notice => 'Fichaselemento was suc... | [
{
"docid": "bdfc7b4c165e0acbae31433125529919",
"score": "0.59635293",
"text": "def xml_file\n if params[:file]\n uploaded_file = params[:file]\n file_content = uploaded_file.read\n doc = Nokogiri::XML(file_content) # (content , nil, 'UTF-8')\n # tipo_enseñanza: 10 = parbularia, 1... |
e7022288497fe784b14ca366ad8ab13f | POST /examns POST /examns.json | [
{
"docid": "c73f95eb271f2c01ef9c3d0e12d021fb",
"score": "0.69207555",
"text": "def create\n @examn = Examn.new(examn_params)\n\n respond_to do |format|\n if @examn.save\n format.html { redirect_to @examn, notice: 'Examn was successfully created.' }\n format.json { render :show, ... | [
{
"docid": "76eedb884f419339898df8c6e0a4d771",
"score": "0.6646149",
"text": "def create\n exam = Exam.new(exam_params)\n \n if exam.save\n render json: ExamSerializer.new(exam).serialized_json\n else\n ren... |
04685ee1113149d76c23ae44ca15d813 | POST /members POST /members.json | [
{
"docid": "f5eed5fa20ce100489153d694fd8c6ad",
"score": "0.6285939",
"text": "def create\n @member = Member.new(member_params)\n unless @member.set_region_admin == \"1\"\n @member.region_id = current_member.region_id\n end\n\n respond_to do |format|\n if @member.save\n forma... | [
{
"docid": "0da26b7aa32be08283438deaf34ac0e0",
"score": "0.6734318",
"text": "def add_member_to_list(user, list, member_id, options={})\n post(\"/#{user}/#{list}/members.json\", options.merge(:id => member_id))\n end",
"title": ""
},
{
"docid": "dfc0bebba417ecc03e98c03a4309fc7d",
... |
bbf632154e1e98ed4d683fce5a501ed0 | PATCH/PUT /xyzs/1 or /xyzs/1.json | [
{
"docid": "c12e9c923a0a1d705dc57a69e7ed4b68",
"score": "0.60989124",
"text": "def update\n respond_to do |format|\n if @xyz.update(xyz_params)\n format.html { redirect_to @xyz, notice: \"Xyz was successfully updated.\" }\n format.json { render :show, status: :ok, location: @xyz }\... | [
{
"docid": "d5eaea298e64625a71a15a970f3b75ed",
"score": "0.6732275",
"text": "def patch *args\n make_request :patch, *args\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.661948",
"text": "def rest_patch(path, options = {}, api_ver = @api_version... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "3f163c4fc6ed8154b572857efb575191",
"score": "0.0",
"text": "def set_item\n @item = Item.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;... |
69beaa3e957d1fc356539d0314d703e1 | Custom attribute writer method checking allowed values (enum). | [
{
"docid": "e04c20c6511c4522fa5ab1d6afcc7b6c",
"score": "0.0",
"text": "def status=(status)\n validator = EnumAttributeValidator.new('String', ['a', 'c', 'd'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_val... | [
{
"docid": "8146b840a980695b919bbb80892fcc0c",
"score": "0.6161179",
"text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"GPA_CREDIT_PENDING\", \"GPA_CREDIT_PENDING_REVERSAL\", \"GPA_CREDIT_REVERSAL\", \"GPA_CREDIT\", \"GPA_DEBIT\", \"GPA_DEBIT_PENDING_REVERSAL\", \"GPA_DE... |
fc827fada44e31ff955e5f65ad8a4a7d | Store data from the object in the file | [
{
"docid": "4350c4a2023a60e3f000361f8db61b18",
"score": "0.0",
"text": "def update()\n Ini.write_to_file(@path, @inihash, @comment)\n end",
"title": ""
}
] | [
{
"docid": "ba42800f78e2280390b525201c1a7f6e",
"score": "0.78126526",
"text": "def save obj\n file.puts obj\n obj\n end",
"title": ""
},
{
"docid": "00e3d2e419d85984a35c228b833045b6",
"score": "0.7444829",
"text": "def save_data(obj, filename)\n\tFile.open(filename... |
07aad354831856fa0b6cc2510fa18cce | GET /stage_populations/new GET /stage_populations/new.json | [
{
"docid": "41d4affab87d126fd638b82383117e9f",
"score": "0.78787315",
"text": "def new\n @stage_population = StagePopulation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stage_population }\n end\n end",
"title": ""
}
] | [
{
"docid": "c7b16c1c2fdcce134c7fe125b87ef1a9",
"score": "0.743369",
"text": "def create\n @stage_population = StagePopulation.new(params[:stage_population])\n\n respond_to do |format|\n if @stage_population.save\n format.html { redirect_to @stage_population, notice: 'Stage population w... |
41d325d4fcada488e1edba18d0109353 | TODO: refactor this. Don't generate strings of json. | [
{
"docid": "f06f26b614eb8c965d476766cb515588",
"score": "0.0",
"text": "def scripts\n scripts = []\n if admin_logged_in?\n # scripts << \"<script>window.current_page_id = '#{@page.id}';</script>\" unless @page.nil?\n scripts << javascript_include_tag('compartment/application')\n ... | [
{
"docid": "43d3c1aa617fddc3404ec6737c968d8e",
"score": "0.71709675",
"text": "def prepare_json; end",
"title": ""
},
{
"docid": "24726e1c9c30efbc1920305940fe1b3b",
"score": "0.7026401",
"text": "def json_data; end",
"title": ""
},
{
"docid": "731dc21466ad843aafa3ef6ffef3... |
25ad513801e516add068e0d950604da5 | symbol: string, the symbol representation of the stock. e.g. GOOG | [
{
"docid": "4308a8e5747dfc18ada2a2d1c20e8b60",
"score": "0.0",
"text": "def get_condition\n @condition\n end",
"title": ""
}
] | [
{
"docid": "d6ca325198b1036b7278493f525f8e52",
"score": "0.76967025",
"text": "def stock(symbol)\n Stock.new(stock_quote(symbol))\n end",
"title": ""
},
{
"docid": "9a26a84562b48fb40a8ce39ae1a44e80",
"score": "0.7224108",
"text": "def symbol\n fetch('currency.symbol')\... |
9e5990041fd1d52e0d013f8eb937cb22 | TO DO: Pass scrape decision body IDs and pass them into this class to get meeting IDs for different committees. | [
{
"docid": "b9e91b35d4a6a454676f8d0573feea8f",
"score": "0.5135869",
"text": "def initialize(date)\n\t\t@now = date\n\t\t@decision_body = \"961\"\n\t\t@ids = meeting_ids\n\tend",
"title": ""
}
] | [
{
"docid": "5ffba8a0b2bceb3bbe3ffb0e1ba059d6",
"score": "0.5163305",
"text": "def show\n begin\n @meeting = Meeting.find(params[:id])\n #more code here\n rescue ActiveRecord::RecordNotFound\n redirect_to :action=>\"index\", :type => \"attending\"\n return\n end\n \n ... |
2c39a40aa37c4a7750e4a6d79ccb450f | Set a proc that will be called in the parent process before the worker forks for the first time. | [
{
"docid": "ce5ccf172c2eabcfbc60240582f3acc8",
"score": "0.62745297",
"text": "def before_first_fork=(before_first_fork)\n @before_first_fork = before_first_fork\n end",
"title": ""
}
] | [
{
"docid": "81b5e59ad457c3d48ba6032ce0b370f9",
"score": "0.6751381",
"text": "def setup_child\n log(\"forked worker running setup\")\n end",
"title": ""
},
{
"docid": "3a9033e9c78bae9e4e6f8fb18c9f132f",
"score": "0.65917623",
"text": "def pause_before_fork_in_parent\n en... |
468b1c1956cd12f18bcf7c1e4b66c35c | All components that don't have a permission link to a joinable | [
{
"docid": "e63ef5a30c49b80d77ccd4e1cd14fde8",
"score": "0.5410149",
"text": "def no_inherited_permissions_exist_sql(component_id_column)\n permission_links_for_joinable = PermissionLink.where(:component_type => self.name).where(\"permission_links.component_id = #{component_id_column}\")\n\n ... | [
{
"docid": "2f593925effa1b040956cf64654ccc3a",
"score": "0.6721943",
"text": "def available_components\n # Don't allow importing a component twice to the same project\n reject_component_ids = components.pluck(:id, :component_id).flatten.compact\n # Assumption that released components are public... |
fa1eb7ce328451b214cf5529c5e8f64b | GET /fieldtypes/1 GET /fieldtypes/1.json | [
{
"docid": "2fdf8d491fe3f77e1bb46cb64fd0076e",
"score": "0.70985794",
"text": "def show\n @fieldtype = Fieldtype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fieldtype }\n end\n end",
"title": ""
}
] | [
{
"docid": "e9595b3d8ea240aac90171d41804f3ac",
"score": "0.6756752",
"text": "def show\n @all_field_type = AllFieldType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @all_field_type }\n end\n end",
"title": ""
},
{
... |
5fbee49079628d3754eb88f4bec412f3 | PATCH/PUT /box_types/1 PATCH/PUT /box_types/1.json | [
{
"docid": "6bbe6fb80d015f538f3623dc5b422195",
"score": "0.74681956",
"text": "def update\n respond_to do |format|\n if @box_type.update(box_type_params)\n format.html { redirect_to @box_type, notice: 'Box type was successfully updated.' }\n format.json { render :show, status: :ok,... | [
{
"docid": "7b0d340243b487ab53c43d9cd55dd548",
"score": "0.68691516",
"text": "def update\n respond_to do |format|\n if @order_box_type.update(order_box_type_params)\n format.html { redirect_to @order_box_type, notice: 'Order box type was successfully updated.' }\n format.json { re... |
6408212ac351b04073856c18616aa2e4 | GET /fishing_areas/1 or /fishing_areas/1.json | [
{
"docid": "c540deffb037454151d252ff078f10b8",
"score": "0.0",
"text": "def show\n views = @fishing_area.views + 1\n @fishing_area.update(views: views)\n\n @comments = @fishing_area.comments.paginate(page: params[:page], per_page: 5)\n end",
"title": ""
}
] | [
{
"docid": "950d572d4d3a37293fc3c9d5c756ad4e",
"score": "0.68893003",
"text": "def show\n @area = Area.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @area }\n end\n end",
"title": ""
},
{
"docid": "4bbeaa1f05d6b3ac... |
4d59cb66fa5879371ee7124c3e29d243 | List all nodes List all nodes that are defined for your firm. | [
{
"docid": "ff5e87a9774365b5da5d0faeb15aa5e9",
"score": "0.0",
"text": "def get_node_all_using_get(opts = {})\n data, _status_code, _headers = get_node_all_using_get_with_http_info(opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "ee6f6d1913423c6501d9d1fb88e95fba",
"score": "0.6871392",
"text": "def all_nodes\n SheldonClient::Read.all_nodes\n end",
"title": ""
},
{
"docid": "9a0ca6de1c9f3aedbb47b06bf24237bd",
"score": "0.6653735",
"text": "def nodes\n Node.nodes\n end",
"title": ""
... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "b6f69c624845de51bb7388c24fb14da1",
"score": "0.0",
"text": "def set_blood_glucose_level\n @blood_glucose_level = BloodGlucoseLevel.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60328794",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6017492",
"text": "de... |
03ef8e09428a31db17501a39360e05df | PATCH/PUT /settings/1 PATCH/PUT /settings/1.json | [
{
"docid": "ec3c9fad7750b9b6add09d646f91b2cb",
"score": "0.65009403",
"text": "def update\n respond_to do |format|\n if @setting.update(setting_params)\n format.html { redirect_to [@user, @setting], notice: 'Setting was successfully updated.' }\n format.json { render action: 'show'... | [
{
"docid": "81c7ecebd8a69e6d512d63232cb989f0",
"score": "0.734606",
"text": "def edit_settings(settings)\n queries = password_hash\n queries[:query][:settings] = \"#{settings.to_json}\"\n put \"/setup/api/settings\", queries\n end",
"title": ""
},
{
"docid": "52e664... |
abe8f3de214fef103295f43276e10ab8 | Return a URI of the form scheme://host:port/ Scheme is one of http or https and host is properly wrapped in [] for ipv6 addresses. | [
{
"docid": "9635c2d0ac6ff44408be82e2c81e5497",
"score": "0.74845153",
"text": "def full_uri\n\t\tlhost = datastore['LHOST']\n\t\tif lhost.empty? or lhost == \"0.0.0.0\" or lhost == \"::\"\n\t\t\tlhost = Rex::Socket.source_address\n\t\tend\n\t\tlhost = \"[#{lhost}]\" if Rex::Socket.is_ipv6?(lhost)\n\t\ts... | [
{
"docid": "8792970a13ad4ab7c02922c958c48d48",
"score": "0.78083426",
"text": "def uri\n uri = (is_https? ? HTTPS : HTTP) + URI_SEP_PROTOCOL + hostname\n if (port == DEFAULT_PORT_HTTP && is_http?) ||\n (port == DEFAULT_PORT_HTTPS && is_https?)\n ... |
86309a52af6073d0d12cf0a55624cbf5 | PUT /wasabbi_adminships/1 PUT /wasabbi_adminships/1.xml | [
{
"docid": "441b62511849df9eff8d29f6a26ff0b8",
"score": "0.68484133",
"text": "def update\n WasabbiAdminship.transaction do\n @wasabbi_adminship = WasabbiAdminship.find(params[:id])\n\n respond_to do |format|\n if @wasabbi_adminship.update_attributes(params[:wasabbi_adminship])\n ... | [
{
"docid": "fa20a7a2e09dc4abe4a584ceaac10f6a",
"score": "0.6224116",
"text": "def change_ship(fleet_id, ship_id, index)\n get \"boat/changeBoat/#{fleet_id}/#{ship_id}/#{index}\", -312\n end",
"title": ""
},
{
"docid": "da2d79f11ea8e1084460c35cc108bb93",
"score": "0.6096534",
"tex... |
d083464f9ca81f8154a8b80856bc5094 | user method to check if in a particular round as player | [
{
"docid": "0f54f71df9fff36eb904686a1dd39c75",
"score": "0.0",
"text": "def in_round?(round)\n round.users.where(:id => self.id).exists?\n end",
"title": ""
}
] | [
{
"docid": "5df8946c0516164af73cfaf846c4de5c",
"score": "0.773476",
"text": "def winning?(player)\n player == self.winner\n end",
"title": ""
},
{
"docid": "cbdb60444cf933c620979ef02bad21c7",
"score": "0.7491993",
"text": "def check_winner(player)\n current_game.check_win(play... |
2c68c7eb4f12480383ae353adac40acd | Calculates the distance between two vectors in the ndimensional space | [
{
"docid": "1d21fda4f5c0fa27f5e2dcf104e765d5",
"score": "0.67429155",
"text": "def dist_to(point_1, point_2)\n\tsum = 0\n\tbegin\n\t\tno_of_dimensions = point_1.size\n\t\t(0..no_of_dimensions-1).each do |cord|\n\t\t\tsum += (point_1[cord] - point_2[cord])**2\n\t\tend\n\trescue Exception => e\n\t\t$log.i... | [
{
"docid": "960abc98b997c8ad6f5b5229fbe420b7",
"score": "0.76590115",
"text": "def distance(vector1, vector2)\n sum = 0\n vector1.zip(vector2).each do |v1, v2|\n component = (v1 - v2)**2\n sum += component\n end\n Math.sqrt(sum)\nend",
"title": ""
},
{
"docid": "796... |
3fc7f3f822d75b8a2cc94e0a64c2aafe | testing same phrase but with text following reference: pericope is found | [
{
"docid": "feb3188f21ed0558a7a67cf6d634e1fc",
"score": "0.7389182",
"text": "def test_2_text_after_first_corinthians\n sample_text = \"1 Cor. 1:1 testing for new pericopes.\"\n pericopes = Pericope.parse(sample_text)\n assert pericopes.any?, \"Pericope found.\"\n end",
"title": ""
}
] | [
{
"docid": "07e68e518d5c69ea9fc8db9478651fbd",
"score": "0.71776897",
"text": "def test_3_text_before_first_corinthians\n sample_text = \"This is some text about 1 Corinthians 1:1.\"\n pericopes = Pericope.parse(sample_text)\n assert pericopes.any?, \"No pericope found.\"\n end",
"title": ... |
c24caac2427011352c7ce63e85ce4266 | This device's root device | [
{
"docid": "9f18a18cb73d5f4806e6015833ca54ca",
"score": "0.76919156",
"text": "def root_device\n device = self\n device = device.parent until device.parent.nil?\n device\n end",
"title": ""
}
] | [
{
"docid": "e678536ae02e3736d7c12c937d8cda4e",
"score": "0.8852693",
"text": "def root_device\n @device.root_device\n end",
"title": ""
},
{
"docid": "77a3378b724a47a80a3aa48046029bf8",
"score": "0.81344974",
"text": "def root_device_name\n @instance.root_device_name\n... |
0a852580525e596a764ac5e8dcfb568b | Get the selected articles and page count | [
{
"docid": "b2adb00a89f3a82c01c634da32b255b4",
"score": "0.6710059",
"text": "def setup_selected_articles_and_pages\n #Setup the page and the articles list\n @page = determine_page\n @selected_articles = selected_articles(@page)\n end",
"title": ""
}
] | [
{
"docid": "2930d41935f17378ef3bbf24327c99e1",
"score": "0.66964275",
"text": "def total_articles_count\n object.articles.count\n end",
"title": ""
},
{
"docid": "6b63fade0c818a8e7d2b0c7a2cf1adfd",
"score": "0.6642309",
"text": "def selected_articles(page)\n type, obj = select... |
c42d3ce550d75e027e0e39606d439915 | get country minutes for data numerical reports | [
{
"docid": "63f9f53fcd0d096f0dd4872f751ac8f5",
"score": "0.80287695",
"text": "def country_minutes \n get_minutes(\"country\")\n\n if params[:country_id].present?\n x = Report.weekly_minutes(params[:country_id], \"country\")\n @weekly_labels = x.collect{|x| x.first }\n @weekly_va... | [
{
"docid": "526d9829a79213c231120a892ec82857",
"score": "0.7068461",
"text": "def minute_metrics; end",
"title": ""
},
{
"docid": "7f908b7163713af6143be81ab9d16d54",
"score": "0.67267257",
"text": "def minutes(language)\n\t\t\t\t::Chronos::Duration::Gregorian.new(0, 0, self*::Chronos... |
bce59ee87bfdbdd72d4b197653856fa5 | Description: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Finish the solution so that it returns the sum of all the multiples of 3 or 5 below the number passed in. Note: If the number is a multiple of both 3 and 5, only count it once. ... | [
{
"docid": "f2cd4922c902c5ef7da159af16299f48",
"score": "0.0",
"text": "def solution(number)\narr = [*1..number-1]\narr_2 = arr.map do |a,b| if a%3 == 0 || a%5 == 0 \n a\nelse \n \nend\nend \n\narr_2.reject! {|a| a.nil? }\np arr_2.inject(:+)\nend",
"title": ""
}
] | [
{
"docid": "ec81ceca5cd115ce993c1ea1a3e0c8b1",
"score": "0.82494336",
"text": "def solution(number)\n multiples = []\n\n (1...number).each do |num|\n if (num % 3 == 0)\n multiples << num\n elsif (num % 5 ==0)\n multiples << num\n end\n end\n\n multiples.reduce(:+)\nend",
"title": ""
... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "79ed8a0db80ad60d91b0150e5b34536f",
"score": "0.0",
"text": "def set_result\n @result = Result.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.603186",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015241",
"text": "def ... |
4f813553311b60434214fe863f87e1db | GET /songs GET /songs.json | [
{
"docid": "65a0cc9cdf0acdfa7c8067929f66103f",
"score": "0.0",
"text": "def index\n @songs = Song.search(params[:searchartist], params[:searchtitle]).where(\"key >= 0 AND bpm >= 0\").order(sort_column + \" \" + sort_direction)\n @unfound_songs = Song.where(\"key IS NULL OR bpm IS NULL\").order(sor... | [
{
"docid": "5311b15de9678c723a1305f76e1c3409",
"score": "0.8023557",
"text": "def songs\n \t@songs = Album.find(params[:id])\n songs = RSpotify::Track.search(@songs.name)\n \t@songs = songs.map do |s_songs|\n \tSong.new_from_spotify_song(s_songs)\n end\n render json: {data:@songs}\n end"... |
82e763d5b7df35480d46a3150dc90261 | access_forbidden is called by block_access when access is forbidden. This method does nothing by default. Make sure you return false from the method if you want to halt the filter chain. | [
{
"docid": "9f726b88e63a79a867736689bb238c3a",
"score": "0.8337488",
"text": "def access_forbidden\n false\n end",
"title": ""
}
] | [
{
"docid": "01a64646f46d2f19b51241b1b3c60e76",
"score": "0.75198424",
"text": "def access_denied!\n false\n end",
"title": ""
},
{
"docid": "fa242e8f8ebb1f68e589d4e2db5815dd",
"score": "0.7337088",
"text": "def restrict_access\n return false if restricted_access\n end... |
9ca904fc9ed33ec5dd3f632c11b0f6f0 | A user will be solely responsible for creating reviews | [
{
"docid": "bb2a00c62f597644ed098161407eeba7",
"score": "0.0",
"text": "def create_review(title:, message:, wait_time:, service:)\n new_review = Review.create(title: title, message: message, wait_time: wait_time, service: service, user_id: self.id, polling_place_id: self.find_current_polling_place)\n... | [
{
"docid": "fa4a493cc1b797b1bb6abd4e1bd32749",
"score": "0.7843832",
"text": "def create\n\n # Associate the currently logged in user with this review\n # This way, the view is not cluttered with the user (they already know who they are)\n # The assumption is that there IS a logged in user\n ... |
ab15707afa7556c1ca47b059b43d92b4 | The JWT header for a certificate to be encoded. | [
{
"docid": "4ea4cbcfbc2efe4f63487fc527bfd7ad",
"score": "0.8382731",
"text": "def header(certificate)\n x5t = thumbprint(certificate)\n logger.verbose(\"Creating self signed JWT header with thumbprint: #{x5t}.\")\n { TYPE => TYPE_JWT,\n ALGORITHM => RS256,\n THUMBPRINT => x5... | [
{
"docid": "a692d7927941acc35962d2f666c6c127",
"score": "0.7237147",
"text": "def jws_header(header)\n jws = {\n typ: 'JWT',\n alg: jwa_alg\n }.merge(header)\n jws[:jwk] = to_h if header[:kid].nil?\n jws\n end",
"title": ""
},
{
"docid": "825e899c5d66ac46c99da4bd865f3c... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "8a25663262de3a4075dd29b03d78c56d",
"score": "0.0",
"text": "def set_student\n @student = Student.find_by_user_id(current_user.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... |
2e7a31e8a2dc664540095a4281bd9fa0 | Answer: => "Chris" 7) What will this code return? Concept: pass by reference/value, variables as pointers, method sideeffects vs return value | [
{
"docid": "6553f191d541648acb0a06b836da0fbe",
"score": "0.0",
"text": "def amethod(param)\n param + \" plays basketball\"\n param << \" for U of A!\"\nend",
"title": ""
}
] | [
{
"docid": "88c2828bc3ed3cfe3a0b41916cf1dd88",
"score": "0.73415405",
"text": "def checkPassByValueOrReference( x )\n x = x + 4\n return 9\nend",
"title": ""
},
{
"docid": "3a6c467b91b215d41d1bccfe04753402",
"score": "0.6495056",
"text": "def _return_value()\n #This is a... |
fd54628ccad907146e788f88a1a93b30 | make a hash of file names so they can be randomly sampled | [
{
"docid": "39158644d119b1a5a2ee650f8f05eea9",
"score": "0.5469223",
"text": "def hashDirectory(directory)\n count = 0\n hash = {}\n Dir.foreach(directory) do |item|\n next if item == '.' || item == '..'\n hash[count] = item\n count = count + 1\n end\n hash\nend",
"title": ""
}
] | [
{
"docid": "762996c98f7412594c4140eeccb21d65",
"score": "0.68793434",
"text": "def generate_filename(filename)\n\t\t# Just some entropy to prevent collisions... not trying\n\t\t# to protect any information.\n\t\tfilename = \"#{filename}:#{SecureRandom.hex(10)}:#{Time.now}\"\n\n\t\tdigest = Digest::SHA25... |
32766c0e9bb602ec82532785e8b4a467 | Main entrypoint for script. | [
{
"docid": "29b744438b25a3471d4f502163e2da2d",
"score": "0.0",
"text": "def parse_file\n # Ensure that a filename was passed in\n if ARGV.empty?\n puts 'A filename for parsing is required!'\n exit(1)\n end\n\n doc = parse_xml ARGV[0]\n\n if doc['ImlsExport'] == nil\n puts 'There was an err... | [
{
"docid": "efa7967c369e2852cbce412d933637df",
"score": "0.7475318",
"text": "def main; end",
"title": ""
},
{
"docid": "efa7967c369e2852cbce412d933637df",
"score": "0.7475318",
"text": "def main; end",
"title": ""
},
{
"docid": "efa7967c369e2852cbce412d933637df",
"sc... |
155884b827b36743415b2ba8eb1fcaba | DELETE /serious_games/1 DELETE /serious_games/1.json | [
{
"docid": "c98a724d31ad7136f7304609fb9e5537",
"score": "0.0",
"text": "def destroy\n if !current_user.developer.nil?\n @serious_game = current_user.developer.serious_games.find(params[:id])\n elsif !current_user.teacher.nil?\n @serious_game = current_user.teacher.serious_games.find(para... | [
{
"docid": "fd4eb511cd5e957a76d59b08b0244ce9",
"score": "0.7438183",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "89f8586c58a77df231ae42fdb6e4aff7... |
9c46b53e335ccd5ad347f5fce5b70478 | POST /marca_vehiculos POST /marca_vehiculos.json | [
{
"docid": "4102785b5dfa02168a0d9e1554036dac",
"score": "0.71452165",
"text": "def create\n @marca_vehiculo = MarcaVehiculo.new(marca_vehiculo_params)\n\n respond_to do |format|\n if @marca_vehiculo.save\n format.html { redirect_to @marca_vehiculo, notice: 'Marca Vehiculo was successfu... | [
{
"docid": "92948b7158e67f750acd197623b21668",
"score": "0.68628997",
"text": "def create\n \n @veiculo = Veiculo.new(veiculo_params)\n @veiculo.marca_id = params[:marca_id]\n @veiculo.modelo_id = params[:modelo_id]\n \n respond_to do |format|\n if @veiculo.save\n flash.now... |
59ff8abe0f8b6f85f8ba6d0402890740 | Signup process before activation: get login name and email, ensure to not handle with sessions. | [
{
"docid": "4148300e4989fe9747ae067ed8f7bba5",
"score": "0.66303724",
"text": "def signup!(params)\n self.profile.first_name = params[:user][:profile][:first_name]\n self.profile.last_name = params[:user][:profile][:last_name]\n self.email = params[:user][:email]\n save_without... | [
{
"docid": "f1f365afafdbd64c3f9544340f74424e",
"score": "0.73204744",
"text": "def signup!\n #self.email = params[:user][:email]\n save_without_session_maintenance\n end",
"title": ""
},
{
"docid": "3f4a77df98ac0eb03815715296730514",
"score": "0.72709453",
"text": "def signup!... |
bbfd0a135cf50c4d62f917c6d66105f5 | GET /restaurants/1/tables/1/reservations GET /restaurants/1/tables/1/reservations.json | [
{
"docid": "45138cdb5d146e734aba6fa41b8d064d",
"score": "0.0",
"text": "def index\n @reservations = @table.reservations.order(:starts_at)\n end",
"title": ""
}
] | [
{
"docid": "4ae742f514765a57b76749ee9798b76e",
"score": "0.7510923",
"text": "def index\n @reservations = Reservation.all\n\n render json: @reservations\n end",
"title": ""
},
{
"docid": "2cde528264065427708120f0c77298c8",
"score": "0.7404613",
"text": "def index\n @reserva... |
a847523756b425fdae9f1168c234bd68 | Return facter key This is a helper method in order to support multiple versions of facter depending on the puppet version | [
{
"docid": "1f6e54a73cbf362b7d40c85726705dee",
"score": "0.7429718",
"text": "def get_facter_value(key)\n Facter.value(key.to_sym).to_s\n end",
"title": ""
}
] | [
{
"docid": "8b4db55688c6f8491104f7b9d1cf26a0",
"score": "0.65980417",
"text": "def key\n \"#{@@PREFIX}#{@type}-#{@version.gsub(\".\",\"-\")}\"\n end",
"title": ""
},
{
"docid": "d09b6138702931fc292a94755fbc9f74",
"score": "0.6565308",
"text": "def to_chef_key(key)\n case... |
95a36bd7ff9809e725a0f8229063e53f | retrieve a single identification object | [
{
"docid": "20c3c484aef393bdedc27d870daaec46",
"score": "0.0",
"text": "def info(identification_identity)\n @client.identification.info(identification_identity)\n end",
"title": ""
}
] | [
{
"docid": "f43752c697edc9d7d54aa2e382be2e26",
"score": "0.73224586",
"text": "def identification\n request('getIdentification')\n end",
"title": ""
},
{
"docid": "9b8e27e7de12190b499f7b6f2fa5e8ae",
"score": "0.6846146",
"text": "def identity\n data = perform_get(IDE... |
65bf37d9fa6b2060ae6a05c64ca178e4 | GET /works/new GET /works/new.xml | [
{
"docid": "4914917bc5cc659ff14c4f35856c3d39",
"score": "0.75692403",
"text": "def new\n @work = Work.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @work }\n end\n end",
"title": ""
}
] | [
{
"docid": "94ceaaf9250cdc3d062aeb18bbab1a52",
"score": "0.7215577",
"text": "def new\n @newstuff = Newstuff.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newstuff }\n end\n end",
"title": ""
},
{
"docid": "bd285e51e8b16ef1f6a... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "34d57f862a9d5b5ac28e4acc22855ac8",
"score": "0.0",
"text": "def update!(**args)\n @enabled = args[:enabled] unless args[:enabled].nil?\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... |
9126854f32d2da313be29e2845e28f84 | Allows you to change the category of a given product. New_category Int | [
{
"docid": "39cccd02d01afa558bae0303e17b90af",
"score": "0.7992139",
"text": "def change_category(new_category)\n CONNECTION.execute(\"UPDATE products SET category_id = #{new_category} WHERE id = #{@id};\")\n end",
"title": ""
}
] | [
{
"docid": "5f3f109c218f511a6a5ac4c3cd51ffc4",
"score": "0.73985016",
"text": "def set_new_category\n @new_category = NewCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "f5b80594a16ef691cd53d02f28ee2919",
"score": "0.72056466",
"text": "def set_product_category\n... |