query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Turn the laser on.
def poweron(s, level) sleep 0.1 s.puts "PD#{level.to_i()};" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_on!\n set_power!(:on)\n end", "def turn_on!\n @turned_off = false\n end", "def on\n set_power(\"on\", \"smooth\",1000)\n end", "def turn_on\n unless on?\n set_attribute('PIO', 1)\n end\n end", "def turnLightsOn\n @lightsOn = true\n end", "d...
[ "0.78723735", "0.72690636", "0.72562516", "0.7220248", "0.7147784", "0.70338345", "0.7019613", "0.7019613", "0.7018645", "0.674794", "0.669372", "0.66566706", "0.66304064", "0.6614719", "0.6609102", "0.6578995", "0.6560518", "0.6559495", "0.65556765", "0.6441324", "0.6380958"...
0.0
-1
Turn the laser off.
def poweroff(s) s.puts "PU;" sleep 0.1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_off!\n set_power!(:off)\n end", "def off\n set_power(\"off\", \"smooth\",1000)\n end", "def turn_off\n if on?\n set_attribute('PIO', 0)\n end\n end", "def off!\n digital_write(:off)\n end", "def off\n pwm(0x00)\n end", ...
[ "0.817978", "0.78873825", "0.7781805", "0.775137", "0.76754266", "0.74505645", "0.7345639", "0.71848834", "0.71063364", "0.7070433", "0.7056737", "0.7056737", "0.70225686", "0.7000528", "0.69766635", "0.6972869", "0.6902342", "0.6854884", "0.6839464", "0.6799477", "0.6766419"...
0.0
-1
Turn the laser off and move to the home position.
def reset(s) poweroff(s) sleep 0.1 s.puts "PA0,0;" sleep 0.1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_home_y\n Status.current.info_target_y = 0\n @ramps_arduino.execute_command('F12', true, false)\n end", "def move_home_all\n Status.current.info_target_x = 0\n Status.current.info_target_y = 0\n Status.current.info_target_z = 0\n @ramps_arduino.execute_command('G28', true, false)\n en...
[ "0.7273948", "0.72361946", "0.6981435", "0.6897743", "0.68718046", "0.6798611", "0.6797695", "0.67528224", "0.6722668", "0.64873034", "0.646098", "0.6366732", "0.6301108", "0.62930906", "0.62930906", "0.6265847", "0.6265847", "0.6217024", "0.6182673", "0.6182281", "0.61740154...
0.0
-1
The queue key for the current job.
def queue_key result = queue_name result = try(:arguments).presence && result.call if result.is_a?(Proc) result&.to_sym end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_key\n queue_name.is_a?(Proc) ? default_queue_key : queue_name.to_sym\n end", "def job_key; Thread.current[:job_key]; end", "def queue_key\n super || default_queue_key\n end", "def queue_key\n Digest::SHA256.hexdigest(queues.sort.join(\";\"))\n end", "def name\n @q...
[ "0.8245347", "0.80079013", "0.7911347", "0.7814429", "0.7099564", "0.7069018", "0.6980023", "0.69772154", "0.6972545", "0.687217", "0.6815009", "0.67796904", "0.675588", "0.6705698", "0.6683306", "0.66494", "0.66494", "0.6617404", "0.6596758", "0.65554523", "0.65554523", "0...
0.82294357
1
The defined priority for the current job.
def base_priority QUEUE_PRIORITY[queue_key] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def job_priority\n case params[:queue]\n when 'high'\n 0\n when 'medium'\n 1\n when 'low'\n 2\n end\n end", "def tomqueue_priority\n TomQueue::DelayedJob.priority_map.fetch(self.priority, nil).tap do |ret|\n if ret.nil?\n warn \"[tomqueue_prio...
[ "0.82517916", "0.7834388", "0.76081216", "0.7590644", "0.75882715", "0.74832827", "0.7482788", "0.7451751", "0.7437195", "0.7400504", "0.7377454", "0.7349391", "0.72775567", "0.7268673", "0.724871", "0.7236431", "0.7146225", "0.71127087", "0.7108068", "0.7095149", "0.7086549"...
0.7415321
9
The queue key for the current job.
def queue_key_for(val) if val.is_a?(Integer) QUEUE_PRIORITY.invert[val] else val.try(:queue_key) || val.try(:to_sym) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_key\n queue_name.is_a?(Proc) ? default_queue_key : queue_name.to_sym\n end", "def queue_key\n result = queue_name\n result = try(:arguments).presence && result.call if result.is_a?(Proc)\n result&.to_sym\n end", "def job_key; Thread.current[:job_key]; end", "def queue_key\n s...
[ "0.8245347", "0.82294357", "0.80079013", "0.7911347", "0.7814429", "0.7099564", "0.7069018", "0.6980023", "0.69772154", "0.6972545", "0.687217", "0.6815009", "0.67796904", "0.675588", "0.6705698", "0.66494", "0.66494", "0.6617404", "0.6596758", "0.65554523", "0.65554523", "...
0.6683306
15
The defined priority for the current job.
def priority_for(val) return val if val.nil? || val.is_a?(Integer) return QUEUE_PRIORITY[queue_key_for(val)] if val.respond_to?(:to_sym) result = val.try(:priority) result.is_a?(Integer) ? result : val.try(:base_priority) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def job_priority\n case params[:queue]\n when 'high'\n 0\n when 'medium'\n 1\n when 'low'\n 2\n end\n end", "def tomqueue_priority\n TomQueue::DelayedJob.priority_map.fetch(self.priority, nil).tap do |ret|\n if ret.nil?\n warn \"[tomqueue_prio...
[ "0.82521623", "0.7834638", "0.7606834", "0.7590522", "0.75881875", "0.74818105", "0.74813205", "0.745112", "0.7437638", "0.74161065", "0.74003357", "0.7377721", "0.73489267", "0.72779125", "0.72695315", "0.72486365", "0.72374314", "0.7146654", "0.7112559", "0.71079797", "0.70...
0.67897475
30
The queue key for the current job.
def queue_key queue_name.is_a?(Proc) ? default_queue_key : queue_name.to_sym end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_key\n result = queue_name\n result = try(:arguments).presence && result.call if result.is_a?(Proc)\n result&.to_sym\n end", "def job_key; Thread.current[:job_key]; end", "def queue_key\n super || default_queue_key\n end", "def queue_key\n Digest::SHA256.hexdigest(queues.sort....
[ "0.82294357", "0.80079013", "0.7911347", "0.7814429", "0.7099564", "0.7069018", "0.6980023", "0.69772154", "0.6972545", "0.687217", "0.6815009", "0.67796904", "0.675588", "0.6705698", "0.6683306", "0.66494", "0.66494", "0.6617404", "0.6596758", "0.65554523", "0.65554523", "...
0.8245347
0
The defined priority for the current job.
def base_priority priority.is_a?(Integer) ? priority : QUEUE_PRIORITY[queue_key] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def job_priority\n case params[:queue]\n when 'high'\n 0\n when 'medium'\n 1\n when 'low'\n 2\n end\n end", "def tomqueue_priority\n TomQueue::DelayedJob.priority_map.fetch(self.priority, nil).tap do |ret|\n if ret.nil?\n warn \"[tomqueue_prio...
[ "0.82517916", "0.7834388", "0.76081216", "0.7590644", "0.75882715", "0.74832827", "0.7482788", "0.7451751", "0.7437195", "0.7415321", "0.7400504", "0.7377454", "0.7349391", "0.7268673", "0.724871", "0.7236431", "0.7146225", "0.71127087", "0.7108068", "0.7095149", "0.7086549",...
0.72775567
13
The queue key for the current job.
def queue_key super || default_queue_key end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_key\n queue_name.is_a?(Proc) ? default_queue_key : queue_name.to_sym\n end", "def queue_key\n result = queue_name\n result = try(:arguments).presence && result.call if result.is_a?(Proc)\n result&.to_sym\n end", "def job_key; Thread.current[:job_key]; end", "def queue_key\n D...
[ "0.8245347", "0.82294357", "0.80079013", "0.7814429", "0.7099564", "0.7069018", "0.6980023", "0.69772154", "0.6972545", "0.687217", "0.6815009", "0.67796904", "0.675588", "0.6705698", "0.6683306", "0.66494", "0.66494", "0.6617404", "0.6596758", "0.65554523", "0.65554523", "...
0.7911347
3
The defined priority for the current job.
def base_priority super || default_priority end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def job_priority\n case params[:queue]\n when 'high'\n 0\n when 'medium'\n 1\n when 'low'\n 2\n end\n end", "def tomqueue_priority\n TomQueue::DelayedJob.priority_map.fetch(self.priority, nil).tap do |ret|\n if ret.nil?\n warn \"[tomqueue_prio...
[ "0.82521623", "0.7834638", "0.7606834", "0.7590522", "0.75881875", "0.74818105", "0.74813205", "0.745112", "0.7437638", "0.74161065", "0.74003357", "0.7377721", "0.73489267", "0.72779125", "0.72695315", "0.72486365", "0.72374314", "0.7146654", "0.71079797", "0.7094835", "0.70...
0.7112559
18
Display Info! Detailed Breakdown
def display_info_detailed(locations,products) puts "\n=======STORE INFO===========" puts "Store ID: #{@id}" puts "Store Name: #{@name}" puts "Description: #{@description}" puts "Location List: #{@location_list}" #Detailed Breakdown show_store_inventory(locations,products) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_info()\n\t\tputs \"ID: #{@@id}\"\n\t\tputs \"Name: #{@car_name}\"\n\t\tputs \"Make: #{@@make}\"\n\t\tputs \"Cost: #{calc_total_cost} INR\"\n\t\tputs\n\t\tputs \"Review: #{@review}\"\n\t\tputs \"Rating: #{@rating} stars\"\n\tend", "def show_details\n print @name.upcase + \": #{@name} has #{@moons} moo...
[ "0.72571075", "0.71926683", "0.71714056", "0.7076167", "0.7023041", "0.69782764", "0.69603586", "0.69359297", "0.6933057", "0.68958414", "0.68958414", "0.6860595", "0.68171036", "0.68012697", "0.6800802", "0.6785172", "0.678296", "0.6771695", "0.67420334", "0.6731833", "0.670...
0.63656354
66
Database: Show Store inventory all
def show_store_inventory(locations,products) #Loop through Stores Location Id List puts "====== STORE INVENTORY CHECK ========" ind = 0 for locid in @location_list prod_list = locations[ind][1].product_list prod_list.each do | product_id, quantity | pquery = Utils::product_name_query...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_inventory\n\t\t\treturn @player_data_db.execute( \"select * from inventory\" )\n\t\tend", "def index\n @inventory_items = InventoryItem.all\n end", "def index\n @item_inventories = ItemInventory.all\n end", "def index\n @store_items = StoreItem.all\n end", "def index\n @inventories ...
[ "0.7304259", "0.7247203", "0.7104132", "0.7103785", "0.70568705", "0.7018138", "0.6759642", "0.67306846", "0.6708917", "0.66990715", "0.66702956", "0.6646061", "0.6626393", "0.6614184", "0.66063845", "0.6604876", "0.6604876", "0.6604876", "0.6604876", "0.6604876", "0.6527912"...
0.7062746
4
Database: Show Store inventory One ITEM
def show_store_inventory_item(locations,products,itemid) #Loop through Stores Location Id List puts "====== STORE INVENTORY CHECK ===Id: #{itemid}=====" ind = 0 for locid in @location_list prod_list = locations[ind][1].product_list prod_list.each do | product_id, quantity | pquery = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_inventory\n\t\t\treturn @player_data_db.execute( \"select * from inventory\" )\n\t\tend", "def show\n @inventory = @npc.inventory\n @items = Item.all\n end", "def index\n @item_inventories = ItemInventory.all\n end", "def index\n @inventory_items = InventoryItem.all\n end", "d...
[ "0.75422496", "0.7084888", "0.6992276", "0.6963264", "0.6855918", "0.68423104", "0.67310774", "0.6659578", "0.66540205", "0.664093", "0.66171706", "0.66050774", "0.6598152", "0.65972394", "0.6589114", "0.657886", "0.65697855", "0.6561324", "0.6545927", "0.65309757", "0.652108...
0.7178286
1
Database: Transfer a Product from Location A to Location B
def transfer_product(qty,id,from_loc,to_loc) from_stock = from_loc.get_qauntity(id) to_stock = to_loc.get_qauntity(id) puts "Action: Transfer #{qty} Product Id: #{id}" puts "From Location: #{from_loc}, #{from_stock} IN Stock." puts " To Location: #{to_loc}, #{to_stock} IN Stock." #Check if tran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transfer(qty,prod,from,to)\n #Ensure from location has product in Stock\n if (get_product_qauntity(from.id) >= qty)\n #remove product from from Store\n rmv = from.remove_product(prod,qty)\n if rmv == 99\n puts \"REMOVED #{qty} ITEMS - (ID:#{prod.id}) from #{from.name}\"\n end\n...
[ "0.5527664", "0.54824317", "0.5434554", "0.5376446", "0.53747284", "0.527276", "0.52702326", "0.52683794", "0.52116555", "0.52036846", "0.5196714", "0.5133198", "0.5121667", "0.51202005", "0.51098764", "0.5083475", "0.50723493", "0.50561875", "0.5046245", "0.5041155", "0.5021...
0.63584995
0
Transfer a product from location to location
def transfer(qty,prod,from,to) #Ensure from location has product in Stock if (get_product_qauntity(from.id) >= qty) #remove product from from Store rmv = from.remove_product(prod,qty) if rmv == 99 puts "REMOVED #{qty} ITEMS - (ID:#{prod.id}) from #{from.name}" end to.add_pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transfer_product(qty,id,from_loc,to_loc)\n from_stock = from_loc.get_qauntity(id)\n to_stock = to_loc.get_qauntity(id)\n puts \"Action: Transfer #{qty} Product Id: #{id}\"\n puts \"From Location: #{from_loc}, #{from_stock} IN Stock.\"\n puts \" To Location: #{to_loc}, #{to_stock} IN Stock.\"\n ...
[ "0.73477334", "0.6025498", "0.5988341", "0.5962239", "0.5845906", "0.5710431", "0.5692126", "0.5620403", "0.55917263", "0.55582875", "0.5538543", "0.5526092", "0.55176383", "0.5493775", "0.5484336", "0.54805934", "0.5468601", "0.54674786", "0.5463084", "0.54504734", "0.541773...
0.652325
1
Setup new Reporter instance.
def initialize(repo, options) @repo = repo options[:type] ||= 'changelog' options[:format] ||= 'ansi' @options = OpenStruct.new(options) @options.level ||= 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_report\n end", "def setup \n @pdf_name = \"pdf name\"\n @options = { :pdf_layout => \"reports_layout.pdf.erb\", :pdf_template => \"reports/report.pdf.erb\", \n :render_options => {\n :header_right => 'Page [page] of [toPage]',\n :grayscale...
[ "0.63524985", "0.6288985", "0.62791026", "0.6123907", "0.609942", "0.60101587", "0.6000345", "0.6000345", "0.6000345", "0.6000345", "0.6000345", "0.595964", "0.5957561", "0.59171355", "0.58383405", "0.58383405", "0.58383405", "0.58170867", "0.5793275", "0.5790354", "0.5779242...
0.0
-1
Returns a Changelog object.
def changelog changes = options.point ? repo.changes : repo.change_points ChangeLog.new(changes).above(options.level) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def changelog\n @changelog ||= Changelog.new\n end", "def changelog\n @changelog ||= Generator.call(version: version)\n end", "def changelog\n @vcs.changelog\n end", "def changelog\n @changelog ||= SidekiqUniqueJobs::Changelog.new\n end", "def changelog\n return @...
[ "0.8418687", "0.7385198", "0.720851", "0.71352684", "0.71219474", "0.7061887", "0.6752557", "0.66456467", "0.6560978", "0.6439403", "0.64276695", "0.6421856", "0.6280263", "0.61835515", "0.6157608", "0.61288494", "0.6119019", "0.6115107", "0.61120003", "0.6045654", "0.6003282...
0.6938994
6
Compute and return set of releases for +changelog+ changes.
def releases repo.releases(changelog.changes) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_version\n %w(major minor patch).each do |level|\n changes = git_changelog.select(&\"#{level}?\".to_sym)\n return [ last_release.send(\"#{level}!\"), changes ] if changes.size > 0\n end\n raise \"No commit since last release (#{last_release})\"\n end", "def changelogs\n changelog....
[ "0.6653799", "0.6068743", "0.6053507", "0.6007831", "0.5994526", "0.59322715", "0.58808225", "0.5853433", "0.58035016", "0.57904553", "0.5786985", "0.57732004", "0.5770268", "0.5668218", "0.5653907", "0.56478786", "0.56385756", "0.56207705", "0.5606314", "0.5599552", "0.55756...
0.80712783
0
User as given by the command line or from the repo.
def user options.user || repo.user end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user \n @user ||= @repo.config.username\n end", "def user\n @user ||= @repo.config.username\n end", "def ssh_user(arg=nil)\n set_or_return(:ssh_user, arg, :kind_of => String)\n end", "def user(arg = nil)\n set_or_return(\n :user,\n arg,...
[ "0.7602103", "0.7502824", "0.712005", "0.70903623", "0.7025653", "0.69694483", "0.69694483", "0.696674", "0.6898209", "0.672331", "0.6648258", "0.66090626", "0.6586588", "0.6558621", "0.6554539", "0.65535766", "0.65535766", "0.6520802", "0.65118986", "0.64478606", "0.6436676"...
0.75131196
1
Email address as given on the command line or from the repo.
def email options.email || repo.email end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email\n `git config --get user.email`.strip.presence\n rescue\n nil\n end", "def email\n @email ||= ENV['EMAIL']\n end", "def guess_email\n @guessed_email ||= begin\n e = `git config user.email`.strip\n # TODO: Guess based on hg and other possibile tools\n...
[ "0.7563246", "0.7342405", "0.72675145", "0.71744657", "0.7045845", "0.6998972", "0.6990497", "0.69484824", "0.6876025", "0.6815264", "0.6798029", "0.67877066", "0.6756465", "0.6698773", "0.6685034", "0.6685034", "0.6685034", "0.6685034", "0.66526234", "0.66491365", "0.6624703...
0.81639427
0
TODO: Let the title be nil and the template can set a default if it needs to. Report title.
def title return options.title if options.title case type when :history "RELEASE HISTORY" else "CHANGELOG" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def title\n if @title.nil?\n BASE_TITLE\n else\n \"#{BASE_TITLE} | #{@title}\"\n end\n end", "def title\n raise \"Reports must define a title\"\n end", "def title\n base_title = \"Design Request Form\"\n if @title.nil? #Could also be spelt as @title == 0\n base_title\n els...
[ "0.7606697", "0.75861335", "0.7446439", "0.74129057", "0.7405056", "0.7385655", "0.73587567", "0.7350971", "0.7350971", "0.7332065", "0.73294604", "0.7319506", "0.7317233", "0.7310349", "0.7310349", "0.7310349", "0.7292792", "0.7282419", "0.72821456", "0.7275942", "0.72720444...
0.0
-1
NOTE: ERBs trim_mode is broken it removes an extra space. So we can't use it for plain text templates. Print report.
def print require_formatter(format) tmpl_glob = File.join(DIR, 'templates', "#{type}.#{format}.{erb,rb}") tmpl_file = Dir[tmpl_glob].first raise "could not find template -- #{type}.#{format}" unless tmpl_file tmpl = File.read(tmpl_file) case File.extname(tmpl_file) when '.r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tpl_text; ''; end", "def tpl_text; ''; end", "def tpl_text; ''; end", "def to_pdf\n indent = @lines.first.match(/\\$\\s*/)[0].length\n source = @lines.map{|line| escape_xml(line[indent..-1])}.join(\"\\n\")\n \"<table width='100%' border='0' cellpadding='10'><tr>\"+\n \"<td b...
[ "0.5941327", "0.5941327", "0.5941327", "0.56931376", "0.5657469", "0.5568912", "0.5560355", "0.5519229", "0.548593", "0.5451984", "0.5403145", "0.5386209", "0.53743476", "0.53191006", "0.5305661", "0.5304173", "0.52974737", "0.52550226", "0.5253734", "0.5228717", "0.5224692",...
0.0
-1
Depending on the format special libraries may by required.
def require_formatter(format) case format.to_s when 'yaml' require 'yaml' when 'json' require 'json' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def formats; end", "def formats; end", "def _process_format(format); end", "def _process_format(format); end", "def _process_format(format) # :nodoc:\n end", "def _wrapper_formats; end", "def formatters; end", "def format; end", "def format; end", "def format; end", "def format; end", "def...
[ "0.7686481", "0.7686481", "0.7505853", "0.7505853", "0.6880165", "0.6803496", "0.67009604", "0.6649299", "0.6649299", "0.6649299", "0.6649299", "0.6649299", "0.6649299", "0.6649299", "0.6649299", "0.64457893", "0.6436499", "0.6436499", "0.6436499", "0.6420135", "0.6355905", ...
0.6307829
23
Convert from RDoc to HTML.
def r(input) rdoc.convert(input) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rdoc(input)\n markup = RDoc::Markup::ToHtml.new\n markup.convert(input)\n end", "def trans_html\n @doc.to_html\n end", "def html\n @doc.to_s\n end", "def html\n @doc.to_s\n end", "def html_markup_rdoc(text); end", "def to_html\n require 'mustache'\n template = F...
[ "0.7619031", "0.7481833", "0.7221223", "0.7221223", "0.69725424", "0.66919297", "0.66863513", "0.66462886", "0.66142046", "0.6603884", "0.65644777", "0.6529012", "0.6510496", "0.6447693", "0.6444593", "0.6444435", "0.64264363", "0.6397578", "0.6364602", "0.6300732", "0.629353...
0.5923029
60
Creates a new Path which you can push points on to to make up lines or polygons The following options are available, for more information see the Google API documentation[ :weight:: The weight is the thickness of the line, defaults to 5 :color:: The color of the border can either be a textual representation like red, g...
def initialize(*args) @points = [] @encode_points = true extract_options!(args) add_points(args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def polyline points, options, &block\n \n # build a line\n line = Line.new options[:name]\n \n # build up a points float buffer\n pbuf = BufferUtils.createVector3Buffer(points.length / 2)\n puts \"arrived\"\n c = 0\n points.each do |v|\n pbuf.put v\n c += ...
[ "0.634495", "0.6173413", "0.5852804", "0.5828649", "0.56803036", "0.56417996", "0.5597151", "0.5571372", "0.55656546", "0.55583996", "0.55236655", "0.5519992", "0.5451321", "0.54147923", "0.5401716", "0.5382378", "0.53066814", "0.529787", "0.5285473", "0.52424103", "0.5197804...
0.51961493
21
Returns a string representation of this Path Used by the Map when building the URL
def url_params # :nodoc: raise BuildDataMissing, "Need at least 2 points to create a path!" unless can_build? out = 'path=' path_params = OPTIONAL_OPTIONS.inject([]) do |path_params, attribute| value = send(attribute) path_params << "#{attribute}:#{URI::DEFAULT_PARSER.escape(value.to_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n @path\n end", "def to_s\n @path\n end", "def to_s\n @path\n end", "def to_s\n @path\n end", "def to_s\n @path\n end", "def to_s\n return \"\" if self.empty?\n @path.join(\":\")\n end", "def to_s\n @path.dup\n end", "def to_s\n ...
[ "0.8267489", "0.82625705", "0.82180566", "0.8157681", "0.8157681", "0.8149418", "0.8093498", "0.799988", "0.79515195", "0.7730423", "0.7676068", "0.7553574", "0.74701", "0.74306256", "0.73189163", "0.7272059", "0.7264132", "0.7245325", "0.72367966", "0.7201048", "0.71766484",...
0.65776944
70
Sets the points of this Path. WARNING Using this method will clear out any points which might be set.
def points=(array) raise ArgumentError unless array.is_a? Array @points = [] array.each {|point| self << point} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def points=(points)\n @points = []\n points.each do |point|\n @points.push(x: point[0], y: point[1])\n end\n end", "def set_points!(points, color)\n\t\tpoints.each do |point|\n\t\t\tset_point!(point, color)\n\t\tend\n\tend", "def setpoint\n @setpoint\n end", "de...
[ "0.73445565", "0.69860506", "0.6912523", "0.68848294", "0.67970544", "0.66447866", "0.6554979", "0.6297759", "0.61934066", "0.6175432", "0.6104002", "0.6103535", "0.6004716", "0.6004716", "0.5972594", "0.59493876", "0.5904887", "0.5900442", "0.5900442", "0.5900442", "0.590044...
0.6411286
7
Pushes a new point into the Path A point might be a Hash which has lng and lat as keys, or an object responding to lng and lat. Any points pushed in will be converted internally to a Location object.
def <<(point) @points << ensure_point_is_location_object(point) @points.uniq! self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_point point\n add_to_point! point.dup\n end", "def add_to_point! point\n vec = as_bearing_vector\n dest = point.destination_point vec.bearing, vec.distance.in_kms\n point.lat = dest.lat\n point.lng = dest.lng\n point\n end", "def add(point)\r\n new_point = Marshal.load(Marshal...
[ "0.7044723", "0.67816305", "0.6657951", "0.6631794", "0.64761114", "0.64717", "0.6304117", "0.6216563", "0.6196978", "0.6190889", "0.61431813", "0.61110204", "0.6104584", "0.60723954", "0.6066475", "0.6058575", "0.5992389", "0.59864616", "0.5966133", "0.5959797", "0.59479666"...
0.71596646
0
Will answer the question if we are encoding the points or not when building the image URL.
def encoding_points? return !!@encode_points end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url_to_image(source, options = T.unsafe(nil)); end", "def coupen_img_url\n coupen_img = self.coupen_image.url(:original).split('?')[0]\n coupen_img.include?('missing') ? '' : coupen_img\n end", "def create_encodings(points, dists)\r\n plat = 0\r\n plng = 0\r\n encoded_points = \"\"\r\n ...
[ "0.61213857", "0.59523547", "0.58090615", "0.57348466", "0.5695361", "0.5666142", "0.5597609", "0.559682", "0.5578907", "0.5555803", "0.5519133", "0.5501655", "0.54959345", "0.5354914", "0.5351229", "0.5342698", "0.5338532", "0.5337798", "0.5334046", "0.5317025", "0.53156114"...
0.6080776
1
Extracts the lng and lat values from incomming point and creates a new Location object from it.
def ensure_point_is_location_object(point) return point if point.instance_of? Location Location.new(point) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_and_save_latlng\n\t\tlatlng = get_latlng\n\t\tcreate_coordinate(lat: latlng[0], lng: latlng[1])\n\tend", "def set_lat_lng_from_location\n lat_lng = Geokit::LatLng.normalize(self.location)\n if lat_lng\n self.lat = lat_lng.lat\n self.lng = lat_lng.lng\n else\n self.lat, self.lng = ...
[ "0.69643116", "0.6752265", "0.67385423", "0.6649292", "0.65756524", "0.65683043", "0.6482274", "0.6370212", "0.6345875", "0.62439626", "0.6208492", "0.6188147", "0.6183095", "0.61525655", "0.6151155", "0.61509454", "0.61509454", "0.6091144", "0.6085985", "0.6054448", "0.60486...
0.60639113
19
Do we have enough points to build a path?
def can_build? length > 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def completed_path?\n path.size == nodes.size - 1\n end", "def shorter_path_exist?(yx, steps, keys_to_go, visited)\n steps >= (visited[[yx, keys_to_go]] || Float::INFINITY)\n end", "def paths?\n !paths.empty?\n end", "def valid_path? unit, path\n path.inject(@units[unit].location) do |p,c|\n ...
[ "0.7553973", "0.70644444", "0.68946385", "0.6892882", "0.6887223", "0.6778973", "0.67520636", "0.6694619", "0.66369456", "0.6632126", "0.6586574", "0.65647453", "0.6560612", "0.65604615", "0.65436924", "0.6543351", "0.6525525", "0.651671", "0.65104204", "0.64359754", "0.64347...
0.0
-1
sending the fax with the fax_record id
def send_now(fax_id) fax_record = FaxRecord.includes(:attachments).find(fax_id) attachments_keys= fax_record.attachments.pluck(:file_key) attachments, file_dir= WebServices::Web.file_path(attachments_keys, fax_id) if (attachments.empty?) || (attachments.size != attachments_keys.size) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_fax(options = {})\n params = options.merge(to: @fax_number, string_data: 'test')\n @send_fax_response = Phaxio.send_fax(params)\n sleep(5)\n end", "def send_fax()\n begin\n bodyParams = {\n to: [{ phoneNumber: RECIPIENT }],\n # To send fax to multiple recipients, add more 'phoneN...
[ "0.65828794", "0.65510774", "0.6377392", "0.6372889", "0.61312217", "0.6122938", "0.5956708", "0.5900031", "0.57272357", "0.5718655", "0.5668722", "0.5645997", "0.5623616", "0.5610758", "0.55838376", "0.55149186", "0.5509419", "0.5428279", "0.542767", "0.5403141", "0.530911",...
0.58218443
8
Getting the File Name , the File Extension and validate the document type
def file_specification(file_path) file_name = File.basename ("#{file_path}").downcase file_extension = File.extname (file_name).downcase accepted_extensions = [".tif", ".xls", ".doc", ".pdf", ".docx", ".txt", ".rtf", ".xlsx", ".ppt", ".odt", ".ods", ".odp", ".bmp", ".gif", ".jpg", ".png"] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def document_type\n FileUtility.get_file_type(@file_name)\n end", "def file_extension; end", "def file_extension; end", "def file_extension; end", "def file_type file_name \n\t\tFile.extname( file_name ).gsub /^\\./, '' \n\tend", "def file_type(file_name)\n @file_class.extname(file_name).gsub( /^\...
[ "0.7422672", "0.7414443", "0.7414443", "0.7414443", "0.73473346", "0.7341546", "0.72471493", "0.72044814", "0.7040596", "0.7017871", "0.700003", "0.6902103", "0.68739486", "0.6873495", "0.68680215", "0.6835212", "0.6835212", "0.6835212", "0.6835212", "0.67871094", "0.67667127...
0.68411803
15
search and find all faxes without Queue_id (not sent yet) and send them by call from the initializer (when the server start)
def sending_faxes_without_queue_id FaxRecord.without_queue_id.each do |fax| begin fax.update_attributes( updated_by_initializer: true ) FaxServices::Fax.send_now(fax.id) rescue HelperMethods::Logger.app_logger('error', "sending_faxes_without_queue_id: Erro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refill_all_queues!\n # Dla POST musi byc jakies 'body' requestu, bo serwery czesto rzucaja wyjatkami (WEBrick w szczegolnosci).\n post '/queues/refill_all', :body => ' '\n true\n end", "def queues\n\t\t\t@queues ||= {}\n\t\tend", "def find_all(name)\n if name and no...
[ "0.6294488", "0.6216115", "0.62154233", "0.61374766", "0.61284614", "0.6067819", "0.60488456", "0.6033038", "0.58792114", "0.5875406", "0.58708984", "0.58698565", "0.58695006", "0.5848", "0.582308", "0.5822772", "0.5785077", "0.57828885", "0.5765535", "0.5745039", "0.57441604...
0.70489246
0
Getting the response for certain fax defained by the SendFaxQueueId
def fax_response(fax_requests_queue_id) begin response = send_fax_status(fax_requests_queue_id) if response["RecipientFaxStatusItems"].present? fax_record = FaxRecord.find_by_send_fax_queue_id(fax_requests_queue_id) parse_response = response["RecipientFaxStatusItems"]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_fax_status(fax_requests_queue_id)\n begin\n conn = Faraday.new(url: FAX_SERVER_URL, ssl: { ca_file: 'C:/Ruby200/cacert.pem' }) do |faraday|\n faraday.request :url_encoded\n faraday.response :logger\n faraday.adapter Faraday.default_adapter\n end\n...
[ "0.7453824", "0.61211705", "0.60189295", "0.60067755", "0.5951487", "0.5875095", "0.585303", "0.57708", "0.56292355", "0.56272495", "0.5576989", "0.55645037", "0.5557839", "0.54947186", "0.5424613", "0.52747077", "0.52651983", "0.5232761", "0.5188379", "0.51675", "0.51496667"...
0.7798586
0
Sending the Fax_Queue_Id to get the status
def send_fax_status(fax_requests_queue_id) begin conn = Faraday.new(url: FAX_SERVER_URL, ssl: { ca_file: 'C:/Ruby200/cacert.pem' }) do |faraday| faraday.request :url_encoded faraday.response :logger faraday.adapter Faraday.default_adapter end to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queue_id_status(queue_id)\n response = @api.GetQueueIDStatus({\n :QueueID => queue_id,\n :LicenseKey => @license_key })\n result = response.getQueueIDStatusResult\n\n {\t:response_code \t\t\t=> result.responseCode,\n :response_text\t\t\t=> result.responseText...
[ "0.72435486", "0.7099141", "0.70891225", "0.701766", "0.6773588", "0.6722114", "0.6675424", "0.661223", "0.6206114", "0.6099575", "0.60905486", "0.60824174", "0.6069733", "0.59853154", "0.5947672", "0.5891181", "0.5871262", "0.5847784", "0.5844234", "0.58419555", "0.5832185",...
0.7388213
0
before_action :require_user, only: [:new]
def index #@uploads = Upload.where(save_upload: true).order("id DESC") @uploads = Upload.search(params[:search], params[:zip]).paginate(page: params[:page], per_page: 9).where(save_upload: true).order("id DESC") @tags = Tag.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def require_user\n end", "def edit\n require_user\n end", "def new_user\n \n end", "def new_user\n \trender action: 'new_user'\n end", "def new\n @user = User.new\n authorize! :create, @user\n end", "def newUser\n end", "def new\n #user wants to log in \n end", "def new\n #u...
[ "0.766078", "0.737044", "0.7346623", "0.7298778", "0.7275226", "0.71353376", "0.71341693", "0.71341693", "0.7124276", "0.7092801", "0.7092801", "0.70550835", "0.70550835", "0.70478225", "0.69886", "0.69377613", "0.6897854", "0.6841849", "0.68226045", "0.6821275", "0.68199015"...
0.0
-1
Creates a new instance params: meeting to import data params: json importer dao with parsed data
def initialize( importer_hash ) @importer_hash = importer_hash #@meeting = @importer_hash.meeting @logger = ConsoleLogger.new raise ArgumentError.new("A valid JsonImporterDAO importer hash must be provided!") unless importer_hash.instance_of?( JsonImporterDAO ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def import!(inst, data)\r\n # The data being populated must be a hash\r\n return if data.nil?\r\n raise \"Data must be an object.\" if !data.is_a?(Hash)\r\n\r\n # Perform the import operations on all requested elements\r\n setters = get_setters!\r\n data.each do |key, val|\r\n ...
[ "0.6256007", "0.61598736", "0.61212033", "0.61048657", "0.6099955", "0.5989636", "0.59330404", "0.59041446", "0.5871512", "0.5865396", "0.5849158", "0.58429456", "0.5826088", "0.5825333", "0.58243006", "0.5812052", "0.5805197", "0.5785819", "0.5777645", "0.5772741", "0.576906...
0.64489263
0
Gets the season of the meeting
def season @season ||= Season.find(@importer_hash.meeting.season_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def season\n season_id.nil? ? nil : organization_membership.seasons.find(season_id)\n end", "def season_number\n @ole.SeasonNumber\n end", "def season\n number = ((self.day - 1) / 30) % 4\n case number\n when 0\n return \"spring\"\n when 1\n return \"summer\"\n when 2\n ...
[ "0.8062807", "0.7865464", "0.7864482", "0.75139153", "0.74704355", "0.7387357", "0.7279917", "0.72556317", "0.72125465", "0.7164688", "0.6978286", "0.6971657", "0.68128264", "0.674042", "0.65982145", "0.6586906", "0.65828127", "0.6569948", "0.6547435", "0.653727", "0.6537132"...
0.8312108
0
Memoized getter for seasonal TeamAffiliation instances.
def season_affiliations @season_affiliations ||= TeamAffiliation.where( season_id: season.id ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_team_affiliation_id_from_team_managers_for(season_id)\n return nil if team_managers.nil?\n\n team_manager = team_managers.includes(:team_affiliation).joins(:team_affiliation)\n .select { |tm| tm.team_affiliation.season_id == season_id }.first\n team_manager ? team_m...
[ "0.5664113", "0.558981", "0.55595016", "0.55466586", "0.554387", "0.5473948", "0.54690266", "0.5409288", "0.527812", "0.5193332", "0.5145132", "0.51432496", "0.5131884", "0.5108334", "0.5058095", "0.5005738", "0.49787349", "0.49590924", "0.49561906", "0.4941772", "0.4927486",...
0.6805202
0
Memoized getter for seasonal TeamAffiliation instances.
def all_affiliations @all_affiliations ||= TeamAffiliation.joins(:season).where( "seasons.season_type_id = #{season.season_type_id}" ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def season_affiliations\n @season_affiliations ||= TeamAffiliation.where( season_id: season.id )\n end", "def find_team_affiliation_id_from_team_managers_for(season_id)\n return nil if team_managers.nil?\n\n team_manager = team_managers.includes(:team_affiliation).joins(:team_affiliation)\n ...
[ "0.68041027", "0.5664196", "0.5558085", "0.554586", "0.55450296", "0.5474492", "0.5467936", "0.5407675", "0.52770764", "0.5191768", "0.51440173", "0.5143732", "0.5131906", "0.5109206", "0.5057951", "0.5005517", "0.497928", "0.49583945", "0.49555477", "0.4944454", "0.4928315",...
0.55893147
2
Returns the internal FuzzyStringMatcher dedicated to scanning season TeamAffiliation instances.
def season_affiliation_matcher @season_affiliations_matcher ||= FuzzyStringMatcher.new( season_affiliations, :get_true_name ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def team_matcher\n @teams_matcher ||= FuzzyStringMatcher.new( all_teams, :name )\n end", "def affiliation_matcher\n @affiliations_matcher ||= FuzzyStringMatcher.new( all_affiliations, :name )\n end", "def analyze( matching_string, desired_season_id, analysis_text_log, sql_text_log,\n star...
[ "0.7564946", "0.6419347", "0.5905946", "0.562817", "0.5549304", "0.5400885", "0.51829123", "0.5154282", "0.5103637", "0.5082984", "0.5070076", "0.5044426", "0.49993333", "0.4966377", "0.49647042", "0.49647042", "0.49539202", "0.49539202", "0.49277544", "0.4894497", "0.4894497...
0.83068097
0
Returns the internal FuzzyStringMatcher dedicated to scanning all season types TeamAffiliation instances. def all_affiliation_matcher
def validate_team_affiliation( team_importer_DAO, min_bias_score = FuzzyStringMatcher::BIAS_SCORE_MAX ) validate = false name_to_validate = get_true(team_importer_DAO.name) logger.info( "Team validation in season for #{team_importer_DAO.name} (name_to_validate)" ) # Step 1.1 - Validate within seasonal ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def affiliation_matcher\n @affiliations_matcher ||= FuzzyStringMatcher.new( all_affiliations, :name )\n end", "def season_affiliation_matcher\n @season_affiliations_matcher ||= FuzzyStringMatcher.new( season_affiliations, :get_true_name )\n end", "def team_matcher\n @teams_matcher ||= FuzzyStringMat...
[ "0.813232", "0.7893341", "0.6991949", "0.599974", "0.5642352", "0.56002134", "0.5566147", "0.54963535", "0.5366222", "0.535323", "0.532238", "0.52921414", "0.52900136", "0.5287055", "0.52172446", "0.51982117", "0.51982117", "0.5197501", "0.5179291", "0.5135731", "0.51066965",...
0.55336046
7
Better not consider non significant chars in name comparison_string Non significant chars are the principal cauise of missing matches eg: FuzzyStringMatcher considers "CSI Nuoto Ober Ferrari" different from "CSINuoto OberFerrari"
def get_true( string, non_significants = /[\s',\.\-\_]/ ) string.gsub(non_significants, '').upcase end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def similar(string1, string2)\n string1 = string1.downcase\n string2 = string2.downcase\n\nend", "def similar_name(other_norm_name)\n (normalized_name.start_with?(other_norm_name) || other_norm_name.start_with?(normalized_name))\n end", "def similar?(a, b) # rubocop:disable Naming/UncommunicativeMe...
[ "0.64220196", "0.6358211", "0.6138631", "0.61358297", "0.6124022", "0.6099349", "0.6044968", "0.6023069", "0.60068685", "0.5976966", "0.5922749", "0.58834887", "0.5834052", "0.5801475", "0.57842034", "0.57780457", "0.5773212", "0.57425123", "0.57409155", "0.57054394", "0.5703...
0.6012164
8
=begin Input: N/A (No Arguments) Output: Printing the tip and total amount of the bill Rules/Requirements: The program should prompt for: A bill amount Tip Rate Compute the tip Display Tip Total amount of the bill Data Structure: Floats Strings Algorithm: Prompt the user to input bill amount Prompt the user to input th...
def tip_calculator() print 'What is the bill? ' bill = gets.chomp bill = bill.to_f print 'What is the tip percentage? ' percentage = gets.chomp percentage = percentage.to_f tip = (bill * (percentage / 100)).round(2) total = (bill + tip).round(2) puts "The tip is $#{tip}" puts "The total is $#{t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tip_calc\n puts \"=> What is the bill?\"\n bill = gets.chomp\n\n puts \"=> What is the tip percentage?\"\n tip_rate = gets.chomp\n\n tip = (tip_rate.to_f/100) * bill.to_f\n total = bill.to_f + tip.to_f\n\n puts \"The tip is $#{tip}\"\n puts \"The total is $#{total}\"\nend", "def tip\n puts \"What's ...
[ "0.7904009", "0.78780574", "0.7828661", "0.7828255", "0.77971673", "0.7751452", "0.70933527", "0.68898225", "0.66556704", "0.6590958", "0.65731555", "0.6531118", "0.6503822", "0.6468953", "0.643765", "0.63903046", "0.6339771", "0.63359654", "0.6311301", "0.63001835", "0.62590...
0.7542308
6
go online and check if the name exist in league of legend
def name_should_exist agent = Mechanize.new { |agent| agent.user_agent_alias = "Windows Chrome" } searchPage = agent.get('http://www.lolking.net/') #search for player with the user name keyword searchBox = searchPage.forms.first searchBox['name'] = name resultPage = searchBox.submit resultBody = resultPage.b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def league_exists?(league_name)\n database do |db|\n league = db.get_first_value 'SELECT * FROM League\n WHERE LeagueName = :league_name',\n league_name\n\n return !league.nil?\n end\nend", "def lookup_name(api_key, name)\n url = \"https://n...
[ "0.633805", "0.6261802", "0.6250866", "0.6154772", "0.60996705", "0.5889507", "0.577738", "0.5769136", "0.5768608", "0.5767526", "0.5764127", "0.57472885", "0.572876", "0.57144773", "0.5713864", "0.57135504", "0.5703061", "0.5690272", "0.56748796", "0.5624431", "0.561719", ...
0.70981216
0
Only fails when card_expirations :id => false
def test_association_create_creates_one_association today = Date.today account = Account.create! card_expiration = account.card_expirations.create!( :payment_method_token => "abcdefg", :expiration_date => today ) assert_equal [card_expiration], account.card_expirations end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assigned_to_card?\n self.card_id != 0\n end", "def card\n false\n end", "def cards_validation\n if cards.any?(&:invalid?)\n errors[:base] << 'Wallet has an invalid card'\n end\n end", "def invalid_card(card_error: T.unsafe(nil)); end", "def set_excuse_card\n @excuse_card = Excu...
[ "0.63827413", "0.63680077", "0.632248", "0.6217754", "0.6199808", "0.6076985", "0.5947188", "0.59355146", "0.5923463", "0.58613926", "0.5854912", "0.5839878", "0.5829569", "0.57987875", "0.57708627", "0.571184", "0.57114476", "0.57040155", "0.5694091", "0.56841", "0.5674347",...
0.0
-1
GET /otg_clients GET /otg_clients.json
def index @otg_clients = OtgClient.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @clients = current_user.clients\n render json: @clients\n end", "def list_clients(json_payload={})\n conn = @client.get do |req|\n req.url \"/api/v2/client/list?\"\n req.headers[\"Authorization\"] = @token\n req.params = json_payload\n end\n conn...
[ "0.74873054", "0.73241895", "0.7273122", "0.7273122", "0.71648777", "0.7154939", "0.7125562", "0.70630646", "0.6957678", "0.69117355", "0.68706834", "0.6861293", "0.6839849", "0.6839849", "0.6839849", "0.6839849", "0.6839849", "0.6839849", "0.6839849", "0.6839849", "0.6832753...
0.73905903
1
GET /otg_clients/1 GET /otg_clients/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @clients = current_user.clients\n render json: @clients\n end", "def index\n @clients = Client.all\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end", "def index\n @otg_clients = OtgCl...
[ "0.73321986", "0.72739977", "0.7061908", "0.70386785", "0.6977035", "0.69520307", "0.6945623", "0.6936899", "0.6936899", "0.6847819", "0.68232465", "0.6734252", "0.6693787", "0.66733086", "0.66652954", "0.66652954", "0.66652954", "0.66652954", "0.66652954", "0.66652954", "0.6...
0.0
-1
POST /otg_clients POST /otg_clients.json
def create @otg_client = OtgClient.new(otg_client_params) respond_to do |format| if @otg_client.save format.html { redirect_to @otg_client, notice: 'Otg client was successfully created.' } format.json { render :show, status: :created, location: @otg_client } else format.html...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client_create(global_options, options)\n result = Excon.post(\n \"#{global_options[:fenton_server_url]}/clients.json\",\n body: client_json(options),\n headers: { 'Content-Type' => 'application/json' }\n )\n\n [result.status, JSON.parse(result.body)]\n end", "def create...
[ "0.66284436", "0.64377934", "0.63193256", "0.6317665", "0.63148963", "0.62746274", "0.62328506", "0.62138623", "0.6168027", "0.6120012", "0.6107235", "0.6103514", "0.6102582", "0.6077851", "0.60562867", "0.6038447", "0.6038336", "0.6038336", "0.6038336", "0.6037966", "0.60352...
0.6896497
0
PATCH/PUT /otg_clients/1 PATCH/PUT /otg_clients/1.json
def update respond_to do |format| if @otg_client.update(otg_client_params) format.html { redirect_to @otg_client, notice: 'Otg client was successfully updated.' } format.json { render :show, status: :ok, location: @otg_client } else format.html { render :edit } format.jso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-m...
[ "0.6944453", "0.6932984", "0.6730528", "0.654765", "0.65417737", "0.6526488", "0.64904284", "0.6488939", "0.6488939", "0.6474639", "0.6453094", "0.6419595", "0.64160675", "0.64160675", "0.640502", "0.64019144", "0.64015967", "0.6397045", "0.6361152", "0.6345307", "0.6339644",...
0.6855846
2
DELETE /otg_clients/1 DELETE /otg_clients/1.json
def destroy @otg_client.destroy respond_to do |format| format.html { redirect_to otg_clients_url, notice: 'Otg client was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n chef_rest_v1.delete(\"clients/#{@name}\")\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n...
[ "0.7535702", "0.7241183", "0.71828413", "0.7068847", "0.7068102", "0.7068102", "0.70645523", "0.70645523", "0.70645523", "0.70645523", "0.70645523", "0.70645523", "0.70645523", "0.70645523", "0.70645523", "0.70612556", "0.7047506", "0.7026895", "0.69886094", "0.6977794", "0.6...
0.7379846
1
Use callbacks to share common setup or constraints between actions.
def set_otg_client @otg_client = OtgClient.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def otg_client_params params.require(:otg_client).permit(:target_id, :one_id, :one_description, :one_findings, :one_liklihood, :one_consequence, :one_risk, :one_recommendations, :one_current, :two_id, :two_description, :two_findings, :two_liklihood, :two_consequence, :two_risk, :two_recommendations, :two_current,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_comment @comment = Comment.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through. Note, by default the generator includes all attributes, apart from the following list: [:id, :created_at, :updated_at, :password, :password_confirmation, :salt, :admin, :is_admin, :login]
def comment_params params.permit([:article_id, :content, :name, :email, :website]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_params\n params.require(:user).permit(:id, :name, :email, :admin,\n :password, :password_confirmation, :generate_password)\n end", "def user_create_parameters\n\t\t\tparams.require(:user).permit(:email, :username, :password, :password_confirmation)\n\t\tend", "def strong_parameters\n\t\...
[ "0.6465324", "0.60273063", "0.60042787", "0.59928143", "0.5986805", "0.59776795", "0.59524673", "0.591009", "0.58774215", "0.5857649", "0.5833368", "0.5832049", "0.57935977", "0.57934904", "0.5788112", "0.5785132", "0.57651865", "0.57604724", "0.574508", "0.57365644", "0.5735...
0.0
-1
GET /accounts GET /accounts.json
def index @accounts = Account.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accounts\n get('/accounts')['accounts']\n end", "def get_accounts()\n http_get(accounts_url)\n end", "def get_account\n as_json(get_results('/account'))\n end", "def index\n\t\t@accounts = Account.all\n\t\trespond_to do |format|\n\t\t\tformat.json { render json: @accounts }\n\t\tend\n...
[ "0.853379", "0.831886", "0.79738474", "0.77710557", "0.7715818", "0.76106566", "0.7565733", "0.7560473", "0.7477256", "0.7466753", "0.73992366", "0.73606426", "0.7348876", "0.7347771", "0.7334897", "0.72753763", "0.7272824", "0.7226032", "0.7212077", "0.7173881", "0.7171776",...
0.68259454
71
GET /accounts/1 GET /accounts/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accounts\n get('/accounts')['accounts']\n end", "def get_accounts()\n http_get(accounts_url)\n end", "def get_account\n as_json(get_results('/account'))\n end", "def account(id)\n make_json_api_request :get, \"v2/accounts/#{id}\"\n end", "def show\n authorize @account...
[ "0.76854396", "0.76389235", "0.76367265", "0.75433934", "0.74302703", "0.72776824", "0.7264478", "0.72200984", "0.72200984", "0.72200984", "0.72200984", "0.72200984", "0.7209649", "0.7190633", "0.71900064", "0.71897256", "0.71785915", "0.71748847", "0.716882", "0.71648955", "...
0.0
-1
POST /accounts POST /accounts.json
def create @account = Account.new(account_params) respond_to do |format| if @account.save format.html { redirect_to @account, notice: 'Account was successfully created.' } format.json { render :show, status: :created, location: @account } else format.html { render :new } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n megam_rest.post_accounts(to_hash)\n end", "def post_accounts(json_hash)\n @options = {:path => '/users.json',\n :body => json_hash[:json]}.merge(@options)\n\n request(\n :expects => 201,\n :method => :post,\n :body => @options[:body]\n )\n ...
[ "0.77059096", "0.74428105", "0.6998076", "0.68458116", "0.684345", "0.68387824", "0.6831728", "0.680515", "0.67691255", "0.67659897", "0.67633784", "0.6748523", "0.6718893", "0.6717981", "0.67089885", "0.6688734", "0.66761726", "0.6670266", "0.6637433", "0.6631494", "0.661951...
0.67459255
20
PATCH/PUT /accounts/1 PATCH/PUT /accounts/1.json
def update respond_to do |format| if @account.update(account_params) format.html { redirect_to @account, notice: 'Account was successfully updated.' } format.json { render :show, status: :ok, location: @account } else format.html { render :edit } format.json { render json...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update \n begin\n @resource = Account.find(params[:id])\n @resource.update_attributes!(params[:account])\n render :response => :PUT\n rescue Exception => e\n @error = process_exception(e)\n render :response => :error\n end\n end", "def update\n respond_to do |format|\...
[ "0.6888842", "0.68063277", "0.6625591", "0.659189", "0.65125626", "0.64961594", "0.64955026", "0.64955026", "0.6484235", "0.6455398", "0.64534825", "0.63780725", "0.6356695", "0.63549036", "0.6312195", "0.63085616", "0.6297107", "0.62448", "0.6242688", "0.62352115", "0.622563...
0.613103
47
DELETE /accounts/1 DELETE /accounts/1.json
def destroy @account.destroy respond_to do |format| format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_account\n @connection.request({\n :method => 'DELETE'\n }) \n end", "def destroy\n @api_v1_account.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_accounts_url, notice: 'Account was successfully destroyed.' }\n format.jso...
[ "0.76617646", "0.75542223", "0.7549606", "0.7352131", "0.7352131", "0.7346889", "0.7346889", "0.7346889", "0.7327806", "0.7327806", "0.7327806", "0.7327806", "0.7327806", "0.7327806", "0.7280886", "0.7280886", "0.725647", "0.7194611", "0.7172228", "0.71403325", "0.7105254", ...
0.70605206
41
Use callbacks to share common setup or constraints between actions.
def set_account @account = Account.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def account_params params.require(:account).permit(:domain, :logo, :admin_user, :user_id, :background_portal, :background_stream, :name, :chat, :facebook, :twitter,:requisitos, :instagram, :linkedin,:has_psw, :psw, :has_networks, :download_docs, :questions, :color_one, :color_two, :color_three) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
GET /responsibilities GET /responsibilities.json
def index @responsibilities = Responsibility.all respond_to do |format| format.html # index.html.erb format.json { render json: @responsibilities } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def abilities\n get('/ability/')\n end", "def index\n @user_responsibilities = UserResponsibility.all\n end", "def index\n @responders = Responder.all\n end", "def index\n @choices = Choice.all\n\n render json: @choices\n end", "def data_responsables\n team.data_responsables\n en...
[ "0.62838644", "0.6195128", "0.6094542", "0.6061227", "0.6055478", "0.60531443", "0.60463053", "0.6029798", "0.5881103", "0.58756554", "0.5857615", "0.5854834", "0.57757574", "0.575663", "0.5750916", "0.5737144", "0.57302517", "0.57174087", "0.5715626", "0.5692503", "0.5683147...
0.73886114
0
GET /responsibilities/1 GET /responsibilities/1.json
def show @responsibility = Responsibility.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @responsibility } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @responsibilities = Responsibility.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @responsibilities }\n end\n end", "def show\n @responder = Responder.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\...
[ "0.7112021", "0.62458223", "0.6116555", "0.59185886", "0.5847492", "0.58116937", "0.5810549", "0.5810065", "0.5793692", "0.57615256", "0.5737343", "0.57033336", "0.5691266", "0.5657816", "0.5641934", "0.56300515", "0.56072366", "0.560325", "0.5602437", "0.559158", "0.55886966...
0.6038508
3
GET /responsibilities/new GET /responsibilities/new.json
def new @responsibility = Responsibility.new respond_to do |format| format.html # new.html.erb format.json { render json: @responsibility } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @responder = Responder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @responder }\n end\n end", "def new\n @what = What.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @what }\n ...
[ "0.7266797", "0.71329916", "0.69405466", "0.6930086", "0.69240785", "0.6913225", "0.6893204", "0.68909204", "0.68768823", "0.6870184", "0.6858788", "0.6858332", "0.6858332", "0.6858332", "0.6858332", "0.6858332", "0.6858332", "0.6858332", "0.6856778", "0.6856778", "0.6856778"...
0.70682
2
POST /responsibilities POST /responsibilities.json
def create @responsibility = Responsibility.new(params[:responsibility]) respond_to do |format| if @responsibility.save format.html { redirect_to @responsibility, notice: 'Responsibility was successfully created.' } format.json { render json: @responsibility, status: :created, location: @...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @responsibilities = Responsibility.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @responsibilities }\n end\n end", "def generate_responsibilities\n set_positions\n set_team_members\n create_responsibilities\n\n\n\n assign_re...
[ "0.63463", "0.61709255", "0.58102256", "0.5777919", "0.5682466", "0.5648544", "0.5644118", "0.5496963", "0.54950285", "0.5494427", "0.54917175", "0.5488432", "0.54189026", "0.54151356", "0.54040307", "0.53780234", "0.53738135", "0.5323152", "0.5306478", "0.52956533", "0.52679...
0.5443015
12
PUT /responsibilities/1 PUT /responsibilities/1.json
def update @responsibility = Responsibility.find(params[:id]) respond_to do |format| if @responsibility.update_attributes(params[:responsibility]) format.html { redirect_to @responsibility, notice: 'Responsibility was successfully updated.' } format.json { head :no_content } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @responsavel = Responsavel.find(params[:id])\n\n if @responsavel.update(responsavel_params)\n head :no_content\n else\n render json: @responsavel.errors, status: :unprocessable_entity\n end\n end", "def update\n @responder = Responder.find(params[:id])\n\n respond_to do ...
[ "0.63472813", "0.5985252", "0.5896709", "0.5862989", "0.5752504", "0.57203645", "0.5717746", "0.56954", "0.5677252", "0.566747", "0.56285715", "0.55192256", "0.55163705", "0.55150217", "0.54897475", "0.54897475", "0.5488303", "0.548096", "0.54405105", "0.54363585", "0.5434127...
0.56997406
7
DELETE /responsibilities/1 DELETE /responsibilities/1.json
def destroy @responsibility = Responsibility.find(params[:id]) @responsibility.destroy respond_to do |format| format.html { redirect_to responsibilities_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @responder = Responder.find(params[:id])\n @responder.destroy\n\n respond_to do |format|\n format.html { redirect_to responders_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @reqdifficulty.destroy\n respond_to do |format|\n format.html { red...
[ "0.72061527", "0.69773746", "0.68843", "0.67861134", "0.6776441", "0.6759789", "0.67580664", "0.67512375", "0.6734161", "0.6733848", "0.67236656", "0.6712825", "0.6712825", "0.67019945", "0.67001444", "0.66929096", "0.66867507", "0.66774124", "0.66420555", "0.6641133", "0.664...
0.7377738
0
This checks to see if there are no users (such as when it's a fresh install) if so, it creates a default user and redirects the user to login with those details
def check_for_user if User.count == 0 User.create({:login => "admin", :password => "password", :password_confirmation => "password", :name => 'blog owner', :email => "none@none", :time_zone => "Europe/London"}) # Display the newly created users details notify "No users found, so de...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_user\n @user = User.find(session[:user_id])\n redirect_to(root_url) unless current_user?(@user) || current_user.admin?\n end", "def default_user\n u = User.find_or_create_by_oauth2(default_oauth2_hash)\n create_user_shop(u)\n u\n end", "def requires_user_existe...
[ "0.6997723", "0.68142164", "0.67973864", "0.6712297", "0.6704145", "0.66356933", "0.65891397", "0.6585616", "0.65851974", "0.65656257", "0.6555645", "0.6555645", "0.6529058", "0.6520559", "0.64903814", "0.6459097", "0.643387", "0.6429351", "0.6429351", "0.6429276", "0.6420194...
0.7758553
0
Show new password reset page
def index redirect_to new_password_reset_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n redirect_to edit_password_reset_path\n end", "def new\n @title = _(\"Recover Password\")\n render\n end", "def new\n # User clicked on the \"Forgot Password\" link, it will show the form\n # to insert the email\n end", "def forgot_password_new\n render \"login/forgot_password\...
[ "0.8004056", "0.7724976", "0.76638514", "0.71852434", "0.7103998", "0.7046474", "0.70408446", "0.6956075", "0.69323623", "0.6917241", "0.6899616", "0.6866052", "0.68085235", "0.6771716", "0.67632586", "0.6750076", "0.6737502", "0.67125696", "0.670863", "0.67083913", "0.670378...
0.73259133
4
Show edit password page
def show redirect_to edit_password_reset_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_password; end", "def edit\n render file: \"app/views/new_password\"\n end", "def edit_password\n\t\t# Do da def correct_user nen co the bo @user=User.find(paramas[:id])\n\t\t#could be same content as edit\n\t\t#@user = User.find(params[:id])\n\tend", "def edit\n redirect_to(new_session_path) ...
[ "0.8070556", "0.7717386", "0.7655226", "0.75222266", "0.7385829", "0.7327015", "0.72145194", "0.715183", "0.71471584", "0.70980394", "0.7050374", "0.7036693", "0.70230347", "0.6967734", "0.69329345", "0.6905733", "0.68900853", "0.6870153", "0.6860214", "0.684148", "0.68381655...
0.68666184
18
Create new password reset request
def create @user = User.find_by_email(params[:cmu_email]) @active_directory_services = ActiveDirectory.new if verify_recaptcha(:model => @user, :attribute => "verification code") if @user && @user.personal_email == params[:personal_email] @active_directory_services.send_password_reset_token(@...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password_reset_request\n end", "def create_reset_password\n @reset_password = true\n self.generate_password(true)\n AdminUserMailer.deliver_reset_password(self)\n end", "def create_reset_digest\n totp = ROTP::TOTP.new(\"base32secret3232\")\n self.reset_token = totp.now\n update_attrib...
[ "0.7756757", "0.75136465", "0.74749935", "0.7364748", "0.72563887", "0.71996725", "0.7195797", "0.71691585", "0.7138411", "0.70955557", "0.7058232", "0.7019172", "0.69982886", "0.6983741", "0.6983741", "0.69827044", "0.69729865", "0.6942589", "0.69371307", "0.69274485", "0.69...
0.0
-1
Display edit form with password reset token link
def edit @user = User.find_by_password_reset_token!(params[:id]) if !params[:password_reset_confirmation].nil? && params[:password_reset_confirmation]=="no" redirect_to root_url, :flash => {:notice => "Thank you for verifying your profile! "} and return end rescue ActiveRecord::RecordNotFound re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit\n unless params[:reset_password_token].present?\n flash[:notice]= \"Password reset link has been expired\"\n redirect_to new_user_session_path\n else\n self.resource = resource_class.new\n set_minimum_password_length\n resource.reset_password_token = params[:reset_password_t...
[ "0.7618065", "0.7553021", "0.75439394", "0.75092834", "0.7372618", "0.7359547", "0.73043346", "0.72828764", "0.7236658", "0.7222932", "0.7222912", "0.7211678", "0.71094346", "0.71068203", "0.7097279", "0.7028789", "0.70265615", "0.7022404", "0.69953483", "0.69747293", "0.6972...
0.7073246
15
Perform actual password reset
def update @user = User.find_by_password_reset_token!(params[:id]) respond_to do |format| if @user && !@user.password_reset_sent_at.nil? && @user.password_reset_sent_at>2.hours.ago # If request was sent within two hours @active_directory_services = ActiveDirectory.new if params[:new_passw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_password!\n reset_password\n save_without_session_maintenance(validate: false)\n end", "def reset_password!\n reset_password\n save_without_session_maintenance(false)\n end", "def password_reset\n\t\tshepherd = Shepherd.first\n\t\tshepherd.reset...
[ "0.8086295", "0.7897443", "0.7796883", "0.775354", "0.7734837", "0.7726961", "0.7695126", "0.7693369", "0.76911837", "0.76427525", "0.7639107", "0.76150924", "0.760791", "0.75886506", "0.7586235", "0.7580563", "0.75492084", "0.75432646", "0.7542457", "0.75165176", "0.7515983"...
0.0
-1
Stub Rails.application.config.eventbrite with invalid data.
def stub_invalid_eventbrite_config allow(Rails.application.config).to receive_messages(eventbrite: { }) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stub_invalid_eventbrite_secrets\n SECRETS.stub!(:eventbrite_data => {\n 'app_key' => 'test',\n 'user_key' => 'test',\n 'event_id' => 'test',\n 'tickets' => 'test',\n })\nend", "def override_event_store_with(even_store)\n allow(Rails.configuration).to receive(:event_store).and_return(even...
[ "0.7328648", "0.55650103", "0.5511611", "0.53924245", "0.53676367", "0.53296655", "0.518284", "0.518174", "0.51679856", "0.5114869", "0.5102339", "0.50863963", "0.5063494", "0.50553536", "0.5047861", "0.50451916", "0.5043992", "0.50342906", "0.5032278", "0.50218236", "0.50026...
0.7869911
0
Stub successful event_get call to Eventbrite API
def stub_eventbrite_event_get mock_event = { name: { text: 'test' }, ticket_classes: [ { id: '1234', name: 'test', free: true, hidden: true }]} response = double('Yay!', to_hash: {"Status" => ["200 OK"]}, code: 200) res = RestClient::Response.create(mock_event.to_json, response, {}, {}) expect(RestClient).to re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_event ( event_key )\n get_api_resource \"#{@@api_base_url}event/#{event_key}\"\n end", "def get(event_id)\n @client.request \"events/#{event_id}\"\n end", "def get_event(event_id)\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}/#{id}/events/#{event_id}\"))[0]\n ...
[ "0.7222324", "0.6842893", "0.67540336", "0.66605157", "0.65171164", "0.64488035", "0.63450354", "0.63068116", "0.63041145", "0.6277437", "0.6249074", "0.6141615", "0.61239606", "0.60948855", "0.60857564", "0.6082442", "0.6036659", "0.60065764", "0.60035574", "0.59968764", "0....
0.7217611
1
Need to move this somewhere Currently shared between DataPage and FileMetaData
def proto unless defined? @proto transport = Thrift::IOStreamTransport.new(input_io, input_io) @proto ||= Thrift::CompactProtocol.new(transport) end @proto end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def internal_file_attributes; end", "def metadata_file; end", "def metadata_file; end", "def external_file_attributes; end", "def file_field; end", "def read_metadata; end", "def extract_metadata; end", "def metadata; end", "def metadata; end", "def metadata; end", "def metadata; end", "def m...
[ "0.6948366", "0.6914022", "0.6914022", "0.6621284", "0.62935144", "0.62362105", "0.6201758", "0.617088", "0.617088", "0.617088", "0.617088", "0.617088", "0.617088", "0.617088", "0.61449957", "0.61400324", "0.6100603", "0.610021", "0.58981466", "0.58981466", "0.58981466", "0...
0.0
-1
def not_found head 404 end
def record_invalid(exception) render json: exception.record.errors, status: :unprocessable_entity end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def not_found\n status 404\n body \"not found\\n\"\n end", "def not_found\n status 404\n body \"not found\\n\"\n end", "def not_found\n status 404\n body \"not found\\n\"\n end", "def not_found\n render nothing: true, status: 404\n end", "def not_found\n render :status => 404\n ...
[ "0.8647824", "0.8647824", "0.8647824", "0.8474399", "0.84383065", "0.8419846", "0.8390576", "0.83065796", "0.8290016", "0.8160826", "0.814778", "0.81156725", "0.81068844", "0.8077335", "0.8072987", "0.8060256", "0.80564207", "0.80561626", "0.8034305", "0.80273384", "0.8025166...
0.0
-1
Create a Spending Control Create a new Spending Control.
def create_spending_control_using_post(spending_control, opts = {}) data, _status_code, _headers = create_spending_control_using_post_with_http_info(spending_control, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @spending = Spending.new(spending_params)\n respond_to do |format|\n if @spending.save \n format.html { redirect_to new_spending_url, notice: 'Spending was successfully created.' }\n format.json { render action: 'show', status: :created, location: @spending }\n ...
[ "0.5956483", "0.5853499", "0.58266306", "0.5416266", "0.5416266", "0.5393725", "0.53536254", "0.5253031", "0.5246952", "0.522721", "0.5221889", "0.51988685", "0.5148537", "0.51480657", "0.51215994", "0.5100795", "0.50970197", "0.50819623", "0.50819623", "0.50646186", "0.50639...
0.5711126
3
Create a Spending Control Create a new Spending Control.
def create_spending_control_using_post_with_http_info(spending_control, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SpendingControlApi.create_spending_control_using_post ...' end # verify the required parameter 'spending_control' is set if @ap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @spending = Spending.new(spending_params)\n respond_to do |format|\n if @spending.save \n format.html { redirect_to new_spending_url, notice: 'Spending was successfully created.' }\n format.json { render action: 'show', status: :created, location: @spending }\n ...
[ "0.59555143", "0.58530873", "0.57112056", "0.5416205", "0.5416205", "0.5393236", "0.5352344", "0.5253562", "0.52461463", "0.5227195", "0.52211183", "0.5199981", "0.5149169", "0.5147312", "0.5120887", "0.51009345", "0.50961936", "0.5081837", "0.5081837", "0.5066103", "0.506600...
0.5826661
2
Delete a Spending Control Permanently Delete Spending Control.
def delete_spending_control_using_delete(spending_control_id, opts = {}) delete_spending_control_using_delete_with_http_info(spending_control_id, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_pending(purchase)\r\n self.pending_purchases.delete(purchase)\r\n end", "def destroy\r\n @cost.destroy\r\n end", "def destroy_cash_controls\n Cash.all.each do |ca|\n ca.cash_controls.for_period(self).each {|cc| cc.destroy }\n end\n end", "def destroy\n @billing_option.de...
[ "0.5957981", "0.5820707", "0.5738481", "0.57214385", "0.57196766", "0.5620747", "0.54942095", "0.5469395", "0.5443799", "0.5443799", "0.5439463", "0.53883225", "0.5372729", "0.5354655", "0.53373414", "0.53347504", "0.5332399", "0.5310629", "0.5304159", "0.5293621", "0.5293621...
0.5984311
0
Delete a Spending Control Permanently Delete Spending Control.
def delete_spending_control_using_delete_with_http_info(spending_control_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SpendingControlApi.delete_spending_control_using_delete ...' end # verify the required parameter 'spending_control_id' is set ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_spending_control_using_delete(spending_control_id, opts = {})\n delete_spending_control_using_delete_with_http_info(spending_control_id, opts)\n nil\n end", "def delete_pending(purchase)\r\n self.pending_purchases.delete(purchase)\r\n end", "def destroy\r\n @cost.destroy\r\n ...
[ "0.5984311", "0.5957981", "0.5820707", "0.5738481", "0.57214385", "0.57196766", "0.54942095", "0.5469395", "0.5443799", "0.5443799", "0.5439463", "0.53883225", "0.5372729", "0.5354655", "0.53373414", "0.53347504", "0.5332399", "0.5310629", "0.5304159", "0.5293621", "0.5293621...
0.5620747
6
List all Spending Control List all Spending Control.
def get_spending_control_all_using_get(opts = {}) data, _status_code, _headers = get_spending_control_all_using_get_with_http_info(opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @spending_pools = SpendingPool.all\n end", "def index\n @banking_systems = BankingSystem.all\n end", "def index\n @pay_cmb_signs = Pay::CmbSign.all\n end", "def index\n @type_spends = TypeSpend.all\n end", "def index\n @billing_plans = BillingPlan.all\n end", "def index\n ...
[ "0.6548863", "0.5733018", "0.5713575", "0.5692726", "0.56868434", "0.5679961", "0.56778544", "0.56700504", "0.5645928", "0.56281096", "0.56269145", "0.56201726", "0.56127137", "0.55979156", "0.5566949", "0.5558375", "0.5537155", "0.55234087", "0.550905", "0.5497399", "0.54847...
0.58255285
1
List all Spending Control List all Spending Control.
def get_spending_control_all_using_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SpendingControlApi.get_spending_control_all_using_get ...' end # resource path local_var_path = '/nucleus/v1/spending_control' # query par...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @spending_pools = SpendingPool.all\n end", "def get_spending_control_all_using_get(opts = {})\n data, _status_code, _headers = get_spending_control_all_using_get_with_http_info(opts)\n data\n end", "def index\n @banking_systems = BankingSystem.all\n end", "def index\n @pay...
[ "0.654828", "0.5825979", "0.57321596", "0.57127863", "0.5692847", "0.568592", "0.5679767", "0.56770563", "0.56686115", "0.5645599", "0.5627614", "0.562676", "0.5619459", "0.5611704", "0.55987614", "0.55657667", "0.55572206", "0.55383617", "0.55228484", "0.5508768", "0.5496962...
0.54752296
22
Retrieve a Spending Control Retrieve a Spending Control.
def get_spending_control_using_get(spending_control_id, opts = {}) data, _status_code, _headers = get_spending_control_using_get_with_http_info(spending_control_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_spending_control_using_get_with_http_info(spending_control_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SpendingControlApi.get_spending_control_using_get ...'\n end\n # verify the required parameter 'spending_control_id' is set\n ...
[ "0.5521411", "0.547672", "0.54691666", "0.5147775", "0.51013774", "0.50383943", "0.4959186", "0.48752704", "0.48242468", "0.4811787", "0.47431466", "0.4716625", "0.46876895", "0.46324363", "0.4628232", "0.45912856", "0.4559891", "0.45451236", "0.45387402", "0.45369297", "0.45...
0.5811731
0
Retrieve a Spending Control Retrieve a Spending Control.
def get_spending_control_using_get_with_http_info(spending_control_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SpendingControlApi.get_spending_control_using_get ...' end # verify the required parameter 'spending_control_id' is set if @api_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_spending_control_using_get(spending_control_id, opts = {})\n data, _status_code, _headers = get_spending_control_using_get_with_http_info(spending_control_id, opts)\n data\n end", "def set_spending\n @spending = Spending.find(params[:id])\n end", "def get_spending_control_all_using...
[ "0.5811731", "0.547672", "0.54691666", "0.5147775", "0.51013774", "0.50383943", "0.4959186", "0.48752704", "0.48242468", "0.4811787", "0.47431466", "0.4716625", "0.46876895", "0.46324363", "0.4628232", "0.45912856", "0.4559891", "0.45451236", "0.45387402", "0.45369297", "0.45...
0.5521411
1
Update a Spending Control Update a Spending Control.
def update_spending_control_using_put(spending_control, spending_control_id, opts = {}) data, _status_code, _headers = update_spending_control_using_put_with_http_info(spending_control, spending_control_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_spending\n @spending = Spending.find(params[:id])\n end", "def update_pending\n @pending_amount = self.class.count_money @pending_money\n end", "def update\n @spending_rate = SpendingRate.find(params[:id])\n\n respond_to do |format|\n if @spending_rate.update_attributes(params[:s...
[ "0.6580192", "0.6350825", "0.6117431", "0.60915524", "0.6021047", "0.5888417", "0.58559906", "0.5846573", "0.5811682", "0.56727356", "0.56618637", "0.564421", "0.5611591", "0.55353236", "0.5533362", "0.5529501", "0.55203617", "0.5509648", "0.5504643", "0.54552704", "0.5454923...
0.5949246
5
Update a Spending Control Update a Spending Control.
def update_spending_control_using_put_with_http_info(spending_control, spending_control_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SpendingControlApi.update_spending_control_using_put ...' end # verify the required parameter 'spending_control' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_spending\n @spending = Spending.find(params[:id])\n end", "def update_pending\n @pending_amount = self.class.count_money @pending_money\n end", "def update\n @spending_rate = SpendingRate.find(params[:id])\n\n respond_to do |format|\n if @spending_rate.update_attributes(params[:s...
[ "0.658137", "0.6352601", "0.6115846", "0.6092109", "0.6019937", "0.5946814", "0.58877826", "0.58492905", "0.5812068", "0.56715083", "0.56630206", "0.56435764", "0.5610018", "0.553585", "0.5534541", "0.5529533", "0.552096", "0.551268", "0.5506636", "0.5454642", "0.54543483", ...
0.58553445
7
GET /documents GET /documents.json
def index if params[:search] @documents = Document.search(params[:search]).order("created_at DESC") else @documents = Document.all.order('created_at DESC') end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def documents(params={})\n server.get(\"#{name}/_all_docs\", params)\n end", "def index\n @documents = Document.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @documents }\n end\n end", "def documents\n return bad_request unless params[...
[ "0.7656662", "0.7626486", "0.75327045", "0.7379236", "0.73293954", "0.73293954", "0.73293954", "0.73293954", "0.73293954", "0.73293954", "0.73293954", "0.7327912", "0.73046535", "0.7289063", "0.72620124", "0.7253349", "0.7240533", "0.7154175", "0.7143549", "0.7138256", "0.711...
0.0
-1
GET /documents/1 GET /documents/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n \n @document = Document.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @document }\n end\n \n end", "def index\n @documents = Document.all\n\n respond_to do |format|\n format.html # index.html.erb\n form...
[ "0.7391596", "0.73689586", "0.73263764", "0.73263764", "0.73263764", "0.73263764", "0.73263764", "0.73263764", "0.73263764", "0.73170596", "0.7306216", "0.7303724", "0.7286854", "0.72555476", "0.71793205", "0.71743375", "0.71661717", "0.714282", "0.71288323", "0.7051852", "0....
0.0
-1
POST /documents POST /documents.json
def create @document.user = current_user respond_to do |format| if @document.save @document.create_activity :create, owner: current_user format.html { redirect_to @document, notice: 'Document was successfully created.' } format.json { render :show, status: :created, location: @docu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, :notice => 'Document was successfully created.' }\n format.json { render :json => @document, :status => :created, :location => @document }\n e...
[ "0.7267415", "0.72268313", "0.72020537", "0.72020537", "0.7193004", "0.71516347", "0.7137478", "0.71373665", "0.7124582", "0.70484006", "0.68926215", "0.68771446", "0.68380576", "0.68183285", "0.6815543", "0.6751143", "0.6745509", "0.6733746", "0.6723664", "0.6687253", "0.668...
0.0
-1
PATCH/PUT /documents/1 PATCH/PUT /documents/1.json
def update respond_to do |format| if @document.update(document_params) @document.create_activity :update, owner: current_user format.html { redirect_to @document, notice: 'Document was successfully updated.' } format.json { render :show, status: :ok, location: @document } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n document = Document.find(params[:id])\n document.update!(update_params)\n render json: {}\n end", "def update\n document = Document.find(params[:id])\n if document.update(params_document)\n render json: document, status: 200\n else\n render json: docum...
[ "0.70425797", "0.69298327", "0.6854079", "0.6814405", "0.6812519", "0.6795779", "0.6793156", "0.67761236", "0.67761236", "0.67761236", "0.67729825", "0.67482245", "0.6740281", "0.6724862", "0.6723748", "0.67065024", "0.6704273", "0.66897076", "0.66897076", "0.66897076", "0.66...
0.6203274
68
DELETE /documents/1 DELETE /documents/1.json
def destroy @document.create_activity :destroy, owner: current_user @document.destroy respond_to do |format| format.html { redirect_to documents_url, notice: 'Document was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n @client.delete_document(@path)\n end", "def delete_document index, id\n uri = URI(\"http://#{@host}:#{@port_s}/#{index}/_doc/#{id}\")\n req = Net::HTTP::Delete.new(uri)\n run(uri, req)\n end", "def destroy\n @doc = Doc.find(params[:id])\n @doc.destroy\n\n respond...
[ "0.78232354", "0.761401", "0.7518423", "0.75177574", "0.7488822", "0.7488822", "0.7488822", "0.7488822", "0.7488822", "0.7483412", "0.7483412", "0.7474384", "0.7474384", "0.7474384", "0.7474384", "0.7474384", "0.7474384", "0.7474384", "0.7474384", "0.7474384", "0.74585146", ...
0.7029917
75
Never trust parameters from the scary internet, only allow the white list through.
def document_params params.require(:document).permit(:user_id, :name, :desc, :is_private, :is_writable, :category_id, :attachment, :word, :ppt, :remove_attachment, :word_cache, :remove_word, :remove_ppt, :ppt_cache, :tag_list) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
update current profile avatar
def profile_avatar if current_user.update(params.require(:user).permit(:avatar)) render :profile_avatar else render(json: { errors: current_user.errors.full_messages }, status: :unprocessable_entity) && return end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n current_user.update(user_params_with_profile_picture)\n\n expose current_user\n end", "def profile\n current_user.update(user_params)\n current_user.avatar.attach(params[:user][:avatar]) if params[:user][:avatar].present?\n end", "def update_image(image)\n self.avatar ...
[ "0.8213479", "0.80684364", "0.78002095", "0.7641109", "0.75253534", "0.7477415", "0.7405671", "0.73906183", "0.73749113", "0.73544526", "0.7352846", "0.7320829", "0.73137945", "0.7300241", "0.72462434", "0.723308", "0.7214654", "0.7167221", "0.71541923", "0.71402055", "0.7137...
0.7594154
4
update cover photo for current user
def profile_cover @updated = current_user.update(params.require(:user).permit(:cover)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n\t\t@user = User.find(params[:id])\n\t\tif params[:avatar_photo]\n\t\t\t@user.avatar_id = params[:avatar_photo].to_i\n\t\telsif params[:cover_photo]\n\t\t\t@user.cover_photo_id = params[:cover_photo].to_i\n\t\tend\n\n\t\tif @user.save\n\t\t\tflash[:success] = \"Photo Set!\"\n\t\t\tredirect_to request...
[ "0.7995635", "0.77105564", "0.7548125", "0.7437759", "0.7400561", "0.7374812", "0.72090393", "0.7180782", "0.7132282", "0.70536447", "0.70302737", "0.70187974", "0.69742334", "0.6959359", "0.6957217", "0.69398904", "0.6915927", "0.6904182", "0.6888735", "0.68853956", "0.68636...
0.79579985
1
resend confirmation email in case if user didn't receive first email
def resend_confirmation_email unless current_user.confirmed? current_user.send_confirmation_instructions flash[:success] = I18n.t('flash.success.confirmation_sent') end redirect_to home_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resend_confirmation\n if params[:email].blank?\n @error = 1\n @errors = {email: [\"Email cannot be blank!\"]}\n else\n user = User.where(email: params[:email])\n if user.blank?\n @error = 1\n @errors = {email: [\"User with email #{params[:email]} is not registered!\"]}\n...
[ "0.7930162", "0.7683036", "0.7643447", "0.75207955", "0.7481914", "0.7455423", "0.7443253", "0.73932195", "0.73594356", "0.7354092", "0.7282069", "0.7273387", "0.7257332", "0.72504675", "0.72396225", "0.72032195", "0.7192667", "0.7117201", "0.7083603", "0.70569044", "0.704960...
0.8091244
0
register a new report for counselor of current user
def report_counselor report = current_user.counselor_reports.new(params.require(:counselor_report).permit(:reason, :mentorship_id)) if report.save flash[:notice] = 'Your report has been successfully saved.' else flash[:error] = "Your report has the following errors: #{report.errors.ful...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n authorize :report, :create?\n @report = Report.new(report_params)\n @report.user_id = current_user.id\n @report.resquest_criminal = @resquest_criminal\n @report.resquest_criminal.status = 1\n @report.resquest_criminal.save\n respond_to do |format|\n if @report.save\n f...
[ "0.69069195", "0.6889805", "0.68763024", "0.6863072", "0.68527454", "0.67823875", "0.67823875", "0.6758122", "0.6740125", "0.6712337", "0.6706723", "0.66561925", "0.66530335", "0.66406476", "0.6583972", "0.6542961", "0.64805496", "0.6465909", "0.6433738", "0.64259315", "0.640...
0.67484975
8