query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
af5aece9a2e781a7fc619e111f0323be | TODO: Add filtering based on role to allow viewing of reports GET /reports | [
{
"docid": "f5593ba5cf917fdd6e72ae8e153b16d3",
"score": "0.0",
"text": "def index\n #Counts\n @contract_counts_by_office = Contract.contract_counts_by_office\n @customer_counts_by_office = Contract.customer_counts_by_office\n @total_contracts = @contract_counts_by_office.map { |k, v| @contra... | [
{
"docid": "36afdeb92726e0889d26dec1a7adf478",
"score": "0.7735898",
"text": "def index\n @reports = current_user.reports.all\n end",
"title": ""
},
{
"docid": "34c287216930e6558a410221a90e6fef",
"score": "0.7731513",
"text": "def index\n @reports = current_user.reports.all\n\... |
15f9abb53cc21b554739b6987523c78d | horizontal_vertical_moves = [] (0...8).each do |x| | [
{
"docid": "ed8f182de35b0df3912a70dddea67ff8",
"score": "0.0",
"text": "def moves\n case move_dirs\n when :horizontal_vertical\n horizontal_vertical_movement([0,0])\n when :diagonal_movement\n diagonal_movement(self.pos)\n when :all_directions\n horizontal_vertical_movement(se... | [
{
"docid": "7613e9fd2a11263eeb25d9b1739db38d",
"score": "0.7557613",
"text": "def each_winning_move\n\t\tall_winning_moves = []\n\t\tvertical_array = []\n\t\tall_winning_moves << @board[0]\n\t\tall_winning_moves << @board[1] \n\t\tall_winning_moves << @board[2]\n\t\tvertical_array = @board.transpose\n\... |
0c05c44234bbbf9a45416bc41bf4ea95 | Gets the userId property value. Calling user's ID in Graph. This and other user info will be null/empty for bot call types. GUID. | [
{
"docid": "48225f4ab282761b1bca769fa5e8721e",
"score": "0.6108655",
"text": "def user_id\n return @user_id\n end",
"title": ""
}
] | [
{
"docid": "eda6c13a4bf703bc79fc26b59d1cd564",
"score": "0.6940079",
"text": "def get_userid()\r\n user_info = @context.call_myspace_api(:user_info, :v1_json => true)\r\n user_info['userId'].to_s\r\n end",
"title": ""
},
{
"docid": "f2ad9b284ca47da031117170ec943f03",
"score"... |
0e7e7e4727d18b5a977f49d2386ca39a | Checks if patient is due for Viral load. See: find_patient_viral_load_due_date | [
{
"docid": "af6e9abaf49dc9a941904ab3870597a8",
"score": "0.87390256",
"text": "def patient_due_for_viral_load?\n find_patient_viral_load_due_date >= date\n end",
"title": ""
}
] | [
{
"docid": "f5d874e126354689ddfee42714f32dd5",
"score": "0.77540994",
"text": "def patient_skipped_viral_load?(due_date)\n # Shouldn't we be looking for value_coded: concept('Yes') or something?\n Observation.where(concept: ConceptName.where(name: ['Delayed milestones', 'Tests ordered'])\n ... |
989fa7d192a6207d59f3ae15c7860b15 | Deletes the customer given by ID. | [
{
"docid": "b5cb5736b9636782ca5d97c3d6fab984",
"score": "0.6706358",
"text": "def v1_customers_id_delete_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CustomersApi.v1_customers_id_delete ...\"\n end\n # verify the r... | [
{
"docid": "3495d1741dc263f337039903361e868c",
"score": "0.8796279",
"text": "def delete_customer(id)\n resp = post(\"/customer/delete\", \"CustomerID\" => id)\n resp[\"Success\"] == true\n end",
"title": ""
},
{
"docid": "9543bf6e298f3b5594ff4cc77edcef6c",
"score": "0.84969... |
cac42e0f754b2155cfbb235ef078258c | tag_bookmarks_path was behaving badly for tags with slashes | [
{
"docid": "1b3e93df2c086e89472211edec8ca851",
"score": "0.67685306",
"text": "def link_to_tag_bookmarks(tag)\n {:controller => 'bookmarks', :action => 'index', :tag_id => tag}\n end",
"title": ""
}
] | [
{
"docid": "0bb7d0ff4427502b079d3ac09526d70e",
"score": "0.603172",
"text": "def path\n @path ||= \"tags/#{ slug }\"\n end",
"title": ""
},
{
"docid": "731975c1c82eb7e068a71ec138ebbfb0",
"score": "0.5931105",
"text": "def tag_path(tag, blog_name = nil)\n build_url blog_con... |
947b9199d1778c2f00df5547b4c1191f | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA all well behaved games maintain these instance variables | [
{
"docid": "cf5b43430d5c4fcd0ba9fcd697fccea8",
"score": "0.0",
"text": "def initialize(player_class_array)\r\n @state = Vector.new # state variables should have a fixed order\r\n @state_keys = {} # hash state variable names to indexes into @state\r\n @players = player_class_array.map {|c| c.n... | [
{
"docid": "3ed4cb54f2bc36108e18988abc2c1d85",
"score": "0.7125588",
"text": "def instance_variables() end",
"title": ""
},
{
"docid": "bbb29eeafb03b65af64c286ecf7910b0",
"score": "0.7057553",
"text": "def instance_variables; end",
"title": ""
},
{
"docid": "b081e5a32d33b... |
db43b7f5ed5809d25e04cfd5fa793a46 | triggered on enter state | [
{
"docid": "d4aef1adcb9d55df28b23aa5de832545",
"score": "0.6964718",
"text": "def on_enter(state)\n log \"Enter: #{self.state}\"\n if state == STATE_SLEEP\n self.next_tick_at = sleep_duration.minutes.from_now\n elsif state == STATE_RUNNING\n self.shot_left -= 1\n self.next_tic... | [
{
"docid": "ed757d85881b6b43c45daed35379fb07",
"score": "0.77374715",
"text": "def enter\n @gate_state.enter\n end",
"title": ""
},
{
"docid": "88e980b3127d0bb00279625e7f82d655",
"score": "0.7229184",
"text": "def on_enter\n raise \"Cannot enter Label\"\n end",
"tit... |
b6bca3c8e9ed649138c538b25ccccf47 | DELETE /games/1 DELETE /games/1.json | [
{
"docid": "d04571e668bb47225e03d6c50275650b",
"score": "0.73600286",
"text": "def destroy\r\n @game = Game.find(params[:id])\r\n @game.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to account_user_path(logged_in_user) }\r\n format.json { head :no_content }\r\n ... | [
{
"docid": "fd4eb511cd5e957a76d59b08b0244ce9",
"score": "0.7778522",
"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": "e556b38f3987e315b050212676687394... |
ac8a78ccf40e1d7d82078c1c8b09148a | end update_variance fill amount with zeroes | [
{
"docid": "5961e11d050373e53d558cfeedd973eb",
"score": "0.0",
"text": "def fill_amount\n@fill_projects= current_user.organization.projects\n @fill_projects.each do |p|\n if p.amount.blank?\n amt= 0.0 \n p.record_timestamps=false\n p.update_attribute(\"amount\",amt)\n p.record_time... | [
{
"docid": "f6ce299e48bc3cf2b00ba2154551efbe",
"score": "0.7012946",
"text": "def add_variance\n\n end",
"title": ""
},
{
"docid": "4563cd9914e975b7367b7db6cf54a24c",
"score": "0.6515761",
"text": "def discover_variance\r\n end",
"title": ""
},
{
"docid": "3035f95fd00... |
36bda951db1259c3befec168355063fd | returns rates sorted by :position | [
{
"docid": "5cb2669c4f67d8f3618d22d44cb1cbab",
"score": "0.0",
"text": "def rate_hash\n @checkout.order.shipping_rate_hash\n end",
"title": ""
}
] | [
{
"docid": "be8406498c73f90ff0de360bcc4a1433",
"score": "0.6664979",
"text": "def rates\n date = nearest_date\n\n [\n date.currencies.find{ |d| d.key == @to },\n date.currencies.find{ |d| d.key == @from }\n ]\n end",
"title": ""
},
{
"docid": "af60... |
e8294744b5fc73304706b9ac00dde229 | helper method strips out most of the unwanted markup from event content | [
{
"docid": "17579641a5fc1012165ccdb962eb9d89",
"score": "0.0",
"text": "def format_content content\n # FIXME suboptimal\n\n content.lines.to_a.reject{ | l | l =~ /div/ }.reject { | line | line.chomp.strip.empty? == true }.map do | line|\n CGI::unescapeHTML line\n end.join \"\"\n end",
... | [
{
"docid": "c524ab477e6ccb7c78c9e723ca8a7276",
"score": "0.6689432",
"text": "def discard_b(event)\n @content << %Q|<span class=\"only_b\"><ins>#{event.new_element}</ins></span><br/>\\n|\n end",
"title": ""
},
{
"docid": "d62ffff8d9339a910c8aef19e37c071a",
"score": "0.66591114",
... |
5df956ee9afb7264bbee29bc73f8c541 | Make sure that the connection string is parsed properly when it has an equals sign | [
{
"docid": "3eba10796f75ab200eb687288ca87af3",
"score": "0.0",
"text": "def test_odbc_conn_str_connection_with_equals\n conn_str = 'Foo=Bar;Foo2=Something=with=equals'\n\n odbc_driver_instance_mock = Minitest::Mock.new\n odbc_database_instance_mock = Minitest::Mock.new\n odbc_connection_inst... | [
{
"docid": "9db7ea08bf5074d46842c6dca56e7017",
"score": "0.6921268",
"text": "def quote_connstr(value); end",
"title": ""
},
{
"docid": "9db7ea08bf5074d46842c6dca56e7017",
"score": "0.6921268",
"text": "def quote_connstr(value); end",
"title": ""
},
{
"docid": "953373b0ba... |
b44d715f2d65d768fd479be0762fda89 | Removes the first character, "/" Examples: 1) /public/yata.css becomes public/yata.css 2) /public/nested/file.jpg becomes public/nested/file.jpg | [
{
"docid": "e366b36228b6afa334cfd4d7f4231779",
"score": "0.0",
"text": "def static_asset_path\n return '' unless static_asset?\n\n @path[1..-1]\n end",
"title": ""
}
] | [
{
"docid": "d6ec18720975b51940f7280c4099da71",
"score": "0.73617125",
"text": "def clean_path(path)\n if path\n (path[0] != '/' ? path.insert(0, '/') : path).gsub(/\\/{2,}/, '/')\n end\n end",
"title": ""
},
{
"docid": "ce375ab558f49c342b1a9c7fc3cd848f",
"score": "0.7... |
c17f0f809bff418575761c35dfe31b17 | GET /post397s/new GET /post397s/new.xml | [
{
"docid": "645432e28ee92a331bdb6ba818b741cb",
"score": "0.74250627",
"text": "def new\n @post397 = Post397.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post397 }\n end\n end",
"title": ""
}
] | [
{
"docid": "81b3f1a1b84b920cb9238937f847e899",
"score": "0.7630388",
"text": "def new\n @post200 = Post200.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post200 }\n end\n end",
"title": ""
},
{
"docid": "879cb66276bd00e582f27d... |
2298ff6b33fa4190cce14641087a749d | stop instances based on a tag name and value | [
{
"docid": "90015e9b38f59c47d7ba07b308f7f81c",
"score": "0.8337703",
"text": "def stop_instances_by_tag(tag_name, tag_value)\n get_instances_by_tag(tag_name, tag_value).reservations[0].instances.each do |i|\n @ec2.stop_instances(instance_ids: [i.instance_id])\n end\n end",
"title... | [
{
"docid": "9876cadf701b0d0f9f1522753373d27d",
"score": "0.6596346",
"text": "def stop_instance(instance_id)\n instance_action :stop, instance_id\n end",
"title": ""
},
{
"docid": "8f62097039aac27ee43a4b958ff13ac6",
"score": "0.65530086",
"text": "def stop_instance instan... |
3da7c13860992909fd0ee228200b04dd | undef :service_io_id if method_defined? :service_io_id | [
{
"docid": "ddbf338fa0e8b686b1d28e250850c74c",
"score": "0.8172565",
"text": "def service_io_id\n service.present? ? service.io_id : nil\n end",
"title": ""
}
] | [
{
"docid": "9569cf068a8553c32856d2b27a63d9a1",
"score": "0.63193834",
"text": "def to_stop_io_id\n to_stop.present? ? to_stop.io_id : nil\n end",
"title": ""
},
{
"docid": "633a7be3da5e360b852fc70581a7a2a5",
"score": "0.5925383",
"text": "def service_id(service)\n if @... |
de7edf43c6d39f1369cad95a8b611a54 | Creates and freezes the constraints and the constraint list. | [
{
"docid": "a5c57c46b46b63e5634545fc824d78b9",
"score": "0.8023346",
"text": "def initialize\n initialize_constraints\n @constraints = constraint_list # private method creating the list\n @constraints.each(&:freeze) # freeze the constraints\n @constraints.freeze # freeze the constrai... | [
{
"docid": "edf3bec0bec16f48a6dcde48150e1975",
"score": "0.6598913",
"text": "def freeze\n @constraint_validations.freeze.each(&:freeze)\n @constraint_validation_reflections.freeze.each_value do |v|\n v.freeze\n v.each(&:freeze)\n end\n @constrai... |
a904fd23d3a0c9f3b6e5cce3810c3040 | Display list of suppliers (10 per page) | [
{
"docid": "c2433e6b44fd08601429059332c7a03a",
"score": "0.60119116",
"text": "def index\n p \"Requesting supply chains\"\n page_number = params[:page] ? params[:page].to_i : 1\n supplychain_offset = PER_PAGE * (page_number - 1)\n @supplychains = SupplyChain.all\n @nex... | [
{
"docid": "87f1b59075af355c8277c563fe8f8708",
"score": "0.79667574",
"text": "def index\n @suppliers = Supplier.all.paginate(page: params[:page], per_page: 8)\n end",
"title": ""
},
{
"docid": "d376076fdc8fe54d58f904417a47799b",
"score": "0.7858304",
"text": "def index\n ... |
23f30ebd6c5342c76697c8cc7bf86256 | Method to get a Json Object. param1: String Path of Json. Return: json object | [
{
"docid": "290488d4a55d472c71fdf490660d2a13",
"score": "0.63599217",
"text": "def openJsonFile(filepath)\n $file = File.open filepath\n $jsonObjectMain = JSON.load $file\n return $jsonObjectMain\nend",
"title": ""
}
] | [
{
"docid": "4e590d4cb0d7401654927f09b85e6053",
"score": "0.75529236",
"text": "def get_json(path)\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n\n result\nend",
"title": ""
},
{
"docid": "76b4f2fb0824ed2a2f2dd20cbb75d7f4",
"score": "0.70325... |
4d36e2d17be4e7b1a14059a97f960ea6 | For some reason this doesn't work, so a workaround is used load_and_authorize_resource :event, through: :program | [
{
"docid": "3dc4fd0a0c997864df6f9e67fb52e467",
"score": "0.0",
"text": "def index\n @events = Event.accessible_by(current_ability).where(program: @program)\n @events_commercials = Commercial.where(commercialable_type: 'Event', commercialable_id: @events.pluck(:id))\n @events_missing_comme... | [
{
"docid": "c5cb332bb8821a9da668c6815fa5fc32",
"score": "0.6791258",
"text": "def set_resource\n #apply policy scope\n @event = EventPolicy::Scope.new(current_user, Event).resolve.find(params[:id])\n end",
"title": ""
},
{
"docid": "c4ac69a1661fa60987e73de436f5f014",
"score": "0.6... |
0b773f5515a4c983354568c6bfa898e2 | New student has apply for mission | [
{
"docid": "02cb3147c35e715e1677b4def3651d79",
"score": "0.6460873",
"text": "def new_student_applied(user, mission)\n @user = user\n @mission = mission\n @url_site = URL_SITE\n mail(:to => MAIL_ADMIN, \n :subject => '[EWTL] Nouveau postulant ' + mission.title)\n end",
"title": ... | [
{
"docid": "2f37426835a8b68420f92ccee5d2ab08",
"score": "0.6400198",
"text": "def sign_done(student, sign = false)\n self.students << student\n student_lesson = find_students_lessons(student)\n student_lesson.sign_by_admin = sign\n student_lesson.save\n end",
"title": ""
},
{
"d... |
e7991a0ba811e0b41563bada782cb134 | GET /rubrics GET /rubrics.json def index | [
{
"docid": "5c4e5bf6d15cdd7468dca2840ebf8316",
"score": "0.0",
"text": "def show\n @articles = @rubric.articles.order('published_at desc').paginate(:page => params[:page], :per_page => 18)\n end",
"title": ""
}
] | [
{
"docid": "b0f6eda86cdb6b254b3dc31cbfca2361",
"score": "0.74826354",
"text": "def index\n @rubrics = Rubric.all\n end",
"title": ""
},
{
"docid": "b0f6eda86cdb6b254b3dc31cbfca2361",
"score": "0.74826354",
"text": "def index\n @rubrics = Rubric.all\n end",
"title": ""
}... |
e7ebdd1592c0bde899bf5d01f38b9b2c | method used to fetch the pubsub client from the connection and yield it | [
{
"docid": "891acc280270909c9c12d7eef6a5ba0f",
"score": "0.0",
"text": "def action_success(action, channel, message)\n action_subscribe?(action) ? message.merge('client_action' => 'successful_subscription', 'channel' => channel) : nil\n end",
"title": ""
}
] | [
{
"docid": "98436e39b7b3fcede59ee2baafcce762",
"score": "0.7665107",
"text": "def fetch_pubsub\n connect_to_redis do |connection|\n @pubsub ||= connection.pubsub\n yield @pubsub if block_given?\n end\n end",
"title": ""
},
{
"docid": "230727fd547d4b799ea244e969eba5... |
ee7f27f84f53188925118cca44c71325 | To find color to display good or bad based on budget and actual values for income | [
{
"docid": "da07cc3dfc51b5aed6580242fa98c3cf",
"score": "0.88070846",
"text": "def income_color(actual, budget)\n (actual >= budget) ? 'green' : 'red'\n end",
"title": ""
}
] | [
{
"docid": "8750c92793ed5e402c114c392daaa8ae",
"score": "0.8457562",
"text": "def expense_color(actual, budget)\n (actual > budget) ? 'red' : 'green'\n end",
"title": ""
},
{
"docid": "6d121e562d944e43a2cdc71213233022",
"score": "0.64137775",
"text": "def lise_color(ise_type)\n ... |
f020747c0327a162ee4db1ef47fd278f | PATCH/PUT /memorials/1 PATCH/PUT /memorials/1.json | [
{
"docid": "d651911f295c7278ca886af54182ccc8",
"score": "0.70219654",
"text": "def update\n respond_to do |format|\n if @memorial.update(memorial_params)\n format.html { redirect_to @memorial, notice: 'Memorial was successfully updated.' }\n format.json { head :no_content }\n ... | [
{
"docid": "4c846e1e6bb435af6fb66e7a7df1d186",
"score": "0.6918969",
"text": "def update\n respond_to do |format|\n if @memorial.update(memorial_params)\n format.html { redirect_to @memorial, notice: 'Memorial was successfully updated.' }\n format.json { render :show, status: :ok, ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "3ca2cedd846f7df9ed85a9ed76c8b695",
"score": "0.0",
"text": "def set_snooper\n @snooper = Snooper.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... |
44a74bfed7bf69367bb277c03089e798 | Public: Instantiates a FriendLoader object access_token An access token returned by the Facebook OAuth exchange. | [
{
"docid": "db304bee84a4c3fef25d978d8bf1ef85",
"score": "0.6690496",
"text": "def initialize(access_token)\n @access_token = access_token\n end",
"title": ""
}
] | [
{
"docid": "e2abb1ad0b255bd8202256f41f461183",
"score": "0.6763806",
"text": "def initialize(access_token)\n @app_id = Rails.application.config.facebook_app_id\n @app_secret = Rails.application.config.facebook_app_secret\n @redirect_uri = Rails.application.config.facebook_redirect_u... |
44bec15bef0196d69d68303bd7f6fac8 | Delete a card request Permanently delete a card request. | [
{
"docid": "53fb0701687989969af8671ba93a71a8",
"score": "0.0",
"text": "def delete_card_using_delete_with_http_info(card_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CardApi.delete_card_using_delete ...'\n end\n # verify the requi... | [
{
"docid": "ff0cc1872c73612f610cb61c65b0a661",
"score": "0.6895817",
"text": "def delete card\n @hand.delete(Card.new(card))\n end",
"title": ""
},
{
"docid": "76d24b7ef568b8f83905a35c16f5eb4f",
"score": "0.67819196",
"text": "def delete(request)\n _request(request) { |cli... |
dcaacfdbaca2e88f8738355afc18deae | Returns true if this tile represents a X or T hex on the base map | [
{
"docid": "fe279fb62a6e234a979d92d2c20330c1",
"score": "0.79673165",
"text": "def map_x_or_t?(tile)\n return false unless tile.color == :white\n\n tile.label.to_s.include?('X') || tile.label.to_s.include?('T')\n end",
"title": ""
}
] | [
{
"docid": "96b3cf96bddcbe9be0755d2c86f51a16",
"score": "0.7272137",
"text": "def yellow_x?(tile)\n return false unless tile.color == :yellow\n\n tile.hex.original_tile.label.to_s.include?('X')\n end",
"title": ""
},
{
"docid": "61b40d818ec307adc40972e7b2893a8f",
... |
703d1f5cac800659f510f49309ce5313 | PUT /az_scetch_programs/1 PUT /az_scetch_programs/1.xml | [
{
"docid": "96c012510f84921910f22f204d2bee20",
"score": "0.70391595",
"text": "def update\n @az_scetch_program = AzScetchProgram.find(params[:id])\n\n respond_to do |format|\n if @az_scetch_program.update_attributes(params[:az_scetch_program])\n format.html { redirect_to(@az_scetch_pro... | [
{
"docid": "e453dd649baf3ead652c42660049b3a6",
"score": "0.657989",
"text": "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n flash[:notice] = 'Program was successfully updated.'\n format.html { redi... |
d6f1590bca43c258315b801111aa7b03 | Name of private channel | [
{
"docid": "092478f49c79322da193676733dc2544",
"score": "0.8426073",
"text": "def private_channel\n \"private-#{id}\"\n end",
"title": ""
}
] | [
{
"docid": "e47176d3e20135b74f4fddbbb6c24899",
"score": "0.78274876",
"text": "def channel_name\r\n return for_context(false) { |c| c.channel_name } \r\n end",
"title": ""
},
{
"docid": "be6b94c1161e0083c03683d5e84b6a75",
"score": "0.7349798",
"text": "def channel\n \"pri... |
6dd8ef79af3909f191c939a7486402f1 | Description: handles a execption in server.rb if an error occurs in server.rb it will returns an error msg if the error is unknown it will returns the exception itself Parameter(s): excep Exception: The execption whitch has been catched arg anything: A variable which has to be in the error msg Return: msg string: the e... | [
{
"docid": "a5fc5cdd3b3e35acb63c608efac92b26",
"score": "0.6528084",
"text": "def handleException(excep, arg)\r\n msg = case excep\r\n when \"no such table:\"\r\n \"Their is no table #{arg} in the Database\"\r\n else\r\n \"Error: \" + excep.inspect.to_s... | [
{
"docid": "7cd5df6500303afd971420dcda3d478d",
"score": "0.6962317",
"text": "def parse_exception(msg)\n \n end",
"title": ""
},
{
"docid": "da7042bb861324b2d1e6dc9d3703c539",
"score": "0.67611897",
"text": "def RescueEx(exceptions, variable); end",
"title": ""
... |
1fef61f308aa56b840d4e19e0caf422f | Pinpoint Client for validation and identification of phone numbers Not expected to be used directly, but through helper instance methods | [
{
"docid": "747d8a422ae4ec05837768ca08085f3d",
"score": "0.0",
"text": "def aws_pinpoint_client\n return @aws_pinpoint_client if @aws_pinpoint_client\n\n @aws_pinpoint_client = Aws::Pinpoint::Client.new(region: self.class.sms_aws_region)\n end",
"title": ""
}
] | [
{
"docid": "6e90bb6976467c53b7dcef45a77059d6",
"score": "0.69988203",
"text": "def phone_number\n \"(#{Helpers::FakeIt.area_code}) #{Helpers::FakeIt.exchange_code}-#{Helpers::FakeIt.subscriber_number}\"\n end",
"title": ""
},
{
"docid": "f318b1c8a7af2ea0bb73102c730bdcfa",
"score"... |
22d3f9fadd68440b18567ede48141918 | DELETE /answers/1 DELETE /answers/1.json | [
{
"docid": "97dd48f1924aeb207ea21235a3f82b70",
"score": "0.72359025",
"text": "def destroy\n @answer = @question.answers.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.js\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n en... | [
{
"docid": "7e424e988ff941c50c2f6b1e3363193e",
"score": "0.7804042",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7e424e988ff941c50c2f6... |
df2bf9c4496a11bc1acf54a32ff5779c | Set the value of the Title input for this Choreo. | [
{
"docid": "267935378e6b2d6c376a27646bf46afa",
"score": "0.78180444",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
}
] | [
{
"docid": "cd33e67a4801c216ef99f85d2e7d0647",
"score": "0.780413",
"text": "def set_title(title)\n @title = title\n end",
"title": ""
},
{
"docid": "cd33e67a4801c216ef99f85d2e7d0647",
"score": "0.780413",
"text": "def set_title(title)\n @title = title\n end",
"title": ""... |
e5c3eccdc2956520c4721671dc991452 | Returns list of servers from fog | [
{
"docid": "0aaa7efb52db88abf3e5ce8298500b59",
"score": "0.62059766",
"text": "def list_known_servers\n connect.servers.each do |sr|\n logger.debug sr.inspect\n end\n end",
"title": ""
}
] | [
{
"docid": "261f064a62d585d0be8cad866fcae2ff",
"score": "0.7186355",
"text": "def get_servers\n puts \"Getting server list\"\n servers = @conn.list_servers\n\n for server in servers.body['servers']\n puts server\n end\n\n return servers.body['servers']\n end",
"title": ""
},
... |
357546ca92ca131bec0da59043f17a09 | Returns the average value for the last _num_periods_ | [
{
"docid": "86df08993e599945bb248e9572868f70",
"score": "0.80902517",
"text": "def average( num_periods )\n total = 0\n curr = @idx\n num_periods.times do\n curr = prev_index( curr ) \n total += @periods[curr]\n end\n total / num_periods \n end",
"title": ""
}
] | [
{
"docid": "816110e63bb324a33a74e5c6e80fcde3",
"score": "0.7896399",
"text": "def average_period\n @average_period ||= @periods.inject(&:+).to_f / num_pulses\n end",
"title": ""
},
{
"docid": "5c412c1c6cc2848e58abacc3cc108b04",
"score": "0.7072427",
"text": "def average_perio... |
5a099c47adb65bafdb69d2a044256d5e | to think, I was going to increment by 1 and check every time... obviously the better way is to multiply by the starting number solutions to digest: | [
{
"docid": "80724ed768ba28147570e3e915e10760",
"score": "0.0",
"text": "def sequence(count, start)\n count.times.map { |iteration| (iteration + 1) * start }\nend",
"title": ""
}
] | [
{
"docid": "ba354f81ee89124dca127b3be10c1989",
"score": "0.67569965",
"text": "def gennext(factor, prev)\n (prev * factor) % 2_147_483_647\nend",
"title": ""
},
{
"docid": "7093cdd79d9ab729e475300891f62b0a",
"score": "0.66839004",
"text": "def calcIntDigest(digester)\n return diges... |
5f602b389733d5f35b28f2b0a113f90d | save the terms and indexes into the disk | [
{
"docid": "e0c85a0f87ad4cf52ac477d5d5fd20b7",
"score": "0.83143455",
"text": "def save\n File.open(@index_file, 'wb') do |f|\n f.puts Marshal::dump([@terms, @index])\n end\n end",
"title": ""
}
] | [
{
"docid": "eda6482ed97516474daabbf2462ddce4",
"score": "0.8366022",
"text": "def save\n File.open(@index_file, 'wb') do |f|\n Marshal.dump([@terms, @index], f)\n end\n end",
"title": ""
},
{
"docid": "1835c77f1736d82a3c438364d3e85f69",
"score": "0.69925606",
"text": "def... |
11151909f39e492fe0ff9c4a44678ba0 | GET /instances/1 GET /instances/1.xml | [
{
"docid": "897381cf5fc1585a521268b70b29f2ff",
"score": "0.5944802",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instance }\n end\n end",
"title": ""
}
] | [
{
"docid": "05c38e3a073c1a189bab54ee0f3eb34d",
"score": "0.6595818",
"text": "def index\n @instances = current_account.instances.all(:order => \"aws_image_id asc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @instances }\n end\n end",
... |
00995244facfb77d4f818f386a62b611 | PUT /watchers/1 PUT /watchers/1.json | [
{
"docid": "6842812f019dad48c0d0722a31d2dc3c",
"score": "0.67192936",
"text": "def update\n @watcher = Watcher.find(params[:id])\n\n respond_to do |format|\n if @watcher.update_attributes(params[:watcher])\n format.html { redirect_to @watcher, notice: 'Watcher was successfully updated.... | [
{
"docid": "64be3b7b97d5e0ac04ab3308d1ee9c5e",
"score": "0.67675734",
"text": "def update\n @watcher = Watcher.find(params[:id])\n\n respond_to do |format|\n if @watcher.update_attributes(params[:watcher])\n format.html { redirect_to @watcher, notice: 'Watcher was successfully updated.... |
08254498ca000fd1e5298508a63bcf0f | Get the default validation setting for the association. Determines if by default a validates associated will occur. | [
{
"docid": "066a654cf8e03724a2944cef8ae6109e",
"score": "0.64848906",
"text": "def validation_default; true; end",
"title": ""
}
] | [
{
"docid": "88e3d5853a8120bc0e8b85cd7290a72c",
"score": "0.6138287",
"text": "def validation_default; false; end",
"title": ""
},
{
"docid": "e45461b7555c4d9593cd9edd79e313e1",
"score": "0.5850886",
"text": "def is_default?\n @rule_details.is_default == true\n end... |
d092eee3b1c79313b0ca0a1ea897b350 | GET /modeles GET /modeles.json | [
{
"docid": "6c4bf1eae5a9bfff94fdce8694ed46c3",
"score": "0.7366104",
"text": "def index\n @modeles = Modele.all\n end",
"title": ""
}
] | [
{
"docid": "8e03aab723c567e96fb6b27987f07b6e",
"score": "0.61665386",
"text": "def index\n @layers = Layer.all(:order => :id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @layers }\n end\n end",
"title": ""
},
{
"docid": "85f39efd... |
a9d35f1ae80e420e6f36bfd75713fd84 | Fetches an info message concerning the host's deploy status | [
{
"docid": "c3ec03a927311b34564f0de6d3bebb11",
"score": "0.0",
"text": "def display_message\n if !verified?\n { message: 'Your host needs to be verified by an admin', severity: :alert }\n elsif pending?\n { message: 'client not configured yet', severity: :alert }\n elsif configured? |... | [
{
"docid": "8cb0c7ed4585700fb44d0b6be9f960cf",
"score": "0.65393656",
"text": "def show\n @deploy = Hubstats::Deploy.includes(:repo, :pull_requests).find(params[:id])\n repo = @deploy.repo\n @pull_requests = @deploy.pull_requests.limit(50)\n @pull_request_count = @pull_requests.lengt... |
34158b12b4ca92ad0df49ce3e0c37f71 | Creates a data center load agent with all required packages preinstalled and starts requisite number of instances | [
{
"docid": "43419bce67ef145130837d40bc2566e5",
"score": "0.0",
"text": "def setup(force = false)\n logger.debug { \"#{self.class}##{__method__}\" }\n\n self.save! if save_on_setup?\n return unless self.active? || force\n logger.info(\"Provisioning #{self.machines.size} #{self.class} machines... | [
{
"docid": "dea2d6a57b13cb9de303fb576338aa59",
"score": "0.6340574",
"text": "def startup_sequence\n launch_set(fe_servers)\n wait_for_set(fe_servers, \"operational\")\n \n set_lb_hostname\n \n launch_set(app_servers)\n wait_for_set(app_servers, \"operational\"... |
199c58d11a3a6b751780825863b7d5cd | PUT /restaurants/1 PUT /restaurants/1.json | [
{
"docid": "2ba1bb1faeb3988ac75858fb62f506f9",
"score": "0.6341018",
"text": "def update \n @restaurant = Restaurant.find(params[:id])\n @restaurant.owner_id = current_owner.id\n\n respond_to do |format|\n if @restaurant.update_attributes(params[:restaurant])\n # format.html { redir... | [
{
"docid": "ef9e64655915a948f0d8b549ac8fce71",
"score": "0.75259",
"text": "def update\n json_response(@restaurant.update!(restaurant_params))\n end",
"title": ""
},
{
"docid": "377f6e266f28b08e46c22975cf3f4d34",
"score": "0.7013629",
"text": "def update\n update_resta... |
a3525df29c433dd9c67f31e8f2bb9865 | Removes the sprocket with the given name. This is useful if you don't need one of the default Sprockets. | [
{
"docid": "8cc24587b9d07a2f8d600f3a4118ac5b",
"score": "0.8973314",
"text": "def remove_sprocket(name)\n if sprocket = get_sprocket(name)\n sprockets.delete sprocket\n set_sprocket(name, nil)\n end\n end",
"title": ""
}
] | [
{
"docid": "5df025d27724f71cbb728a794e81f1f1",
"score": "0.65452194",
"text": "def remove(name)\n self.delete_if {|w| w.name == name}\n end",
"title": ""
},
{
"docid": "a58e761e5e08921c00869d32ce4226ba",
"score": "0.6445374",
"text": "def remove_pack(name)\n if pack_exist?... |
daa0d58cc06d8438751280ee0f0aa164 | GET /jobs/1 GET /jobs/1.json | [
{
"docid": "7c9840981db75e60dc404987704cb40f",
"score": "0.7226418",
"text": "def show\n @job = Job.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"title": ""
}
] | [
{
"docid": "c8f7cc0b14cc4ca0decc14ca86f69f5d",
"score": "0.7810516",
"text": "def get_job(id)\n get(\"1/jobs/#{id}\")\n end",
"title": ""
},
{
"docid": "e0d30cb0880ae58f5dd30199afee732c",
"score": "0.7669835",
"text": "def get_jobs()\n u = self.build_uri(\"/jobs\")\n... |
7de6e92ec1e35c75181ef82baf6fa188 | depth of the tree is stored in an attribute even though it could be calculated since depth is needed in queries | [
{
"docid": "e3b56f8c13eec49ac8a5baf1f9d41deb",
"score": "0.0",
"text": "def set_depth\n self.depth = self.path.count(PATH_SEPARATOR)\n end",
"title": ""
}
] | [
{
"docid": "fe0520aa5390e0f5268c89bc06101ab7",
"score": "0.78596896",
"text": "def depth\n @depth\n end",
"title": ""
},
{
"docid": "9f639157289d2212d701e00b77381924",
"score": "0.78534293",
"text": "def depth\n @attributes[:depth]\n end",
"title": ""
},
{
... |
fb8f5cfe5a8493b288609842f2318fc5 | POST /products POST /products.json | [
{
"docid": "3510e159e4d7c9f5689f636f8b5b868f",
"score": "0.0",
"text": "def create\n authorize! :manage, :all\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product detail was successfully created... | [
{
"docid": "407bb6093aa234f76822a55ce5f56b4c",
"score": "0.76166385",
"text": "def create\n Product.create!(product_params)\n json_response(product_params, :created)\n end",
"title": ""
},
{
"docid": "3ddcbf5081b4581931f5cffb5d1126c4",
"score": "0.7605046",
"text": "def create... |
72add5dfc19a6a8229549dc7ff134cb0 | Yank the COUNTth argument from the previous history line. | [
{
"docid": "9c9b18671c54186cc581afcb5b0e307f",
"score": "0.579124",
"text": "def rl_yank_nth_arg(count, ignore)\r\n rl_yank_nth_arg_internal(count, ignore, 0)\r\n end",
"title": ""
}
] | [
{
"docid": "f3824eb9646686f93fd11a07372cfa86",
"score": "0.66047436",
"text": "def rl_yank_nth_arg_internal(count, ignore, history_skip)\r\n pos = where_history()\r\n if (history_skip>0)\r\n history_skip.times { previous_history() }\r\n end\r\n entry = previous_history()\r\n history_... |
3c578b918a0ab54f649ef0e186b98c4b | Returns a hash of user info if logged in to Wordpress, or nil otherwise. | [
{
"docid": "49aace58ce2f5f6af13fd1c292c16f3f",
"score": "0.79130304",
"text": "def get_wordpress_user_info\n\t\t\tif wordpress_cookie\n\t\t\t\tresponse = HTTParty.get(\"#{WORDPRESS_AUTH_URL}?cookie=#{URI.encode(wordpress_cookie)}\")\n\t\t\t\treturn JSON.parse(response.body) if response.code == 200\n\t\t... | [
{
"docid": "95cbf717d7703f75734f9e969b6487b2",
"score": "0.68474793",
"text": "def user_info\n auth_hash['user_info']\n end",
"title": ""
},
{
"docid": "3ddc27b73efb3f9923d4b016d648b922",
"score": "0.6518528",
"text": "def userinfo\n unless defined?(@userinfo)\... |
7526e2a22035abee095556ef0284dafc | GET /screening_locations GET /screening_locations.json | [
{
"docid": "7889a998aa8434adc7e8a1c1e4c0973a",
"score": "0.78931415",
"text": "def index\n @screening_locations = ScreeningLocation.all\n end",
"title": ""
}
] | [
{
"docid": "f3536edc3fe6283013a4670a25814bad",
"score": "0.70069444",
"text": "def show\n @locations = Location.all\n render 'show', formats: 'json', handlers: 'jbuilder'\n end",
"title": ""
},
{
"docid": "0808facaa6cbc6748a1cd8da138c9f10",
"score": "0.6909722",
"text": ... |
c401366ea644df3d104afe0a36898a19 | method that calls out people in line then removes them from the front of the line | [
{
"docid": "3c07b78ef49dea10ed17074a062bb024",
"score": "0.0",
"text": "def now_serving(array)\r\n case array.length\r\n when 0\r\n puts \"There is nobody waiting to be served!\"\r\n else\r\n puts \"Currently serving #{array[0]}.\"\r\n array.shift\r\n end\r\nend",
"t... | [
{
"docid": "9171fabfd1d9cf460153757cb4a600b3",
"score": "0.69773495",
"text": "def now_serving(line)\n arr_line = line\n # if no one in line\n if arr_line.length >= 1\n puts \"Currently serving #{arr_line.first}.\"\n arr_line.shift\n else arr_line.length < 1 \n puts \"There is nobody waiting to b... |
a0f97804b2b8c5fbfeedf927d0668a82 | PUT /package_categories/1 PUT /package_categories/1.xml | [
{
"docid": "1620da932c7fdc51bfc9f7d84066d0c4",
"score": "0.66923887",
"text": "def update\n @package_category = PackageCategory.find(params[:id])\n\n respond_to do |format|\n if @package_category.update_attributes(params[:package_category])\n format.html { redirect_to(@package_category... | [
{
"docid": "2361032d20c90f31f01231aa19cc92d1",
"score": "0.5905008",
"text": "def subscribe_to_category category\n put(\"/categories/#{category}\", code: 204)\n end",
"title": ""
},
{
"docid": "5969c1934aee1189cced0d6703de51b5",
"score": "0.5842354",
"text": "def create\n... |
0afc24ab6f36a4bd6de80811ca387483 | Private If a :user_id exists in the session hash, sets the | [
{
"docid": "fdbab08cfaad8f78cafde4c7e21cb14f",
"score": "0.68008006",
"text": "def set_curr_user\n if session[:user_id] != nil\n @curr_user = User.find( session[:user_id] )\n end\n end",
"title": ""
}
] | [
{
"docid": "c7f670f2b03c6064a9de1d257d7f95e8",
"score": "0.8006146",
"text": "def session_user_set(user)\n session[:user_id] = user ? user.id : nil\n user\n end",
"title": ""
},
{
"docid": "e1e154e0f0e4bd94628b6dee5eeb1542",
"score": "0.771429",
"text": "def set_session(user)\... |
229bbdc2c3dff3e06dba6b5f0bc034e9 | action associated with the list app | [
{
"docid": "d073c7ac1b54e93aeb8430501c488b1c",
"score": "0.0",
"text": "def app\n @group = Group.find_by_code(code_param)\n @user_count = @group.users.count\n end",
"title": ""
}
] | [
{
"docid": "d29c3ab3483eddaf6561e14af86651ce",
"score": "0.72033125",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "4cb3796a1ee8e1728f65e7e9f3b2340c",
"score": "0.71529657",
"text": "def index\n list\n render action: 'list'\... |
f77b440587ab2dd622b9c0b3ae7d6882 | Conall instance methods This should only be run when we're recalculating the scores of all events or determining the top event for the first time | [
{
"docid": "3c634bd6d58b6c396fa5b30cc0d073ce",
"score": "0.7775739",
"text": "def calculate_top_event\n #this isn't the logic we're going to settle on -- just placeholder code for now\n\n return if self.events.where(:status.in => Event::TRENDED_OR_TRENDING).count == 0\n\n top_event = self.event... | [
{
"docid": "808eccc7130a4b6bcbace078957095db",
"score": "0.7347881",
"text": "def reconsider_top_event\n\n if self.events.empty? || (self.events.where(:status.in => Event::TRENDED_OR_TRENDING).count == 0)\n ### if somehow we have a top_event_id and top_event_score but no eligible events, alert a... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "14ab1d02bb8ab44d93909ead6622131e",
"score": "0.0",
"text": "def note_params\n params[:note].permit(:title, :description)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7496716",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6956598",
"text": "def strong_params\n params.require(:request).permit(param_white... |
0893244fec5044de181180d872225cad | Sets a new value in the given object's attribute. For example, class Vehicle state_machine :initial => :parked do ... end end | [
{
"docid": "1dcfbabee79b6eb3b992593d9e8a70cb",
"score": "0.0",
"text": "def write(object, attribute, value, ivar = T.unsafe(nil)); end",
"title": ""
}
] | [
{
"docid": "c8718d70e367f09637711cdfaf023c9a",
"score": "0.7395215",
"text": "def state_machine=(value)\n @state_machine = value.dup\n end",
"title": ""
},
{
"docid": "c8718d70e367f09637711cdfaf023c9a",
"score": "0.7395215",
"text": "def state_machine=(value)\n @state_ma... |
ef6773381e8b4788bb80f1f9ab14b670 | def test_mail emails = User.where.not(email: nil).pluck(:email) mail( to: emails, subject: 'Welcome!' ) end | [
{
"docid": "4740e48030a809ccfdfb2bbe4e6c0706",
"score": "0.0",
"text": "def test_mail(p,u)\n\t\temail = \"dane2522@gmail.com\"\n\t\t@purchase = p\n\t\t@user = u\n\n\t\tmail( to: email, subject: 'Welcome!' )\n\tend",
"title": ""
}
] | [
{
"docid": "763f2720fa01c511fabdceda3cacd99f",
"score": "0.7599281",
"text": "def sendall\n $emails = User.all.pluck(:email)\n end",
"title": ""
},
{
"docid": "32708872ca7d6374ff03c6958a6d4572",
"score": "0.7395127",
"text": "def notify_user\n @users = Users.all\n @article ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "85e0ccd3130fe88711bc19c341fc0acc",
"score": "0.0",
"text": "def set_quote\n @quote = Quote.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;... |
077fb1874c3d43368d49d364caa2cda3 | Generate a mock Omniauth response from Apple. | [
{
"docid": "4d25b22b8185835b51dc31eb49918190",
"score": "0.6131905",
"text": "def apple(name: nil, email: nil, uid: nil)\n uid ||= \"#{Number.number(digits: 6)}.#{Number.hexadecimal(digits: 32)}.#{Number.number(digits: 4)}\"\n auth = Omniauth.new(name: name, email: email)\n {\n ... | [
{
"docid": "dcf82155c85ae66dd7fd4471d27a8faf",
"score": "0.64426064",
"text": "def fake_google_oauth_response(**params)\n uid = params[:uid] || \"myUid\"\n email = params[:email] || \"myname@test.com\"\n image = params[:image] || \"my_image_url\"\n token = params[:token] || \"myToken\"\n ... |
847e0769fd732a1485ed04984e2646ea | POST /comment_prompts POST /comment_prompts.json | [
{
"docid": "acf538f71394cd1b008032f47a8c5f00",
"score": "0.69032043",
"text": "def create\n @comment_prompt = CommentPrompt.new(comment_prompt_params)\n\n respond_to do |format|\n if @comment_prompt.save\n format.html { redirect_to @comment_prompt, notice: 'Comment prompt was successfu... | [
{
"docid": "529ca09380461350e1158ab535fbdbf7",
"score": "0.6332964",
"text": "def create\n @promptlike = Promptlike.new(promptlike_params)\n\n if @promptlike.save\n render json: @promptlike\n else\n render json: @promptlike.errors, status: :unprocessable_entity\n end\n end",
"... |
09b17caf8ec593503e29a26aa7e56e24 | Twitter social sharing URL snippet built from | [
{
"docid": "e3fe43052129b9aa5d7724353d7d6507",
"score": "0.7414494",
"text": "def twitter_share_url(opts = {})\n page_url = opts.fetch(:url, request.original_url)\n message = opts.fetch(:message, '')\n\n page_url = CGI.escape(page_url)\n share_url = \"https://twitter.com/intent/tweet... | [
{
"docid": "dd604a62efc8ee932eda91cfb6eb1179",
"score": "0.7891984",
"text": "def tweet_share listing\n \"https://twitter.com/share?url=\" + get_url(listing) # https%3A%2F%2Fdev.twitter.com%2Fpages%2Ftweet-button\n end",
"title": ""
},
{
"docid": "e55757afcf02e076da22d1b0d7bbfcc5",
"... |
693318cc2aac8935aedbf77a12d909b9 | Renders data to output hash. | [
{
"docid": "ff9d90822b25ae256ad110b5a527e8f4",
"score": "0.0",
"text": "def output\n self.check!\n data = { \"name\" => @name.to_s }\n \n if not @type.nil?\n data[\"type\"] = __object_to_type.to_s\n ... | [
{
"docid": "2fa8aaaf4ba3e12ae4f574a911c10d13",
"score": "0.6856638",
"text": "def render(data)\n render_lines(data).join(\"\\n\") + \"\\n\"\n end",
"title": ""
},
{
"docid": "00695b0edc282c38d0864c23df87fc0a",
"score": "0.68199265",
"text": "def format_output(hash)\n r... |
81b080c7d2b501d1d92bc4cbf2e2a5c3 | handles the bulk deletion of courses, deleting year structures, groups and any logs which may reference this course | [
{
"docid": "1d2c20c99a7a73b150308fbc198b2d96",
"score": "0.76380724",
"text": "def bulk_delete\n course_ids_string = params[:ids]\n course_ids = eval(course_ids_string)\n\n course_ids.each do |id|\n course = Course.find(id.to_i)\n if !course.nil?\n course.year_s... | [
{
"docid": "269cc9d76f83f019161bf6693d37d7fa",
"score": "0.7498519",
"text": "def destroy\n @course = Course.find(params[:id])\n\n @course.year_structures.each do |year_structure|\n Group.where(year_structure_id: year_structure.id).destroy_all\n end\n YearStructure.where(cours... |
6a36535063c80cdfa19b6237ab64d2d8 | POST /checkbox_options POST /checkbox_options.json | [
{
"docid": "d72146e9c99c5e123bbe197324cbb8e0",
"score": "0.74174356",
"text": "def create\n @checkbox_option = CheckboxOption.new(params[:checkbox_option])\n\n respond_to do |format|\n if @checkbox_option.save\n format.html { redirect_to @checkbox_option, notice: 'Checkbox option was s... | [
{
"docid": "4660bc87f646fe5d784147a1f396fe38",
"score": "0.6330141",
"text": "def new\n @checkbox_option = CheckboxOption.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @checkbox_option }\n end\n end",
"title": ""
},
{
"docid": "d... |
5b95af201587c5587440100fa9babf32 | origin at top upper left | [
{
"docid": "6593a26bbbfc27bf70497465a4f476ed",
"score": "0.0",
"text": "def draw(screen)\n for i in (0 .. _SHAPE_NUM_ROWS - 1)\n for j in (0 .. _SHAPE_NUM_COLS - 1)\n if @shape[i][j] then\n _draw_block(screen, @row+i, @col+j, @color )\n end\n end\n end\n end",
... | [
{
"docid": "d7d3aaa5a3562517a598d9f3fd4dc32a",
"score": "0.7272964",
"text": "def topCenter\n CGPointMake(centerX, top)\n end",
"title": ""
},
{
"docid": "3049df46fb2ccc9e155134b31971ad7c",
"score": "0.72642595",
"text": "def top\n @center.y + @half_dimension\n end",
... |
eeb1502b8c742dbeb87fb172e93b3364 | In order to avoid blocking the reactor, specify `transient: true` as an option. | [
{
"docid": "68ac356eebd21510e43fc5bb6fb8c08b",
"score": "0.0",
"text": "def async(parent: Task.current, **options, &block)\n\t\t\t\tparent.async(**options) do |task|\n\t\t\t\t\tself.wait(task: task, &block)\n\t\t\t\tend\n\t\t\tend",
"title": ""
}
] | [
{
"docid": "902bf92b44735b658f0a9f76fc02ac6a",
"score": "0.7081731",
"text": "def transient\n @transient ||= true\n self\n end",
"title": ""
},
{
"docid": "825f7c6073dbf20ad39508250450d277",
"score": "0.65589",
"text": "def transient?; end",
"title": ""
},
{
"docid... |
880925ff0fcf3cbf4552568982bf8a2c | GET /imovels/1 GET /imovels/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "954f66988e37d2a21705a5745530bc83",
"score": "0.74943763",
"text": "def show\n @imovel = Imovel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @imovel }\n end\n end",
"title": ""
},
{
"docid": "6b90793e4a... |
6198e34e6b3f8cf3aa6944285501d388 | Get status of audit query execution | [
{
"docid": "ce786f507985b7b6aa67e324ac4806e0",
"score": "0.0",
"text": "def get_audits_query_transaction_id_with_http_info(transaction_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AuditApi.get_audits_query_transaction_id ...\"\n end\n... | [
{
"docid": "e101a3903369f195369a7f56a94a6788",
"score": "0.6743079",
"text": "def cmd_status()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "87f0d8579c2b55561519ea9bf060f6a5",
"score": "0.67123395",
"text": "def audit\n @limit = (params[... |
fd8bc44b1ba6943ff7e0ab424c5ffa91 | PATCH/PUT /issues/1 PATCH/PUT /issues/1.json | [
{
"docid": "f3601ee36b54549331eb5f2301277eda",
"score": "0.61820465",
"text": "def update\n error = \"\"\n @title = params[:title]\n respond_to do |format|\n if (!['Task', 'Bug','Enhancement','Proposal'].include? params[:category])\n error += \"Invalid on category. \"\n end\n ... | [
{
"docid": "3b17232e6a4d031c66f0dfcfc5591b23",
"score": "0.7040891",
"text": "def update \n # this where post is passed through to return update\n\n @issue = Issue.find(params[:id])\n @issue.update(issue_params) #(name: params[\"issue\"][\"description\"])\n @issue.save\n ... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "95d21339bf793c03f15cd1c84ffb6b38",
"score": "0.0",
"text": "def fpsignal_params\n params[:fpsignal].permit(:date, :msg_time, :type_signal, :technic, :description, :karaul)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6980384",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6782743",
"text": "def strong_params\n params.requi... |
50f9f185a7e0a4b735aeced6110bd841 | Calculates hash code according to all attributes. | [
{
"docid": "87b0f2e667622ae859f0baaab647f1e1",
"score": "0.0",
"text": "def hash\n [from_country_code, from_postal_code, from_city_locality, from_state_province, to_country_code, to_postal_code, to_city_locality, to_state_province, weight, dimensions, confirmation, address_residential_indicator, sh... | [
{
"docid": "08105588814074a5aed46dbb236c8d02",
"score": "0.791457",
"text": "def hash_code; Digest::SHA256.hexdigest(@attributes.values.join); end",
"title": ""
},
{
"docid": "706cbdb4c78e6b67e29589df0a4b1b5c",
"score": "0.73099273",
"text": "def attr_hash\n md5 = Digest::MD5.ne... |
368168dacbfa8c87fb61d827b1ebb91c | Lots of DSL extensions use these methods, so define them here so multiple classes can use them callseq: include_add include_add :child_getter Include a function to add to child list (optional argument) without need to ask for children include_add include_add :elements | [
{
"docid": "fd822bd94486ec56e590cbc797508710",
"score": "0.73518205",
"text": "def include_add(adder = :get_children)\n self.class_eval do\n define_method :add do |value|\n self.send(adder) << value\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "c2417ddcf2cb2c2c0d4188d1c0d4c98d",
"score": "0.6428462",
"text": "def add_child; end",
"title": ""
},
{
"docid": "4189278600fa8bc567b482907c5819df",
"score": "0.6371738",
"text": "def to_include\n children.map(&:build_include)\n end",
"title": ""
},
{
... |
cc8eac76bf447f2e2f79d0b1eda0885e | O(n) time, with O(n) memory initiation add the first element to a recursive call propagation keep recursing until the element is size 1 termination once we hit 0, the recursive calls return values to subsequent calls, which are added together this is a little beter because the array is not destructively recursed throug... | [
{
"docid": "60df1624935741bed3ad58327465aa8b",
"score": "0.0",
"text": "def sum_recv2(nums)\n return nums[0] if nums.size == 1\n [nums[0] + sum_rec(nums.drop(1))]\nend",
"title": ""
}
] | [
{
"docid": "1073e8289adfe76366dbc9785d8d3a5b",
"score": "0.77038985",
"text": "def sum_of_arrays_recursive(array)\n if array.length == 1\n array[0]\n else\n array.shift + sum_of_arrays_recursive(array)\n end\nend",
"title": ""
},
{
"docid": "cbd2e419020e2059490f8c291121dd3c",
"s... |
465910763baf4e073db573475b25a6c4 | POST /versions POST /versions.json | [
{
"docid": "035942abd7f7548f9c9ab8a2e411d9c6",
"score": "0.6810627",
"text": "def create\n @version = Version.new(params[:version])\n\n respond_to do |format|\n if @version.save\n format.html { redirect_to @version, notice: 'Version was successfully created.' }\n format.json { r... | [
{
"docid": "c871ddfb41b57af7a4c66a56fd9e81cb",
"score": "0.73328644",
"text": "def add_aos_version(args = {}) \n post(\"/aosversions.json/\", args)\nend",
"title": ""
},
{
"docid": "c16c8c3462019d3021f6164b8e570ef0",
"score": "0.6816405",
"text": "def create\n @version = Version.n... |
1c84390d2a400055ab70977217256997 | PATCH/PUT /people/1 PATCH/PUT /people/1.json | [
{
"docid": "62ac438a5aa658fdb816f27038f54c52",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment.dhokebaaz, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, ... | [
{
"docid": "fe34f93da0751ad55cc5052cfdd2366c",
"score": "0.7237493",
"text": "def update\n render json: Person.update(params[\"id\"], params[\"person\"])\n end",
"title": ""
},
{
"docid": "6ae6b17460ba8c07daf1a237b1b63696",
"score": "0.6948535",
"text": "def update\n \n ... |
9a190e5a45b0503a80f2c9806b575ca8 | (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). How do you find an element in the rotated array efficiently? | [
{
"docid": "8bd110a01e532f98a22ba2d255d06fb4",
"score": "0.0",
"text": "def solve(array, value)\n ##Find pivot, split arrays, then binary search both sub arrays.\n split_index = nil\n\n array.each_with_index do |element, index|\n split_index = (index - 1) if array[index] < array[index - 1]\n end\... | [
{
"docid": "092803b389c07df7fc7692cbf1a6af4b",
"score": "0.7869684",
"text": "def search_and_rotate_array(array, rotations, num)\n found_index = binary_search(array,num)\n\n return found_index if found_index < 0\n\n if found_index > (array.size - 1 - rotations)\n #It was on a portion rotated back ... |
a307386dc70b9f551dbcb7fb6dea81ab | Display the current state of the search in the echoarea. SEARCH_STRING contains the string that is being searched for, DIRECTION is zero for forward, or nonzero for reverse, WHERE is the history list number of the current line. If it is 1, then this line is the starting one. | [
{
"docid": "85dcb67632093b5dd28405331628f9ef",
"score": "0.6449862",
"text": "def rl_display_search(search_string, reverse_p, where)\r\n message = '('\r\n if (reverse_p)\r\n message << \"reverse-\"\r\n end\r\n message << \"i-search)`\"\r\n\r\n if (search_string)\r\n message << s... | [
{
"docid": "c57b6d55303e573f5654ed9689dccb9c",
"score": "0.5518255",
"text": "def noninc_dosearch(string, dir)\r\n if (string.nil? || string == '' || @noninc_history_pos < 0)\r\n rl_ding()\r\n return 0\r\n end\r\n\r\n pos = noninc_search_from_pos(string, @noninc_history_pos + dir, dir... |
ed706c44d1d4ba7c39ad8023356b85cd | Given 2 arrays, detect if they differ by exactly one item when compared positiontoposition. If so, return the remainder of the array. | [
{
"docid": "6f3ecb66027e86d481b6f91966a3f332",
"score": "0.66600883",
"text": "def has_one_diff(a, b)\n # Track whether we've already seen one diff.\n has_diff = false\n matched = []\n\n a.each_with_index do |i, idx|\n if b[idx] == i\n matched << i\n else\n # It's a diff. If we've al... | [
{
"docid": "7c49dc8b2a963feb5c2c24b564bda73b",
"score": "0.72953564",
"text": "def check_array(a, b)\n return (a[0] == b[0] || a[a.length-1] == b[b.length-1])\nend",
"title": ""
},
{
"docid": "662eeabcd6b451db78e591087bd913b5",
"score": "0.7195176",
"text": "def array_diff_with_co... |
16d84150051cf83a1b328bccb2ed296b | Begin processes the body, then returns an untyped sexp. | [
{
"docid": "ebe568b2be3d7a3ef6767ab44c4669d9",
"score": "0.64042723",
"text": "def process_begin(exp)\n body = process exp.shift\n # shouldn't be anything to unify\n return t(:begin, body)\n end",
"title": ""
}
] | [
{
"docid": "07d64bc213988ccb3287ceced446d8bf",
"score": "0.5978076",
"text": "def body_begin\n end",
"title": ""
},
{
"docid": "b1624351adee261b7fbec0c0ba16837a",
"score": "0.5963868",
"text": "def process_begin exp # :nodoc:\n _, *rest = exp\n\n code = rest.map { |sexp|\n ... |
97024ef4b530e6f3310cf294b7e47850 | Patch files on diff outputs used to be parsed as part of the diff adding invalid modificaction to the diff results. | [
{
"docid": "c6d4475ceb0aac3d552a4d8dfff2b4b1",
"score": "0.0",
"text": "def test_diff_patch\n d = @git.diff('diff_over_patches~2', 'diff_over_patches')\n assert_equal(1, d.count)\n end",
"title": ""
}
] | [
{
"docid": "d3baa4152e4aa45a060ed3e5932c5952",
"score": "0.6805818",
"text": "def apply diff_file, opts={}\n shell_opts = shellopts(opts)\n patchfile, _ = normalize_from diff_file\n /\\A(?:()|(.+)\\.)diff\\Z/ =~ diff_file or fail(\"patch needs .diff ext.\")\n basename = $1 ||... |
79bb72a2605af6540f2d11436ef9a2e4 | DELETE /authorized_vehicles/1 DELETE /authorized_vehicles/1.json | [
{
"docid": "579f1308c3119caf2b5e68e43c2cdc11",
"score": "0.8030015",
"text": "def destroy\n @authorized_vehicle.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "44ac00629c4fd2d9950bc061165c5260",
"score": "0.7694398",
"text": "def destroy\n @vehicle = current_user.vehicles.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n end\n end",
... |
69ac8e533c5946c188ab6d6c98e0cc6b | The form params for this model. | [
{
"docid": "3adb48078ae25660d719055ab92ebb0e",
"score": "0.0",
"text": "def model_params\n params.require(model_identifier).permit(permitted_attrs)\n end",
"title": ""
}
] | [
{
"docid": "a87fae0742e782ff1c71acf46f58818e",
"score": "0.85065216",
"text": "def form_params\n @params ||= {}\n end",
"title": ""
},
{
"docid": "d9c57d4d76a4ed4b3b57a04a1d8f5942",
"score": "0.76505446",
"text": "def form_params\n FormParamsController.instance\n end"... |
b3b986877779503dd5981453ea1797f3 | Get all active whitelist contract addresses Author: Aniket Date: 30/07/2018 Reviewed By: | [
{
"docid": "8ed8ebb3cfea8b4612140c876f7d53ed",
"score": "0.82255244",
"text": "def get_whitelist_contract_addresses\n r = success_with_data({contract_addresses: ClientWhitelistDetail.get_active_contract_addressess})\n render_api_response(r)\n end",
"title": ""
}
] | [
{
"docid": "43bf38d2d1f031287f92654e4401bb3a",
"score": "0.65147775",
"text": "def get_contract_addresses\n service_response = ClientManagement::GetContractAddresses.new(params).perform\n render_api_response(service_response)\n end",
"title": ""
},
{
"docid": "07c26ef25b23726f857e7615... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "7c5f03467ef0452902d135a3b3e6e962",
"score": "0.0",
"text": "def evaluation_params\n params.require(:evaluation).permit(:restaurant_id, :standards, :name, :message)\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... |
43f1b9d06009081572d4779cc565302e | Insert package information into package list | [
{
"docid": "6e10c999e8e7fcc9633f167da0659916",
"score": "0.6123684",
"text": "def inject_package(hash, info, package)\n arch = info[\"ARCH\"]\n arch = arch == \"all\" ? all_map : [arch]\n arch.map do |arch|\n package_file_name = File.join(\n package_roo... | [
{
"docid": "4a54c497c123deec82953b7247690136",
"score": "0.6933324",
"text": "def add(package)\n @packages << package\n end",
"title": ""
},
{
"docid": "8d8e95442fa6aef98db86ceed54ad243",
"score": "0.6751107",
"text": "def add(package)\n\t\t# package could be a ConstraintPack... |
c15c60ce0a443455933287c9c360a966 | Output should be the same. | [
{
"docid": "2771530773fa1efedfb762cc5fe7fe2a",
"score": "0.0",
"text": "def add_three(number)\n return number + 3\n number + 4\nend",
"title": ""
}
] | [
{
"docid": "784c435f8fc805781a2152d0f854d335",
"score": "0.6583353",
"text": "def identical?; end",
"title": ""
},
{
"docid": "784c435f8fc805781a2152d0f854d335",
"score": "0.6583353",
"text": "def identical?; end",
"title": ""
},
{
"docid": "2a62c53b07faa8b9613c4f26eaee32... |
d95cf3f2f8bff594448f0e8deb517cc6 | Load the role manifest, as a YAML document (not a Ruby object) | [
{
"docid": "3b8a30efb0c7ea6a14b1465df88e6488",
"score": "0.83767545",
"text": "def load_role_manifest\n path = File.join(File.dirname($0), MANIFEST_RELPATH)\n role_manifest = YAML.parse_file path\n fail \"Role manifest does not have a top level mapping\" unless role_manifest.children.first.is_a... | [
{
"docid": "46ed14d9d5ea131ce929a91bca709d0f",
"score": "0.657829",
"text": "def load_permissions_file\n begin\n permissions_file = YAML.load_file(role_permissions_file_path)\n # raise unless permissions_file && yaml_loaded_correctly(permissions_file)\n rescue\n raise \... |
78413248263d5d2c27b2ccb4fb807649 | Returns a hash of worker class name => mapped queue name | [
{
"docid": "7ba987d9485eb1ffe4445ce98f56888d",
"score": "0.811045",
"text": "def worker_queue_mappings\n workers\n .reject { |worker| worker.klass.is_a?(Gitlab::SidekiqConfig::DummyWorker) }\n .to_h { |worker| [worker.klass.to_s, ::Gitlab::SidekiqConfig::WorkerRouter.global.rout... | [
{
"docid": "2e0c42d84ed76435ef94baa700c20bca",
"score": "0.75922763",
"text": "def queue_names_routing_class(clazz); @worker.class; end",
"title": ""
},
{
"docid": "72c8d8edda8416bb4ce918482c2a7743",
"score": "0.75499266",
"text": "def current_worker_queue_mappings\n worker_qu... |
48c7100a899e8d91c325c15d133454e7 | returns the arc tangent of +z+ | [
{
"docid": "1446888c9505a3080c9d0041f62a694d",
"score": "0.67696047",
"text": "def atan(z)\n begin\n if z.real?\n\tatan!(z)\n else\n\t1.0.i * log((1.0.i + z) / (1.0.i - z)) / 2.0\n end\n rescue NoMethodError\n handle_no_method_error\n end\n end",
"title": ""
}
] | [
{
"docid": "f529412e30110405c03537c117fad600",
"score": "0.67514014",
"text": "def z\r\n s_radius*Math.cos(phi);\r\n end",
"title": ""
},
{
"docid": "d160b5e5e8ed6217023e6cbcf9cc05d6",
"score": "0.6699533",
"text": "def tan(z)\n begin\n if z.real?\n\ttan!(z)\n el... |
867c7b226eb6439d0b50b7352e0b078b | Fetch identifier and deserialize if neccessary | [
{
"docid": "9c3e241f6b5572a77059da17990630b0",
"score": "0.6559235",
"text": "def fetch_identifier(name)\n val = @encoded_ids[name]\n val = LiteCable.config.identifier_coder.decode(val) unless val.nil?\n instance_variable_set(\n :\"@#{name}\",\n val\n )\n ... | [
{
"docid": "b6e4430b0b42da6a95730bbf5ddb183b",
"score": "0.67227274",
"text": "def parse_id; end",
"title": ""
},
{
"docid": "b3e601189229762d5a19ac579b52fd5d",
"score": "0.6580767",
"text": "def id\n object.read_attribute_for_serialization(:id)\n end",
"title": ""
},
{
... |
d2845736792381d1b7a651e5fb519e58 | Fetch cache key Author: Puneet Date: 01/02/2018 Reviewed By: | [
{
"docid": "9fe7b67771dd47f1c72e0232b3b34494",
"score": "0.0",
"text": "def get_cache_key(id)\n memcache_key_object.key_template % @options.merge(id: id)\n end",
"title": ""
}
] | [
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "114e5e16a6505f019b3c89e4f4944569",
"score": "0.0",
"text": "def post_params\n\t\tparams.require(:post).permit(:user_id, :file, :file_name, :title, :content, :name, :alttext, :status, :live_date, :guid, :live_time)\n\tend",
"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... |
10937e83d4df729b66bee96e3247ef66 | Get Comparable Products Find comparable products to the given one. | [
{
"docid": "cbd746fb77213daab3d3fdfb1b614142",
"score": "0.6087802",
"text": "def get_comparable_products(upc, opts = {})\n data, _status_code, _headers = get_comparable_products_with_http_info(upc, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "c951abb7e47e0455964536b380a1cffe",
"score": "0.6275275",
"text": "def similar_products(product, opts={})\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "d33061cad457ead4a53df8f1e3909624",
"score": "0.6241972",
"text": "def most_similar_products\n ... |
a28e478681ac9d29c5dd796aa824781d | PATCH/PUT /users/1 PATCH/PUT /users/1.json | [
{
"docid": "2c0b5e3dfe96c3aa7c94ece7d5fc955b",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n ... | [
{
"docid": "f0686f191a0def3b6c3ad6edfbcf2f03",
"score": "0.7243734",
"text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n ... |
f29146348746a2abbd7e959b5c72c1c2 | Responds to `POST /messages/:id/resend`. | [
{
"docid": "709dbc64872956e124baa73112ee2aff",
"score": "0.7635157",
"text": "def resend\n @message.resend\n rescue => e\n flash['error'] = \"#{e}\"\n else\n toast!(title: \"Message resent\",\n message: \"Message ##{@message.id} has been resent.\")\n ensure\n redirect_back fal... | [
{
"docid": "3f23ec1304199f2362272b7b38a18136",
"score": "0.6809612",
"text": "def resend_email\n id = params[:data]\n @user = User.find(id)\n respond_to do |format|\n if @user.send_confirmation_instructions\n format.text { render text: \"Email has been sent out!\" }\n end\n ... |