query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
8436b3eea7c6c6df798d688be2bf374f | render erb view templates | [
{
"docid": "d9240eb7392b0d0f2b10a2b2634462d0",
"score": "0.6536232",
"text": "def render(view_name, locals = {})\n # File.join returns a new string formed by joining the strings using \"/\"\n filename = File.join \"app\", \"views\", controller_name, \"#{view_name}.html.erb\" # --> \"app/views/... | [
{
"docid": "5b6f65eb92b2f31ce4f16042fb3880f9",
"score": "0.7775729",
"text": "def render\n # Now we can determine the view, *.html.erb, file path\n template = File.read(view_filename)\n\n # Pass the contents of the view to erubis\n eruby = Erubis::Eruby.new(template)\n\n # bindi... |
f8e9842b28e8a7a326cb5f21945928e2 | Roll the dice and returns an aleatory integer between 1 and 6 | [
{
"docid": "9a00f8f35452ae4ed9ed819ebb3d9537",
"score": "0.0",
"text": "def nextNumber\n Random.rand 1..6\n end",
"title": ""
}
] | [
{
"docid": "85d4bdaa3cdbcc343e7c72c29efea213",
"score": "0.8606674",
"text": "def roll\n return (rand*6 + 1).to_i\n end",
"title": ""
},
{
"docid": "72d35981536142f6e2cf020f66185030",
"score": "0.8506804",
"text": "def roll\n return (rand(1..6)) # (rand(1..6)),to_i\nend",
"t... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "873a08c65fd70b6b9c642f81382754c1",
"score": "0.0",
"text": "def parent_category_params\n params.require(:parent_category).permit(:display_order, :name, :description, :photo)\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... |
8cf6bb133874553981634d5d85ef5517 | GET /servers/1 GET /servers/1.json | [
{
"docid": "b49d8b2aa4cdcf8a293956fe256c8aa1",
"score": "0.6601407",
"text": "def show\n @version = ApplicationController::HEPHAESTUS_VERSION\n @server = Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @server }\n end\n... | [
{
"docid": "5470e53212426fc808d7cf3d24680747",
"score": "0.7760724",
"text": "def servers\n response = get \"server\"\n data = JSON.parse response.body\n data[\"servers\"][\"server\"]\n end",
"title": ""
},
{
"docid": "9169d5bb8ca2efc7681814498e1c0242",
"score": "... |
eb8edf83bf34419dc741548068effce9 | PRIVATE INSTANCE METHODS Define default values of runtime attributes | [
{
"docid": "fb2b1ab5171a82c1eb6a0c10cd020872",
"score": "0.0",
"text": "def set_init_values\n self.create_without_aliases ||= false\n end",
"title": ""
}
] | [
{
"docid": "41d33e0b466c6c204777ab8edc4fc09c",
"score": "0.7160309",
"text": "def default_attributes; end",
"title": ""
},
{
"docid": "41d33e0b466c6c204777ab8edc4fc09c",
"score": "0.7160309",
"text": "def default_attributes; end",
"title": ""
},
{
"docid": "41d33e0b466c6c... |
7176ad3ea3b5b7467d3d7830b2e3e727 | def self.current Thread.current[:user] end def self.current=(user) Thread.current[:user] = user end | [
{
"docid": "44885b45823c25ac131cb07fd525b9d0",
"score": "0.0",
"text": "def create_user(id)\n end_user = EndUser.find(id)\n self.first_name = end_user.first_name\n self.last_name = end_user.self\n last_name.dob = end_user.dob\n self.mobile = end_user.mobile\n self.gender = end_user.gen... | [
{
"docid": "161b6c7e9f57a27d1f628d57166dd29c",
"score": "0.9163948",
"text": "def current=(user)\n Thread.current[:current_user] = user\n end",
"title": ""
},
{
"docid": "cd0e6b9871dd31cd7a4da2b81f4d034d",
"score": "0.86758184",
"text": "def user=(user)\n Thread.curren... |
8da8cc9508221671b734e41f25561474 | The configured EntityStore instance. Changing the rackcache.entitystore value effects the result of this method immediately. source://rackcache//lib/rack/cache/context.rb40 | [
{
"docid": "6daaf82d3cc78dc75bd9b6e6a33d6643",
"score": "0.673728",
"text": "def entitystore; end",
"title": ""
}
] | [
{
"docid": "fd12e6555213d89ae62934bcf77e165a",
"score": "0.7763518",
"text": "def entitystore\n uri = options['rack-cache.entitystore']\n storage.resolve_entitystore_uri(uri, @options)\n end",
"title": ""
},
{
"docid": "c7f9be0560e312922544a86d7e5ab08e",
"score": "0.63674515... |
72e8b2152eef2022efb6dd50006d9e50 | check if the number of words is more than 10 | [
{
"docid": "96bfa3b49d9f26d4a33576a33611bdef",
"score": "0.6786053",
"text": "def valid_description\n\t\tif @work_description.split(' ').size > 10\n\t\t\tputs \"Sorry! Try to describe in 10 words only.\"\n\t\t\treturn true\n\t\telse \n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
}
] | [
{
"docid": "f502ede5b145da1d7f620db07de657ac",
"score": "0.7538754",
"text": "def check_word_count\n if @line.text.scan(/[[:alpha:]]+/).count < 10\n flash[:alert] = \"That's too few words\"\n redirect_to corpse_path(Corpse.find(:id))\n elsif @line.text.scan(/[[:alpha:]]+/).count > 20\n ... |
8fea0be46d984df296bdcbac0761bcb2 | set_margins() Set all the page margins to the same value in inches. | [
{
"docid": "bc07731fbdeafd69e1eb233218a9488e",
"score": "0.80022585",
"text": "def set_margins(margin)\n set_margin_left(margin)\n set_margin_right(margin)\n set_margin_top(margin)\n set_margin_bottom(margin)\n end",
"title": ""
}
] | [
{
"docid": "bf857609167e0907e01a19a2713998b3",
"score": "0.75764436",
"text": "def margins(*margins)\n cur_page.margins(*margins)\n end",
"title": ""
},
{
"docid": "843c71ed34d69536e954faeea8b64f6e",
"score": "0.73012364",
"text": "def setPageMargins(top, right, bottom, left)... |
c25a00bf214d24fef31deec081064164 | Turn array of resources into a hash by serialized keys. For consistency with 'hashdiff' the serialized key is the resource type and all components of the title (split on '::'), joined with \f. | [
{
"docid": "3a49fc2a02fb61ac577636a1ce9c1636",
"score": "0.6807721",
"text": "def resources_as_hashes_with_serialized_keys(catalog)\n result = {\n catalog: {},\n catalog_map: {}\n }\n catalog.each do |item|\n i = item.dup\n result[:catalog_map][\"... | [
{
"docid": "697d0546d92192f6669f9160c8272dc1",
"score": "0.70869285",
"text": "def resources2hash resources\n h = []\n resources.each do |k,v|\n hash = {}\n v.instance_variables.each do |var|\n hash[var.to_s.delete(\"@\")] = v.instance_variable_get(var)\n end\n h << hash... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "a3c88b75da0aa9ab98cb1e97ea258d43",
"score": "0.0",
"text": "def update!(**args)\n @label = args[:label] if args.key?(:label)\n @operator_name = args[:operator_name] if args.key?(:operator_name)\n @property = args[:property] if args.key?(:property)\n end",
... | [
{
"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... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "4ffcca5d95b66ab0600a234987ab2e79",
"score": "0.0",
"text": "def set_filter\n @filter = Filter.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "d... |
ac468ad3ed13163ff1df0a18821963b4 | DELETE /counter_service_types/1 DELETE /counter_service_types/1.json | [
{
"docid": "598330769ed7aa6f2de2ba8bd7df4cdd",
"score": "0.78678465",
"text": "def destroy\n @counter_service_type.destroy\n respond_to do |format|\n format.html { redirect_to counter_service_types_url, notice: 'Counter service type was successfully destroyed.' }\n format.json { head :no... | [
{
"docid": "2419b4db86355dc8706d2ecb12f572f3",
"score": "0.71962607",
"text": "def destroy\n @counter_service.destroy\n respond_to do |format|\n format.html { redirect_to counter_services_url, notice: 'Counter service was successfully destroyed.' }\n format.json { head :no_content }\n ... |
da53885de64c251b4775948542e855e3 | Provides our gateway into the wonderful rainbowfilled world of IO. | [
{
"docid": "23b867867a1e1e79aa448c8303aa2b1a",
"score": "0.0",
"text": "def console\n IO.console\n end",
"title": ""
}
] | [
{
"docid": "d46d645945d182eb8930e52f6aa55f2f",
"score": "0.68943644",
"text": "def io(*) end",
"title": ""
},
{
"docid": "c83ef2c3516f62369dcc1d01f8b26f74",
"score": "0.679554",
"text": "def io; end",
"title": ""
},
{
"docid": "c83ef2c3516f62369dcc1d01f8b26f74",
"scor... |
a7a817661c0faa5c863dfc7d8fa829b2 | Returns the string representation of the object | [
{
"docid": "a408df9f3be79d7c20500741a990725c",
"score": "0.0",
"text": "def to_s\n to_hash.to_s\n end",
"title": ""
}
] | [
{
"docid": "e0c61d22481a9b8a23b7a0620c2b5f87",
"score": "0.901024",
"text": "def to_s\n @object.to_s\n end",
"title": ""
},
{
"docid": "fc45164ab937a7dc1e465646a36f565c",
"score": "0.89506465",
"text": "def to_s\n object.to_s\n end",
"title": ""
},
{
"doci... |
20843be6ba0b3e9b1d895706225af671 | controller method to handle logout | [
{
"docid": "f658e0f667848a08021066b834d0250c",
"score": "0.0",
"text": "def signout\n\t\tself.current_user = false \n\t\tflash[:notice] = \"You have been logged out.\"\n\t\tredirect_to root_url\n\tend",
"title": ""
}
] | [
{
"docid": "d243fedc0151a98d30b84cd13fd5687e",
"score": "0.8364021",
"text": "def logout\n end",
"title": ""
},
{
"docid": "d243fedc0151a98d30b84cd13fd5687e",
"score": "0.8364021",
"text": "def logout\n end",
"title": ""
},
{
"docid": "dc272127cc53d49ce4b0f1693bd9d0ce",... |
6fe4c472da1a87ad1c109be722a3a822 | DELETE /icons/1 DELETE /icons/1.xml | [
{
"docid": "1a87117d528053af4e70bc0ae07d4b72",
"score": "0.7227879",
"text": "def destroy\n @icon = Icon.find(params[:id])\n @icon.destroy\n\n respond_to do |format|\n format.html { redirect_to icons_url }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "7702a0c0486f6239a4b74d456b769b50",
"score": "0.7353024",
"text": "def destroy\n @icon.destroy\n\n respond_to do |format|\n format.html { redirect_to(icons_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0aa3e1bc21ff1203133fb48ddaa01e... |
e7fa9041e681811a175164d5c65493d8 | Members with payments overdue are those who are in the 'grace period'. They may or may not have completed all of the requirements for renewing membership for the membership term. Ex: If the requirement for renewing membership includes "must upload at least 1 file" they may or may not have done that. The requirements fo... | [
{
"docid": "59cf7a1fa7277e348d2d50c8fc72001d",
"score": "0.67031586",
"text": "def make_predefined_in_grace_period_members\n grace_pd_first_day = Date.current - Memberships::MembershipsManager.grace_period + 1.day\n firstname_start = 'GracePeriod-since'\n make_members_paid_through(grace_p... | [
{
"docid": "d5cc4212f615e0c01d3e300f495fb801",
"score": "0.6557306",
"text": "def grace_days_remaining\n (next_renewal_on + SubscriptionConfig.grace_period.days - Time.zone.today) if past_due?\n end",
"title": ""
},
{
"docid": "d5cc4212f615e0c01d3e300f495fb801",
"score": "0.6557306",... |
6d3a4d4172c4f5b1b49e43fb3b6e5286 | GET /mail_pieces/1 GET /mail_pieces/1.xml | [
{
"docid": "6e75a45378be7e9132c8e8d660876577",
"score": "0.58662707",
"text": "def show\n if is_logged_in?\n @mail_piece = MailPiece.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @mail_piece }\n end\n else\n ... | [
{
"docid": "a8338177ad3e6dd0e4a917f728f9699f",
"score": "0.6231727",
"text": "def show_production_inbox\n doc = Hpricot::XML(request.raw_post)\n order_id = parse_xml(doc/:params/'id')\n @orders = Production::ProductionCrud.show_production_inbox(order_id)\n respond_to do |wants|\n wants... |
c8888dd23d4531f857537c68b58fa723 | GET /client_needs/new GET /client_needs/new.json | [
{
"docid": "54d3b7f48ec0248c04ee289bb5a68494",
"score": "0.7562714",
"text": "def new\n @client_need = ClientNeed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client_need }\n end\n end",
"title": ""
}
] | [
{
"docid": "8eed1295c2e50a9bc30a3a37616d73fe",
"score": "0.69279397",
"text": "def create\n @client_need = ClientNeed.new(params[:client_need])\n\n respond_to do |format|\n if @client_need.save\n format.html { redirect_to @client_need, notice: 'Client need was successfully created.' }\... |
42a4ac3910b7349d7ceb081ea27ed586 | GET /test_adminltes GET /test_adminltes.json | [
{
"docid": "754aae13c150440a6c5d25d127d8105e",
"score": "0.7358052",
"text": "def index\n @test_adminltes = TestAdminlte.all\n end",
"title": ""
}
] | [
{
"docid": "e6431780a70a27e308f9b87194fafe07",
"score": "0.75427514",
"text": "def index\n @admin_tests = ::Test.all\n render json: @admin_tests\n end",
"title": ""
},
{
"docid": "1cf56ac16d29b83e1e37848e7e75a353",
"score": "0.70280594",
"text": "def show\n render j... |
204c27c3703f563865c728384fb86e42 | Used in conjunction with the Parent object containing the collection. The parent sends updated information to the collection(s) using notify_collections | [
{
"docid": "8737ff4b2654f3c623f0e20fe8debd5f",
"score": "0.5778712",
"text": "def notify_members *updates\n self.each { |member| member.update_from_parent *updates }\n end",
"title": ""
}
] | [
{
"docid": "0b8e7c1a66056fdfe3c9866734cc019f",
"score": "0.6748163",
"text": "def collection_with_parent_collection=(_arg0); end",
"title": ""
},
{
"docid": "0b8e7c1a66056fdfe3c9866734cc019f",
"score": "0.6748163",
"text": "def collection_with_parent_collection=(_arg0); end",
"ti... |
ebd77411ca6ef28cd7330c296a4b9f1b | The path in which daemonized servers and nodes will store their pids. | [
{
"docid": "ac1f41fb1660cd96a7aa2a2e9adaf84d",
"score": "0.6691221",
"text": "def pid_path(pid_file=nil)\n @pid_path ||= config[:pid_path] || PID_PATH\n pid_file ? File.join(@pid_path, pid_file) : @pid_path\n end",
"title": ""
}
] | [
{
"docid": "699a2a7848306d4d52dfd3119234e4da",
"score": "0.74255747",
"text": "def pidpath\n File.join(@piddir, @pidfile)\n end",
"title": ""
},
{
"docid": "9457e179e754c343a945fefd77acf7c7",
"score": "0.73377085",
"text": "def pid_path\n @pid_path ||= File.join(Config.pid_r... |
f681e2b00c2487cc6e66c9072d0c1aca | GET /gatherings/1 GET /gatherings/1.json | [
{
"docid": "5f5925f6fa2f782f11d662025cff985e",
"score": "0.0",
"text": "def show\n @moment = Moment.new\n @activity = Activity.new\n @comment = Comment.new\n @gathering = Gathering.includes(:moments, :comments).find(params[:id])\n @place = Place.new\n @collaborators = @gathering.users\... | [
{
"docid": "4c71c688d0a2bfd106ebc2ec79b91b4e",
"score": "0.7189468",
"text": "def show\n @gather = Gather.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gather }\n end\n end",
"title": ""
},
{
"docid": "0adefd46cf1... |
e750771901eb9ae145ad7c125185f681 | GET /item_definitions/1 GET /item_definitions/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "6645243267a5deac089c80800cc689ab",
"score": "0.67747223",
"text": "def index\n if params[:query]\n @item_definitions = ItemDefinition.connection.execute(\"SELECT * FROM item_definitions where name like '#{ params[:query] }'\")\n else\n @item_definitions = ItemDefinition.all\n... |
fb2105d29018b05c743cd1aa0bda7cdb | PUT /streamapi_stream_themes/1 PUT /streamapi_stream_themes/1.xml | [
{
"docid": "69481eff51f8f39f9827011a8aec53b5",
"score": "0.7343452",
"text": "def update\n @streamapi_stream_theme = StreamapiStreamTheme.find(params[:id])\n\n respond_to do |format|\n if @streamapi_stream_theme.update_attributes(params[:streamapi_stream_theme])\n format.html { redirec... | [
{
"docid": "0b34f3a566f640c26ddad2a88c9fed5a",
"score": "0.6938556",
"text": "def create\n @streamapi_stream_theme = StreamapiStreamTheme.new(params[:streamapi_stream_theme])\n\n respond_to do |format|\n if @streamapi_stream_theme.save\n format.html { redirect_to(@streamapi_stream_them... |
9312c06fd1ffcdc9ca3a7871222e506b | assign an Array, of rows represented by Hashes to the value of the Table parameter. | [
{
"docid": "3b86797ea5afef2b275fb0912c9eb274",
"score": "0.6621149",
"text": "def value=(val=[])\n unless val.is_a?(Array)\n\t\t\t raise TypeError, \"Must be Array for table value (#{@name}/#{val.class})\\n\"\n\t\t\t\tend\n\t\t\t\tcnt = 0\n\t\t\t val.each do |row|\n\t\t\t\t cnt += 1\n ... | [
{
"docid": "2dbeebba392cc64c29501ab6f46777ec",
"score": "0.6853201",
"text": "def set_hash_of_arrays row\n @headers.each_with_index do |h, i|\n @hash_of_arrays[h] << row[i]\n end\n end",
"title": ""
},
{
"docid": "2e9f4c00a1c02ffee8e8cd815edeb672",
"score": "0... |
0899366a8adaf778ea60d273973896c7 | GET /flatboxes/1 GET /flatboxes/1.json | [
{
"docid": "a9a122e5096f2a5330ede2fdd4a60525",
"score": "0.77940553",
"text": "def show\n @flatbox = Flatbox.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flatbox }\n end\n end",
"title": ""
}
] | [
{
"docid": "cdd2846569d65ccf3e824a7ea6a86fde",
"score": "0.7025624",
"text": "def new\n @flatbox = Flatbox.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @flatbox }\n end\n end",
"title": ""
},
{
"docid": "5b614abe3046538421a86ff7... |
7985abe8524430bb96e0cf298105c0de | Swaps the source file and the resource file. This method moves the other file to the resource path and creates a symbolic link from distination to source. | [
{
"docid": "2ba1a0740cb921f4944dfb6d4b5ba207",
"score": "0.7269361",
"text": "def swap(other)\n unless File.ftype(other) == \"file\"\n raise ArgumentError.new(other)\n end\n dir = @path.dirname\n dir.mkpath unless dir.exist?\n FileUtils.mv(other, @path)\n ... | [
{
"docid": "5abcbdb7618ce5bb3fbb0218af2b5f34",
"score": "0.681522",
"text": "def s_link(source_path, target_path)\n target_file = File.expand_path(target_path)\n\n # If the target file exists we don't really want to destroy it...\n if File.exists?(target_file) and not File.symlink?(target_file)\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "cd2c312e4777db037ded4eebab5138f0",
"score": "0.0",
"text": "def set_credit\n @credit = Credit.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "d... |
a9d37eac6c7fc8d2d32b530946e14109 | Process the variables received during an rlogin. Default is no action. | [
{
"docid": "f173ee362cb3f6fc5305c23cdb003872",
"score": "0.59637964",
"text": "def process_rlogin_options!(options)\n \n end",
"title": ""
}
] | [
{
"docid": "3057cac72ca1b69968d00b9ef8e839eb",
"score": "0.6375589",
"text": "def login\n # Basic variables definitiona\n # Comment this if you don't use the uamsecret\n $uamsecret = \"sharedkey\"\n # If all the params are set attempt login:\n if params.to_a.flatten.compact! == nil\n # attempt_l... |
29f70baa6e26e7b5464a9b9a2b2e82c9 | Returns a list of child tags that need to be wrapped in a paragraph source://sablon//lib/sablon/html/ast.rb463 | [
{
"docid": "ec05955ec89dd86cca1283e4a3f53774",
"score": "0.5693993",
"text": "def wrapped_by_paragraph; end",
"title": ""
}
] | [
{
"docid": "61039af0885c6ac67c2ba163dda31f61",
"score": "0.67040014",
"text": "def child_tags\n return @child_tags\n end",
"title": ""
},
{
"docid": "f78dbd0a8facaec3d57282f06f91452e",
"score": "0.63991565",
"text": "def content\n @node\n ... |
75dfe9f1612304aa490b8f91b79bfc1a | GET /sequence_instances/1 GET /sequence_instances/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "656f19b8d616169daac7f1b99e05a9e4",
"score": "0.7138558",
"text": "def index\n @sequence_instances = SequenceInstance.all\n end",
"title": ""
},
{
"docid": "3341edcacd21e8685532cf2c04b32394",
"score": "0.6646024",
"text": "def create\n @sequence_instance = SequenceI... |
01d51e886456f75777700a8ca1982d56 | Call, both unary and binary operators and regular function calls. TODO: This needs a lot of work. We've cheated with the case statement below. We need a real function signature lookup like we have in R2CRewriter. | [
{
"docid": "5bf315c901cbe373f54ab2e66e8f707e",
"score": "0.66695905",
"text": "def process_call(exp)\n receiver = exp.shift\n name = exp.shift\n\n receiver = process receiver\n\n case name\n # TODO: these need to be numerics\n # emacs gets confused by :/ below, need quotes to fix i... | [
{
"docid": "10faf6b8aeeb21ec2cad2dd5dd5001e3",
"score": "0.681287",
"text": "def translate_call(sexp)\n raise NotInlineableError unless inlineable? sexp\n arg1 = translate_generic_sexp sexp[1]\n arg2 = translate_generic_sexp sexp[3][1]\n res_type = ([arg1.value_type, arg2.value_type]... |
d58cddc4062255cc36df2690a536f8e1 | Calls two other methods in the class | [
{
"docid": "adccac750d558409b4435a19af123a30",
"score": "0.0",
"text": "def virus_effects\n predicted_deaths#(@population_density, @population, @state)\n speed_of_spread#(@population_density, @state)\n end",
"title": ""
}
] | [
{
"docid": "ae43cd0b58480edd1f9e64195f1da86c",
"score": "0.687409",
"text": "def method2() end",
"title": ""
},
{
"docid": "f4ad13bf5fa71b1e7bc47220336ffdbf",
"score": "0.68491364",
"text": "def methods() end",
"title": ""
},
{
"docid": "7090856f6f0462a10eea7d5770cc4a6c",... |
15d4d13632b94340d468cc39fe174bbc | Check all adjacent directions from i and perform union with that new index and current index i to simulate a 'connection' | [
{
"docid": "a94a7118e2d33dd6822392a3fe32bd7e",
"score": "0.54927987",
"text": "def check_directions_from(i)\n # grid_data[up(i)] will return true if that block is 'true', or 'opened'\n union(i, up(i)) if in_bounds?(i, up(i)) && grid_data[up(i)]\n union(i, down(i)) if in_bounds?(i, down(i)... | [
{
"docid": "8f4cc240c7e8e4c794d6349471d23112",
"score": "0.57181025",
"text": "def union(a,b)\n @grid.union(a+1, b+1)\n end",
"title": ""
},
{
"docid": "914432c9207f9edf77897bf301d3b735",
"score": "0.566084",
"text": "def surrounding(index, directions = Grid::Movement, compact = ... |
f8fa044aa196780b2b38f3a8fefa625f | overwrite: create_status_window def create_status_window | [
{
"docid": "490bf654812944a5ac7e816ec3411e47",
"score": "0.0",
"text": "def create_gold_window\n @gold_window = Window_Gold.new\n end",
"title": ""
}
] | [
{
"docid": "b3b2afe65034b05760e5697dc86fd7b3",
"score": "0.8188432",
"text": "def create_status_window\n @status_window = Window_ActorStatus.new(STATUS_WINDOW_X, STATUS_WINDOW_Y)\n @status_window.actor = @actor\n @status_window.set_handler(:ok, method(:on_status_ok))\n @status_window.s... |
a1c00a41df5335d41bec291cc929757e | The functions below here are abstract; each subclass should define them all. Defining them here only for reference. (abstract) Refreshes the given materialized view. | [
{
"docid": "9c7f7ff3416bf7006bd1b1fb3382f92e",
"score": "0.63272846",
"text": "def refresh_view(view_name, name = nil) raise \"Internal Error: Connection adapter didn't override abstract function\"; end",
"title": ""
}
] | [
{
"docid": "04b5bc3374ed5209f9cf6d3755649f08",
"score": "0.71849793",
"text": "def refresh_views\n @materializer.refresh_views\n end",
"title": ""
},
{
"docid": "c341c850acaad03ba9c7b4197dc463c8",
"score": "0.68535906",
"text": "def refresh_materialized_view(name)\n ex... |
3ab07a63f5c6dcef2215e8f774dbbeec | Workaround: modified send_cmd_data function with short sleep time before data_disconnect call Bug Tracker: 4868 | [
{
"docid": "bd197bfb7813fe2f830521bc487ba2e4",
"score": "0.5819278",
"text": "def send_cmd_datax(args, data, mode = 'a', nsock = self.sock)\r\n\t\targs[0] = \"LIST\"\r\n\t\t# Set the transfer mode and connect to the remove server\r\n\t\treturn nil if not data_connect(mode)\r\n\t\t# Our pending command s... | [
{
"docid": "93170d415bc3290ca883596ce1a56cf4",
"score": "0.7208774",
"text": "def sendData(cmd, opts = {})\n opts = { :expected_resp_size => 0,\n :expected_term_char => nil,\n :read_timeout => 0,\n :first_char_sets_resp_length => 0,\n :wait_ms_after => ... |
a6b686e83d4bda95bcd79c820ae77bfe | a / \ b c / \ / \ d e f k / / \ \ m j g l / \ h i _______________________ Height Balanced Binary Tree | [
{
"docid": "b97c9e70d41aabf0215d7732292de005",
"score": "0.76338845",
"text": "def height_balanced_binary_tree(node)\n\n return 0 if node.left.nil? && node.right.nil?\n\n if node.left\n hl = height_balanced_binary_tree(node.left)\n return false if hl == false\n left_height = hl + 1\n else\n ... | [
{
"docid": "71090a2600f3a3e7b13344496d5b9c6a",
"score": "0.7423054",
"text": "def height(value)\nnode = @root\n return \"Sorry your tree seems to be empty\" if node == nil\n\n until node.data == value\n if value < node.data\n node = node.left_child\n else value > node.data\n node = nod... |
ca7f4a7136de40ead92d37428fbc3d05 | Advocate can only edit Candidates which belong to Alliance they manage. AdvocateTeam membership does not grant access to modify the Alliance or its Candidates. Advocate can, however, view Candidates of belonging to any of the AdvocateTeam Alliances in AlliancesControllershow. | [
{
"docid": "98379737814a5f7b0ae679564447ad0c",
"score": "0.0",
"text": "def find_alliance\n @alliance = current_advocate_user\n .electoral_alliances\n .find(params[:alliance_id])\n rescue ActiveRecord::RecordNotFound\n flash.alert = \"Pyydettyä kohdetta ei löytynyt tai sinulla ei ole oi... | [
{
"docid": "69bb83925441beee621fa9632c27a27b",
"score": "0.66576576",
"text": "def update\n @candidate = @alliance.candidates.find(params[:id])\n\n authorize! :update, @candidate\n\n if @candidate.log_and_update_attributes(candidate_params)\n flash[:notice] = \"Muutokset tallennettu.\"\n ... |
b60e5fb7d5b7c2a041691d855ab63e9d | Get a list of Private User Invitations Get a list of user who were invited to view the course. Can be filtered using the request parameters to provide a subset of results. >Note: >This request is paginated and will only provide a limited amount of resources at a time. If there are more results to be collected, a &x60;m... | [
{
"docid": "0b27f0fa3bdad95cf23de5e53800bf10",
"score": "0.68737984",
"text": "def get_private_user_invitations_with_http_info(invitation_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InvitationsApi.get_private_user_invitations ...'\n e... | [
{
"docid": "aa16fdbf3033132579ced2adea12568c",
"score": "0.7806434",
"text": "def get_user_invitations(filter: {}, includes: nil, limit: nil, sort: nil)\n params = users_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)\n users_request_client.get... |
0165876260fb1bba7512601824cab619 | GET /cdb_drug_references/1 GET /cdb_drug_references/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "7c997db855210a841ba7ba28f91de190",
"score": "0.7470691",
"text": "def index\n @cdb_drug_references = CdbDrugReference.all\n end",
"title": ""
},
{
"docid": "8e6d6d0b4d5530ad9f0cd47b3a99d93a",
"score": "0.6617723",
"text": "def reference_list\n genome = Genome.find(... |
63fcbcb4c9ce8fd42a795b6576c23dd2 | out the current state. | [
{
"docid": "cd90f861782510926756f4ecb1c13987",
"score": "0.0",
"text": "def display_board(game)\n puts row1=[\" #{game[0]} | #{game[1]} | #{game[2]} \"]\n puts div= [\"-----------\"]\n puts row2=[\" #{game[3]} | #{game[4]} | #{game[5]} \"]\n puts div= [\"-----------\"]\n puts row3=[\" #{game[6]} | ... | [
{
"docid": "d3e9cc065d104d6ec2ffaefb90e3c7cc",
"score": "0.72624224",
"text": "def write_state; end",
"title": ""
},
{
"docid": "d3e9cc065d104d6ec2ffaefb90e3c7cc",
"score": "0.72624224",
"text": "def write_state; end",
"title": ""
},
{
"docid": "5826316309180a1d271ac87d87... |
b42fb766c7e9f29aad28f63ebbd2c5b4 | Processes incoming emails Returns the created object (eg. an issue, a message) or false | [
{
"docid": "4a3335789ce7d74ec7931b350e376552",
"score": "0.599552",
"text": "def receive(email)\n @email = email\n if !target_project.module_enabled?(:contacts) || !target_project.module_enabled?(:issue_tracking)\n logger.error \"Helpdesk MailHandler: contacts and issues modules should be ena... | [
{
"docid": "ba11c94e307101aec126f8ce05d00b93",
"score": "0.6496129",
"text": "def create\n if from = email_address_parts(params['from']) and @user = Email.find_or_register(from[:email])\n render text: \"Email Received\"\n to_list = email_address_list(params['Delivered-To']).collect do |addr... |
d2dbfc966e0c656da8994e69c3f74e4c | GET /iines/1 GET /iines/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "3a7513ba65e890e5c9531b00cfd1795e",
"score": "0.674798",
"text": "def index\n @iines = Iine.all\n end",
"title": ""
},
{
"docid": "6d7a52d8ddc19bc0c86d90720313eb19",
"score": "0.6560671",
"text": "def show\n @showItin = Itinerary.find(itin_params)\n render json: ... |
6cda1c522743ce8ac6afe121bbf5d0de | POST /time_clock POST /time_clock.json | [
{
"docid": "b8640277d43ab78fdd2fee9422ca09c0",
"score": "0.70853066",
"text": "def create\n @time_clock = TimeClock.new(time_clock_params)\n\n respond_to do |format|\n if @time_clock.save\n format.html { redirect_to time_sheet_index_path(@time_clock), notice: 'Time clock entry was succ... | [
{
"docid": "891fe38f2d6e6daf2d9d7787d149c6d9",
"score": "0.6911337",
"text": "def clock_params\n params.require(:clock).permit(:date, :time, :user, :ip, :action, :message)\n end",
"title": ""
},
{
"docid": "185d8e31227fff14944cf95c1b114fc4",
"score": "0.68418956",
"text": "de... |
b9ce3099366e898119969a72243ca101 | GET /pictures GET /pictures.json | [
{
"docid": "78380be0e8acce6a19618d3a5e3da21d",
"score": "0.0",
"text": "def index\n @pictures = Picture.where(nil).order(\"created_at DESC\")\n if !params[:search].blank? && !params[:search][:location].blank?\n url = \"https://maps.googleapis.com/maps/api/place/textsearch/json?input=#{params[... | [
{
"docid": "c936fef1155d45cfa791faaf9996acdf",
"score": "0.81805253",
"text": "def pictures\n perform_get(\"/me/pictures\", {})\n end",
"title": ""
},
{
"docid": "6b21ae899533bf245bac34b8d6179688",
"score": "0.8062689",
"text": "def pictures\n perform_get(\"/users/... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "7e675c1b6a887e82566fcd5e5bdffa3d",
"score": "0.0",
"text": "def update!(**args)\n @audible = args[:audible] if args.key?(:audible)\n @time_millis = args[:time_millis] if args.key?(:time_millis)\n @time_percent = args[:time_percent] if args.key?(:time_percent)\n ... | [
{
"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... |
5516378f4bbbf22a51c84494aa07f6d1 | Declare an environment variable to be used as a secret key by some encryption algorithm used in our code. To generate a secret suitable for production use, try: openssl rand hex 256 (which will generate 256 bytes = 2048 bits of randomness). The distinction between this and api_credential is mainly for documentation pur... | [
{
"docid": "af172dfbd6380a5da4bc9a1739e147f3",
"score": "0.6515212",
"text": "def crypto_secret(declaration_opts={})\n required_in_production({\n :type => :string,\n :default => DUMMY_CRYPTO_SECRET,\n }.merge(declaration_opts))\n end",
"title": ""
}
] | [
{
"docid": "418e6f2bbe7b29898d55eccaf6929205",
"score": "0.6886196",
"text": "def secret\n guarded_config_env_value('prod_secret', 'P_SECRET')\n end",
"title": ""
},
{
"docid": "348a41ecfd12c46b2929cb678cd3300f",
"score": "0.66480917",
"text": "def secret \n 'horcrux'\n ... |
d17f10a52e5699339a45142527f33285 | Menu y validacion de datos jugadores | [
{
"docid": "6d26aa292cced2be88acd9d2be3254d7",
"score": "0.0",
"text": "def menu(player_n=\"Player\", player_option = 0)\n \n until(player_option >=1 && player_option <=4) do\n puts \"\n #{player_n}, selecciona una opcion para comenzar:\n 1: Piedra\n 2: Papel\n 3... | [
{
"docid": "b576927392e3df6732ae9e1cd01b423e",
"score": "0.6728778",
"text": "def validacion\n puts \"************* VALIDANDO DATOS *************\"\n \n\n #Con base en el valor de ordenForm, se toman diferentes decisiones\n case @ordenForm\n when 1\n puts \"Vengo de (1: BÁSICOS)\"... |
b713aa0dc4b4c505ef766f30c2ef2956 | }}} Returns all Category instances this user has write permissions for as Array, ordered alphabetically. | [
{
"docid": "6f8536d96c6b4ddd601314644f743d34",
"score": "0.7606952",
"text": "def writeable_categories\n # {{{\n if !@writeable_categories then\n if is_admin? then\n @writeable_categories = Category.select { |c|\n c.order_by(:is_private)\n c.order_by(:catego... | [
{
"docid": "2297c1b6ac39b4a92cc2bc9fb7deb78f",
"score": "0.7150631",
"text": "def writeable_category_ids\n # {{{\n if !@writeable_category_ids then\n if is_admin? then\n @writeable_category_ids = Category.select_values(:category_id) { |cat_id|\n cat_id.order_by(:is_pri... |
ad778a50cb159b929da827f4c563efae | ++ plot 3d generic _title_ :: gnuplot title _label_ :: label of plotted value _index_ :: index of value in CSV row _pathBase_ :: file name path base for output. | [
{
"docid": "9030cab0af8cb77630d1d63705757cb4",
"score": "0.82174915",
"text": "def plot3dGeneric(title, label, index, baseName)\n pathBase = \"#{@resultBaseDir}/#{baseName}\" ;\n Gnuplot::directDgrid3dPlot({ :pathBase => pathBase,\n :title => title,\n# ... | [
{
"docid": "ee7e6129c3b6cc8bb2f0c72ab9937443",
"score": "0.800121",
"text": "def plot3dGeneric_old(title, label, index, baseName)\n index += 1;\n pathBase = \"#{@resultBaseDir}/#{baseName}\" ;\n begin\n gplot = Gnuplot.new(:gplot, pathBase) ;\n gplot.setTitle(title) ;\n gplot.set... |
34c830e40b806c369de2b2fb57e64176 | Returns identifier of the mRNA (query) sequence. | [
{
"docid": "2c2e90a7ab034963c657f722874c35a8",
"score": "0.587389",
"text": "def query_id; @hit.mrna.entry_id; end",
"title": ""
}
] | [
{
"docid": "7fb174842233641427c52903e2fdb868",
"score": "0.6661147",
"text": "def query_id; mrna.entry_id; end",
"title": ""
},
{
"docid": "16ef1f368d8a2eccba987ab63e808b1d",
"score": "0.6619085",
"text": "def query_id; seq1.entry_id; end",
"title": ""
},
{
"docid... |
fddf9a73d949d5a88c3f993b27000ab3 | one way to make sure after we save a queue item, it gets a comment recorded for status changes,in the same transaction, without using AR callbacks (and so we have access to current_user) with_action_comments do save_a_queue_item end | [
{
"docid": "716781e965de908d5cacce5c762419aa",
"score": "0.8013268",
"text": "def update_with_action_comments(queue_item, params)\n result = nil\n queue_item.class.transaction do\n result = queue_item.update(params)\n if result && queue_item.saved_change_to_status?\n que... | [
{
"docid": "fc22069db2b3150eabc524960297b31b",
"score": "0.599228",
"text": "def run\n case comment.action\n when \"created\"\n job = PuppetLabs::TrelloCommentJob.new\n else\n logger.info \"Ignoring comment on #{comment.repo_name}/#{comment.issue.number} because the action is #{commen... |
b00a11426bb255bb50fd48508c1ad2c8 | PROBLEM 3: Given an integer, create a recursive function that returns the sum of all individual digits in that integer. 4321 > 4 + 3 + 2 + 1 = 10 | [
{
"docid": "5858459644342c141cd1171b6cb0f99e",
"score": "0.7677048",
"text": "def sum_digits(n)\n return n if n.to_s.length == 1\n\n digits = n.to_s.chars.map(&:to_i)\n\n digits[0] + sum_digits(digits[1..-1].join('').to_i)\n end",
"title": ""
}
] | [
{
"docid": "330c89dc718fdce0c18ad05d313572f6",
"score": "0.82696235",
"text": "def sum_of_digits(n)\n if n == 0\n return 0 # base case (there is no number or the number is 0)\n else\n return n % 10 + sum_of_digits(n / 10) # recursive call\n end\nend",
"title": ""
},
{
"docid": "c167... |
b98c95e04ff39c2df7b09b59b06c883b | GET /tests/1 GET /tests/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "dd9894340d4cf16757baca74371f9f43",
"score": "0.7404314",
"text": "def test\n get(\"/help/test.json\")\n end",
"title": ""
},
{
"docid": "dd9894340d4cf16757baca74371f9f43",
"score": "0.7404314",
"text": "def test\n get(\"/help/test.json\")\n end",
"titl... |
a10ca2a0d47cea4f509093e8f1cfd1fe | POST /searches POST /searches.json | [
{
"docid": "a463d933e9db7ef7b4af190c72f6d781",
"score": "0.6556724",
"text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render ... | [
{
"docid": "69fcecb5d5eaaf40ec8b2cedc3a2ca4c",
"score": "0.75531805",
"text": "def create_search(params = {})\n post(\"/searches\", params)\n end",
"title": ""
},
{
"docid": "2dffef85e1b18b784304671583084fa1",
"score": "0.71366596",
"text": "def create_saved_search(query)... |
2456388491f9f3e58614f7d506c656ec | Set drawing position and style according to the information in a preamble address code | [
{
"docid": "e2dae0d48ba4925cbecde3c81e46a9c2",
"score": "0.6994349",
"text": "def handle_preamble_address_code(hi, lo)\n @state.row = PREAMBLE_ADDRESS_CODE_ROW_MAP[hi]\n # Low byte bit 5 adds 1 to the row number if set\n @state.row += 1 if lo & (1 << 5) != 0\n\n # Low byte bi... | [
{
"docid": "f1fdfc823d062a54a4b1cd297145284c",
"score": "0.55882305",
"text": "def setup_custom_graphic_states\n pdf.line_width(BASE_LINE_WIDTH)\n end",
"title": ""
},
{
"docid": "d443d3652dacae178ebd0448ea46cca0",
"score": "0.54086107",
"text": "def setLabel ( po... |
e77baefcdf17b60e5e54b0bfab6f9134 | Event Handler, fired when the state of the folder list has changed. | [
{
"docid": "1635491062a34b1b24c48ef92e685d3e",
"score": "0.75554675",
"text": "def state_changed\n\t\t\t@form.folderList.count == 0 ? state_no_items : state_has_items\n\t\tend",
"title": ""
}
] | [
{
"docid": "018dfe25106fe62e9b6d0442f5588c59",
"score": "0.7618952",
"text": "def folder_list_item_changed(p_current_item, p_previous_item)\n\t\t\t#@form.folderList.setCurrentItem(p_current_item)\n\t\t\trefresh_buttons\n\t\tend",
"title": ""
},
{
"docid": "7f66eaef62da23e1b4b00290066e815a",
... |
3caa1d89f500406cfc570f01a0d28f1d | keyword is case insensitive | [
{
"docid": "e84009355700ed5ec2c583185d22c56c",
"score": "0.0",
"text": "def test_04\n stmts = @sql.parse(\" SELECT * from foo; \")\n assert_equal(1, stmts.size)\n stmt = stmts.first\n assert_equal(:select, stmt.keyword)\n assert_equal(\" SELECT * from foo;\", stmt.raw)\n end",
"title... | [
{
"docid": "4514e8ad083988f740a47e430ef4215e",
"score": "0.80436844",
"text": "def case_sensitive; end",
"title": ""
},
{
"docid": "4514e8ad083988f740a47e430ef4215e",
"score": "0.80436844",
"text": "def case_sensitive; end",
"title": ""
},
{
"docid": "4e7d5ca4e2d19b896432... |
9ce6c0c9cb098770a7ee250532a62ce7 | gets default settings overwritten with local config hash | [
{
"docid": "b19e5170ee5541d3d5c1ca51f261f9af",
"score": "0.73076355",
"text": "def get_config\n {}.update(local_config)\nend",
"title": ""
}
] | [
{
"docid": "8d2aa6b0bf6cead26b469235375a09f2",
"score": "0.7628238",
"text": "def default_settings()\n @default_settings ||= {}\n end",
"title": ""
},
{
"docid": "dccb303a12184b587b95aa4c4d67a891",
"score": "0.7614594",
"text": "def init_settings\n merge_in_user_settin... |
9c88fae5af574566e00683088df2eda5 | Regresa el nombre completo y grado academico del profesor empezando por grado academico, nombre, apellidos paterno y materno | [
{
"docid": "789b06aadfa2460eaf80fd64005c7fba",
"score": "0.6751426",
"text": "def full_name_with_grado\n self.grado + self.full_name\n end",
"title": ""
}
] | [
{
"docid": "baff953a2c3e576a25cd808691b6015e",
"score": "0.67075175",
"text": "def full_name_apellido_paterno\n self.apellido_paterno.to_s + \" \" + self.apellido_materno.to_s + \" \" + self.nombre.to_s\n end",
"title": ""
},
{
"docid": "349e2ca0c2ad652d62c00867e838c155",
"score": "0... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "585b9ba1c012d70eb303dbd685205de5",
"score": "0.0",
"text": "def update!(**args)\n @lint_results = args[:lint_results] if args.key?(:lint_results)\n end",
"title": ""
}
] | [
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.701199",
"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",
"ti... |
1e7ae2abc99d5f5c3c3242cd37528d9d | Decorator does not change the nature of object it decorates; | [
{
"docid": "36c3fca61da848bfd6eb37ceff920687",
"score": "0.0",
"text": "def kind_of?(name)\n @decorated.kind_of?name\n end",
"title": ""
}
] | [
{
"docid": "5dbec03a0178f6fb4d08a15d63d3aed8",
"score": "0.78594184",
"text": "def decorate; end",
"title": ""
},
{
"docid": "d063c71d19844d4ff86736b629403d48",
"score": "0.7629277",
"text": "def decorated?; end",
"title": ""
},
{
"docid": "d063c71d19844d4ff86736b629403d4... |
ad13e06cef5d19f7bc5b90cfe1fcc196 | convert accessors back to db format | [
{
"docid": "adb835cbac5e0043ccff1e3834c004f4",
"score": "0.0",
"text": "def get_datetimes\n self.punchtime ||= Time.now # if the punchtime time is not set, set it to now\n\n self.punch_date ||= self.punchtime.to_date.to_s(:db) # extract the date is yyyy-mm-dd format\n self.punch_time ||= \"#{'... | [
{
"docid": "ae014b656068cff24539d066d56a3b26",
"score": "0.64397895",
"text": "def attributes_for_database; end",
"title": ""
},
{
"docid": "ec41b96b7941758d1a11089dea2d6bc0",
"score": "0.6183851",
"text": "def create_accessors(name, meth, options = {})\n # Let Mongoid do it... |
71ee0716272e1b71891e3b3e63676692 | currently only prompt meme prompts can be claimed, and by any number of people | [
{
"docid": "5066c961c73878770df6c61dc276f3f2",
"score": "0.6400712",
"text": "def claimable?\n if self.collection.challenge.is_a?(PromptMeme)\n true\n else\n false\n end\n end",
"title": ""
}
] | [
{
"docid": "bb06188f2210e657ba675c1952ba3533",
"score": "0.69350135",
"text": "def prompts(name)\n\tcurr_user = check_user(name)\n\n\twhile true do\n\t\t\tif main_prompt_options(curr_user) == false\n\t\t\t\t\tbreak\n\t\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "666ca687bc28b0cddcf788d94... |
a03995a9f7702b6f68f72ac7f9761d29 | A reference is added as a chain of object keys. it is stored as chain of keys starting from any database | [
{
"docid": "781e56cc3f024ccb2da39b18d88f4d56",
"score": "0.6728375",
"text": "def add_reference_chain key, chain, opts = {}, &blk\n\t\tadd_to_db Database::Reference::Chain.new(self, chain, :proc => blk),\n\t\t\t\t\t\t\tkey, :if_in_use => opts[:if_in_use]\n\tend",
"title": ""
}
] | [
{
"docid": "4e61ad920b4f21616cb7c6cf1b2a34ac",
"score": "0.65563685",
"text": "def objects_with_references\n end",
"title": ""
},
{
"docid": "361ef41739f1cf754d99b174b23c34d5",
"score": "0.6429003",
"text": "def references; end",
"title": ""
},
{
"docid": "361ef41739f1... |
eb86ae83b6d107728f670acb010421d1 | Scrub sensitive parameters from your log filter_parameter_logging :password | [
{
"docid": "51ce113b11c9189c1e0d14f0eded3bbf",
"score": "0.0",
"text": "def access_required_member\n\tlogger.debug session.to_yaml\n\t\tredirect_to '/access_denied.html' and return unless session[\"user_#{current_user.id}\"][:access_level] >= Role.access_level('Member')\n\tend",
"title": ""
}
] | [
{
"docid": "1ccb2fcb382749be5deeda8526b8a50b",
"score": "0.70550495",
"text": "def filter_password_confirmation\n log :filter_password_confirmation, \"\"\n replace_in_file 'config/initializers/filter_parameter_logging.rb',\n 'Rails.application.config.filter_parameters += [:passw... |
b5084366ed45d8185c3734be74b63b8d | ask the user for an operation to perform perform the operation on the two numbers output the results | [
{
"docid": "a005c8f26cbaf8b3e243d8643f390c8c",
"score": "0.0",
"text": "def prompt(message)\n puts \"=> #{message}\"\nend",
"title": ""
}
] | [
{
"docid": "a681953fd16254338df4153805c68a9d",
"score": "0.79417086",
"text": "def arithmetic_ops\n puts \"Enter first number:\"\n num1 = gets.to_i\n puts \"Enter the second number:\"\n num2 = gets.to_i\n\n puts \"#{num1} + #{num2} = #{num1 + num2}\" \n puts \"#{num1} - #{num2} = #{num1 - num2}\"... |
90f0357f31b90de82f3eeed14dfeed83 | Get the selected digital collection Blacklight adds the facet each time it's added, even if it already exists TODO Clean up search filter | [
{
"docid": "7ee1cfa6fa07afa72b14f05f17defbe8",
"score": "0.64489",
"text": "def selected_digital_collections(params)\n # Get previously selected collection facets, handle missing facet parameters\n selected_digital_collections = params.fetch('f'){ {\"digital_collection_sim\" => [\"\"]} }.fetch(\"d... | [
{
"docid": "f1067c21332828138dff4ff7d1459bd6",
"score": "0.67016566",
"text": "def facet_field_names\n collection = Atrium::Collection.find(params[:collection_id]) if params[:collection_id] && !params[:edit_collection_filter]\n if collection\n params[:add_featured] && params[:exhibit_id] ? []... |
f3ae32f4792cc4147f10b10369837a9d | Unzips a file. If the file has a single directory at its root, then the contents of that directory are extracted; otherwise, the zip file is extracted asis. This is necessary since some zip tools might package things in a toplevel directory and we need things like the "src" folders extracted directly in the place where... | [
{
"docid": "2497dc78ce3411b7557b95907d63269e",
"score": "0.71338195",
"text": "def unzip_file(file, destination)\n root_dir = dir_at_zip_root(file)\n\n Zip::ZipFile.open(file) do |zip_file|\n zip_file.each do |entry|\n if root_dir\n name = entry.name[root_dir.length .. entry.n... | [
{
"docid": "c20555e573f675517c2fda99703ee51d",
"score": "0.7967311",
"text": "def unzip\n return unless file.path.end_with? '.zip'\n\n `unzip -qq -o #{file.path} -d #{File.dirname(file.path)}`\n end",
"title": ""
},
{
"docid": "4460551b37efe2d9fd44e5c88c0c4501",
"score": "0.768442... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "8f89c410373b6b274d598c845762ba82",
"score": "0.0",
"text": "def set_arduino_device\n @arduino_device = ArduinoDevice.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.6032574",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015663",
"text": "def... |
27228ec4287219f1ad008c9751e84048 | Add hook after stack actions | [
{
"docid": "cff502012e080b4e9c77201adcebe3b2",
"score": "0.5873187",
"text": "def append(&block)\n be_callable!(block)\n synchronize do\n if applied?\n raise Error::ApplyError,\n \"Hooks have already been applied to stack\"\n end\n @append... | [
{
"docid": "6a77293830239572b8dbe09e7e885f3f",
"score": "0.7201632",
"text": "def apply!\n synchronize do\n if applied?\n raise Error::ApplyError,\n \"Hooks have already been applied to stack\"\n end\n actions = stack.actions.dup\n stubs... |
3a9a1db432705c46fb590f761adb9990 | Inspects the subject name. | [
{
"docid": "1f23a35c52b319590ab4dad252551174",
"score": "0.0",
"text": "def inspect\n \"#<#{self.class}: #{self}>\"\n end",
"title": ""
}
] | [
{
"docid": "8b8979d4afda2856f925a043adb548a1",
"score": "0.751019",
"text": "def name\n @subject.inspect\n end",
"title": ""
},
{
"docid": "d0e1de61fdd3b17c2381046c60ded7bd",
"score": "0.7103165",
"text": "def subject_name\n subject_full_name\n end",
"title": ""
},
... |
d6d5ed8e54204bc5ec1421d3d72a4f08 | Processa entrada do teclado | [
{
"docid": "e19374a6337c4c97343a9c27c700de49",
"score": "0.0",
"text": "def process_input\n\t\td = Input.dir8\n\t\t\n\t\tif d.zero?\n\t\t\tself.stop\n\t\telse\t\n\t\t\ta = 0\n\t\t\n\t\t\tcase d\n\t\t\twhen 1\n\t\t\t\ta = -Math::PI * 3 / 4\n\t\t\twhen 2\n\t\t\t\ta = -Math::PI / 2\n\t\t\twhen 3\n\t\t\t\ta... | [
{
"docid": "8ad275cb885a97d7f291e259bad0ac56",
"score": "0.6382205",
"text": "def set_entrada\n @entrada = Entrada.find(params[:id])\n\t @creador = \"\"\n end",
"title": ""
},
{
"docid": "18c86f5c6bf4663c2397072457411304",
"score": "0.63808835",
"text": "def cad \n co... |
f65b6b0d995d2e68807ed77aa86f06fb | =begin rdoc See Todonotes::Todonotesoverview =end | [
{
"docid": "e135e5865841f5e70b38eedb13b2c10b",
"score": "0.70155185",
"text": "def overview(*settings )\n TODONOTES.overview( *settings )\n end",
"title": ""
}
] | [
{
"docid": "d444fcadf96720b2640c9c58d86d5d69",
"score": "0.70061636",
"text": "def overview(*settings )\r\n TODONOTES.overview( *settings )\r\n end",
"title": ""
},
{
"docid": "07c18b74b627bf87d99a640a01d2b898",
"score": "0.6849366",
"text": "def overview\n\n end",
"ti... |
9997f62bf21a67b6c7753b7157183807 | f.label :username, :caption => "Nickname" | [
{
"docid": "3693cdc2ee0b72e10b848058b055b221",
"score": "0.66518027",
"text": "def label(field, options={})\n options.reverse_merge!(:caption => field.to_s.titleize)\n @view_context.label_tag(field_id(field), options)\n end",
"title": ""
}
] | [
{
"docid": "e42b6d76a2916fa44ab69360fcf2c2ad",
"score": "0.8261865",
"text": "def custom_label\n \"#{self.username}\"\n end",
"title": ""
},
{
"docid": "8c0537a330284198750ff509fe20b2a7",
"score": "0.8016047",
"text": "def to_label\n \"#{username} (#{email})\"\n end",
... |
47d378aa5b8bc329b18299e87658630e | POST /arts POST /arts.json | [
{
"docid": "096ea6381d45f649d9ccd0d25290f592",
"score": "0.0",
"text": "def create\n ## S3\n\n uploaded_io = params[:art][:file]\n filename = sanitize_filename(uploaded_io.original_filename)\n filepath = \"arts/pic\" + Time.now.to_i.to_s + filename\n AWS::S3::S3Object.store(filepath, upload... | [
{
"docid": "d232902785d387a0bddc3aab3cd3933e",
"score": "0.64205444",
"text": "def create\n @user = User.find(params[:user_id])\n @art = @user.arts.create(params[:art])\n\n respond_to do |format|\n if @art.save\n format.html { redirect_to @art, notice: 'Art was successfully created.... |
c387ecca25bb3716f3fd42e14a1837b3 | Determine the base directory from the source | [
{
"docid": "ac1bf0a92515c2e2606822f6ecdaaef4",
"score": "0.8028924",
"text": "def get_base\n case @source\n when \"dropbox\"\n base = \"#{@user.dirs[:dropbox]}/Braincase/Memories\"\n when \"local\"\n base = \"#{@user.dirs[:backups]}/daily_backup\"\n else\n raise ... | [
{
"docid": "157e9e4915b85205dbc6606de08061bf",
"score": "0.8407524",
"text": "def configure_base_dir\n source.parent\n end",
"title": ""
},
{
"docid": "dcdd919ca9e8326ca06106320afe4c94",
"score": "0.788732",
"text": "def source_dir\n Pathname(File.join(root, config[:sour... |
762102dfffa194d6125608eb8293a4c7 | Creates an instance of the Yelp client | [
{
"docid": "1b77b94208a6dc6223e9eae59bef9565",
"score": "0.0",
"text": "def initialize(options = nil)\n @configuration = nil\n define_request_methods\n\n unless options.nil?\n @configuration = Configuration.new(options)\n check_api_keys\n end\n end",
"title": ""
... | [
{
"docid": "34e7960b1bf6bf1f094439f308d711b3",
"score": "0.6634072",
"text": "def new\n @client = Client.new\n end",
"title": ""
},
{
"docid": "a2fd0c9fe2a2cb3cd1543557022ad8a8",
"score": "0.65425354",
"text": "def new\n @client = Client.new\n end",
"title": ""
... |
d3c991b86382c695e4b02a544bde4bc9 | Send a new sms | [
{
"docid": "4b29c2de8f643f0951a5b73d94193717",
"score": "0.71123356",
"text": "def send_sms phone, message\n message = URI.escape message\n response = RestClient.get \"#{sender_base_url}/?from=#{@from}&to=#{phone}&text=#{message}&pass=#{@application_pass}\"\n @response = Response.new resp... | [
{
"docid": "0e3bf6698cbd4a4e59f45001154bfce4",
"score": "0.81859773",
"text": "def new; send_sms; end",
"title": ""
},
{
"docid": "315c2642972c1adf589945fa416978d5",
"score": "0.7729817",
"text": "def send_sms(to_phone_number, message)\n # message = {to:, from:, body: \"Hello\\n\\... |
1d61dbc035a9380a0d118ce2c4021f1c | GET /treatments GET /treatments.json | [
{
"docid": "3e0b58a2eb28211e521e19f24d2d1661",
"score": "0.72617036",
"text": "def index\n @treatments = Treatment.all\n end",
"title": ""
}
] | [
{
"docid": "5ce9f3794117bdc839df60c39df109be",
"score": "0.6947582",
"text": "def list_treatments\n\treturn if authorise_for_web(program_name?,'read_treatment') == false \n\n \tif params[:page]!= nil \n\n \t\tsession[:treatments_page] = params['page']\n\n\t\t render_list_treatments\n\n\t\t return \n\tel... |
e8eb24cf315677e362fc745352550bdf | POST /neighborhoods POST /neighborhoods.json | [
{
"docid": "e8cc1141d372ccbb45f65671e11f7e86",
"score": "0.7730074",
"text": "def create\n @neighborhood = Neighborhood.new(params[:neighborhood])\n\n respond_to do |format|\n if @neighborhood.save\n format.html { redirect_to @neighborhood, notice: 'Neighborhood was successfully create... | [
{
"docid": "1fe52d67626eecea76879dd2a30c3d37",
"score": "0.72448266",
"text": "def create\n @neighbourhood = Neighbourhood.new(neighbourhood_params)\n\n respond_to do |format|\n if @neighbourhood.save\n format.html { redirect_to @neighbourhood, notice: 'Neighbourhood was successfully c... |
1864bf863eafa9f67bab61f91580db20 | The default terminal to use. | [
{
"docid": "f3d84bd502d6acc69307c0ee6caf1961",
"score": "0.0",
"text": "def term\n self['COLORTERM'] || self['TERM']\n end",
"title": ""
}
] | [
{
"docid": "638761cb3b0cdf51e663da1d26c97e5f",
"score": "0.71814877",
"text": "def terminal\n env['COLORTERM'] || env['TERM']\n end",
"title": ""
},
{
"docid": "33022201544bfea948b53cebddc666c6",
"score": "0.70281005",
"text": "def tty\n @tty_command ||= `which tty`.ch... |
6c316382edb6921d99c0c1fa0e408186 | helper method for delete: | [
{
"docid": "902c628ba9625e8d220fa811fe8210e5",
"score": "0.0",
"text": "def maximum(tree_node = @root)\n until tree_node.right.nil?\n tree_node = tree_node.right\n end\n tree_node\n end",
"title": ""
}
] | [
{
"docid": "79f6c1dc625b7028742c1da69decc7cf",
"score": "0.8373501",
"text": "def delete\n \n end",
"title": ""
},
{
"docid": "1fd7dc0e91f151ed3e5049a52c30472f",
"score": "0.80260485",
"text": "def delete\n \n end",
"title": ""
},
{
"docid": "2f0df61f9fb4ef9... |
b1555feead3a662d84f8b741d88a6054 | GET /activities GET /activities.json | [
{
"docid": "1be70a53818de2a7dcb9db69a727ed1b",
"score": "0.7012036",
"text": "def index\n @activities = Activity.all\n end",
"title": ""
}
] | [
{
"docid": "21b623c965d25101ab1fde88c8821fca",
"score": "0.87229973",
"text": "def activities\n get_call(\"1/activities.json\")\n end",
"title": ""
},
{
"docid": "66e0ea9ac48ce37079941ace7e88de8e",
"score": "0.8237991",
"text": "def activities(params = {})\n scope 'defau... |
d12fbae9b353fda6914de541d62e8705 | Return status of if enrolled or not | [
{
"docid": "23fb5263562f752e0f05174cf1fda61d",
"score": "0.6931201",
"text": "def enrolled_to_s\n return \"Not Enrolled, Lottery\" unless self.enrolled\n return \"Enrolled\"\n end",
"title": ""
}
] | [
{
"docid": "d2408ad2a2e04a064f321f0b65a7cfb5",
"score": "0.8120621",
"text": "def is_enrolled?\n @is_enrolled\n end",
"title": ""
},
{
"docid": "c74a4103a2549cae4b033b6bd856c6e8",
"score": "0.8018246",
"text": "def enrolled?\n enroll_status.try(:local_code) == NcsCode::YES\n ... |
b98d1fce5dc270d1a001b100c6706a7b | Internal: The HTTP query conditions for queries for an array of values for the given conditions. conds an Array of Strings, containing the condition names to handle Returns a Hash with the query parameters matching the instance's values on the specified conditions, or an empty Hash. | [
{
"docid": "51e6b3201f260a6fd7aae7d4e578e24a",
"score": "0.7322793",
"text": "def array_queries(conds)\n Hash[\n present_conditions(conds).map { |cond| [cond, @conditions[cond.to_sym].join(',')] }\n ]\n end",
"title": ""
}
] | [
{
"docid": "2e7098b80c8b91c9a7e801ca2b4c0290",
"score": "0.7115026",
"text": "def conds_to_query(conds)\n conds.map do |cond|\n key, value = cond.split(SEARCH_SPLIT, 2)\n { key: key, value: value }.merge(matching_method(cond))\n end\n end",
"title": ""
},
{
"docid"... |
ce611844fd9f75d04952cb395c9a2c0a | Helper for creating a tooltip | [
{
"docid": "2c55743905ac83f63155f06cd812879e",
"score": "0.71448374",
"text": "def tooltip(body, title = nil, length = 10)\n id = UUIDTools::UUID.random_create\n if body.length > length\n <<-TT\n <div id='#{id}' class='tooltip' title='#{title || \"Click to see full text.\"}'>#{body}</div... | [
{
"docid": "be346b8b069bb46cb93e8ea2b45f3731",
"score": "0.7460923",
"text": "def tooltip(hover_element_id, text, title='')\n content = \"<div style='width: 25em'>#{textilize(text)}</div>\"\n \"<script>\" +\n \"new Tip('#{hover_element_id}', '#{escape_javascript(content)}',\"+\n ... |
5c4b6cd379dea4db96e1e0bc2206d005 | GET /pricing_types/1 GET /pricing_types/1.json | [
{
"docid": "c66f49e4d7a0e77602289c51b55381ec",
"score": "0.7552042",
"text": "def show\n @pricing_type = PricingType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @pricing_type }\n end\n end",
"title": ""
}
] | [
{
"docid": "c5a148d0bd574f3f5f50dea76cd1c5b6",
"score": "0.68424827",
"text": "def new\n @pricing_type = PricingType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @pricing_type }\n end\n end",
"title": ""
},
{
"docid": "8fcc3e... |
5bd4c0973adbc5aad821f99457cf336c | PUT /heat_cycles/1 PUT /heat_cycles/1.xml | [
{
"docid": "59f2ed058f86c2d36fe4fb49781f6f30",
"score": "0.61498976",
"text": "def update\n @heat_cycle = HeatCycle.find(params[:id])\n @dames = Dame.find(:all)\n\n respond_to do |format|\n if @heat_cycle.update_attributes(params[:heat_cycle])\n format.html { redirect_to(heat_cycles... | [
{
"docid": "ad54471b285e5e357d9be959c8ade2d8",
"score": "0.59932584",
"text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['conten... |
9352056cb8968df75c794b213dad8bde | GET /contests/1 GET /contests/1.json | [
{
"docid": "061338c40ab84c937cb15bb903d3fb90",
"score": "0.70266056",
"text": "def show\n # @team = Team.find(params[:team_id])\n @contest = Contest.find(params[:id])\n @team = @contest.team\n @categories = Category.all\n \n respond_to do |format|\n format.html # show.html.erb\n ... | [
{
"docid": "52aedc33d9941093eb1cbf3eb98d5a29",
"score": "0.80027866",
"text": "def show\n @contest = Contest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contest }\n end\n end",
"title": ""
},
{
"docid": "9afca6e... |
b774ba8da9c112ec91eac971c3d5019d | POST /leagues POST /leagues.json | [
{
"docid": "892ab39f358fd14c90c64a81ed2e0c2e",
"score": "0.6391315",
"text": "def create\n @league = League.new(league_params)\n\n respond_to do |format|\n if @league.save\n format.html { redirect_to @league, notice: 'League was successfully created.' }\n format.json { render :s... | [
{
"docid": "e42c24d4cdea4b76bd5b7dcf000c9f70",
"score": "0.67970383",
"text": "def create\n @league = League.new(params[:league])\n\n respond_to do |format|\n if @league.save\n format.html { redirect_to @league, notice: t(\"controllers.leagues.create.success\") }\n format.json {... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "ff113e6d3b2125510178a4b95d47f190",
"score": "0.0",
"text": "def set_information_cone\n @information_cone = InformationCone.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6162554",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.60452986",
"text": "def action_hook... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "d5c17bfc57cb2932933ce33062d1ca8d",
"score": "0.0",
"text": "def set_project_change\n @project_change = ProjectChange.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339844",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6014297",
"text": "de... |
60ae3cd908d62f3075df7678e756819f | Stores the result of the current route in a new route so it will not need to be recalculated. | [
{
"docid": "cd935ecbc5c0663479acdc435c2d0ef8",
"score": "0.0",
"text": "def result(name = nil)\n edge_ids = element_ids.to_a\n if edge_ids.count == 1\n e = graph.edge edge_ids.first\n e.add_extensions extensions\n e\n else\n r = self.class.from_edge_ids graph, ... | [
{
"docid": "ffe19c2d9552d13b8cf0e261277c8aa4",
"score": "0.6731799",
"text": "def recalculate\n if @current_route != nil\n d = @current_route.destination\n t = Trip.new(@location, d, self, @current_route.package)\n @time_to_final -= @time_to_next #reset current trip's time\n @time... |
845c74cce0a89987758ff002bfba0f87 | DELETE /people/1 DELETE /people/1.json | [
{
"docid": "557e22d335f9caf173d9743df17be247",
"score": "0.71681243",
"text": "def destroy\n @person.destroy\n respond_to do |format|\n format.html { redirect_to people_url, notice: 'La persona fue eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end",
"title... | [
{
"docid": "8f314271b6ddc87eeeea2ba210ec49d1",
"score": "0.78558725",
"text": "def delete\n render json: Person.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "1216df6a60f1c146fa7372c67537e4ff",
"score": "0.76011",
"text": "def destroy\n Person.destroy(params[:id])\n... |
32c03aa5b5dde934231af5240196e376 | PATCH/PUT /buyers/1 PATCH/PUT /buyers/1.json | [
{
"docid": "1954af9468a6a8ae19b00646902cc7cf",
"score": "0.6330821",
"text": "def update\n authorize @buyer\n respond_to do |format|\n if @buyer.update(buyer_params)\n format.html { redirect_to root_url, notice: \"Buyer #{@buyer.name} was successfully updated.\" }\n format.json ... | [
{
"docid": "26f21c7d38b2d4d9cffd83f9854372d8",
"score": "0.6906049",
"text": "def update\n beer = Beer.find(params[:id])\n beer.update(beer_params)\n render json: beer\n end",
"title": ""
},
{
"docid": "51696d495982d8aa7c1ff8c818cef29f",
"score": "0.6746302",
"text": "def u... |
14c55d0c56802743dc5b8eadeb1f2cfb | DELETE /reviews/1 DELETE /reviews/1.json | [
{
"docid": "f806517e7f13ec22c5d33019ebd087d3",
"score": "0.0",
"text": "def destroy\n @review.destroy\n respond_to do |format|\n format.html { redirect_to @cafe, notice: 'Your review was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "5ba0dedae2c3b9d3a8a58b468d3d130c",
"score": "0.7783478",
"text": "def destroy\n @review = Review.find(params[:id])\n @review.destroy\n\n respond_to do |format|\n format.html { redirect_to reviews_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
... |