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
stop rails CSRF protection for this action
def auth Pusher['presence-test-channel'].trigger('newPlayer', {:from => "new name", :subject => "new subject"}) response = Pusher[params[:channel_name]].authenticate(params[:socket_id], { :user_id => 12, # => required :user_info => { :name => "Rober...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disable_request_forgery_protection; end", "def disable_request_forgery_protection=(_arg0); end", "def clean_up_csrf?; end", "def clean_up_csrf?; end", "def skip_forgery_protection(options = T.unsafe(nil)); end", "def csrf; end", "def clean_up_csrf?\n false\n end", "def clean_up_csrf?\...
[ "0.77760774", "0.76563007", "0.7332915", "0.7332915", "0.70371854", "0.70363104", "0.70097077", "0.7002428", "0.6828669", "0.6828669", "0.6679377", "0.66760176", "0.66671306", "0.6602603", "0.65869737", "0.6586769", "0.6585341", "0.6585341", "0.6585341", "0.6585341", "0.65853...
0.0
-1
GET /microplsts/1 GET /microplsts/1.json
def show @microplst = Microplst.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @microplst } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @microposst = Microposst.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @microposst }\n end\n end", "def show\n @microposr = Microposr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n ...
[ "0.7012686", "0.6687775", "0.6529697", "0.6496534", "0.6148611", "0.5961956", "0.5904356", "0.58934456", "0.58731014", "0.58711356", "0.58593285", "0.58583766", "0.58469105", "0.58448666", "0.582018", "0.5732528", "0.56981665", "0.56962395", "0.569527", "0.56879944", "0.56831...
0.7407951
0
GET /microplsts/new GET /microplsts/new.json
def new @microplst = Microplst.new respond_to do |format| format.html # new.html.erb format.json { render json: @microplst } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @microplst = Microplst.new(params[:microplst])\n\n respond_to do |format|\n if @microplst.save\n format.html { redirect_to @microplst, notice: 'Microplst was successfully created.' }\n format.json { render json: @microplst, status: :created, location: @microplst }\n else\...
[ "0.7266805", "0.7174864", "0.6805809", "0.68004763", "0.67161953", "0.6703454", "0.66652894", "0.6580652", "0.65740055", "0.65733516", "0.65707725", "0.65510935", "0.65504193", "0.6545108", "0.6545108", "0.6478118", "0.647595", "0.6464618", "0.6448856", "0.64472824", "0.64348...
0.76021504
0
POST /microplsts POST /microplsts.json
def create @microplst = Microplst.new(params[:microplst]) respond_to do |format| if @microplst.save format.html { redirect_to @microplst, notice: 'Microplst was successfully created.' } format.json { render json: @microplst, status: :created, location: @microplst } else form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @microposst = Microposst.new(params[:microposst])\n\n respond_to do |format|\n if @microposst.save\n format.html { redirect_to @microposst, notice: 'Microposst was successfully created.' }\n format.json { render json: @microposst, status: :created, location: @microposst }\n ...
[ "0.6393867", "0.60983294", "0.6025001", "0.59829605", "0.59301674", "0.5913225", "0.58045614", "0.5730122", "0.5674362", "0.5646438", "0.5597914", "0.5551734", "0.5546188", "0.5531512", "0.5530327", "0.55092615", "0.5508483", "0.54913044", "0.5424495", "0.5419023", "0.5405474...
0.68214303
0
PUT /microplsts/1 PUT /microplsts/1.json
def update @microplst = Microplst.find(params[:id]) respond_to do |format| if @microplst.update_attributes(params[:microplst]) format.html { redirect_to @microplst, notice: 'Microplst was successfully updated.' } format.json { head :no_content } else format.html { render act...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @microposst = Microposst.find(params[:id])\n\n respond_to do |format|\n if @microposst.update_attributes(params[:microposst])\n format.html { redirect_to @microposst, notice: 'Microposst was successfully updated.' }\n format.json { head :no_content }\n else\n forma...
[ "0.6660137", "0.6160278", "0.61318785", "0.6088495", "0.5999131", "0.5917384", "0.57628405", "0.5698636", "0.5639842", "0.5622594", "0.55619836", "0.55545616", "0.5533077", "0.5505342", "0.54930174", "0.54761696", "0.5461488", "0.5460098", "0.54167897", "0.53266555", "0.53253...
0.69764084
0
DELETE /microplsts/1 DELETE /microplsts/1.json
def destroy @microplst = Microplst.find(params[:id]) @microplst.destroy respond_to do |format| format.html { redirect_to microplsts_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @microposst = Microposst.find(params[:id])\n @microposst.destroy\n\n respond_to do |format|\n format.html { redirect_to micropossts_url }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\"...
[ "0.72016436", "0.7032676", "0.68969405", "0.6868228", "0.6800341", "0.6779806", "0.67183506", "0.6702789", "0.65981483", "0.6551893", "0.6534534", "0.65041775", "0.6441562", "0.6432217", "0.6430737", "0.63880014", "0.63807386", "0.63714063", "0.63711685", "0.63708884", "0.634...
0.73730356
0
Use callbacks to share common setup or constraints between actions.
def set_photo Photo.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 photo_params params.require(:photo).permit(:filename, :date_taken, :path, :file_thumb_path, :file_extension, :file_size, :location_id, :make, :model, :original_height, :original_width, :longitude, :latitude) 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.6981269", "0.6783559", "0.6746007", "0.67423046", "0.6735905", "0.6593568", "0.6504213", "0.649792", "0.6482664", "0.6478558", "0.64566684", "0.64392304", "0.6380194", "0.6376366", "0.636562", "0.63208145", "0.63006365", "0.63001287", "0.6292953", "0.62927175", "0.62911004...
0.0
-1
GET /responses GET /responses.json
def index @responses = Response.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def responses\n question=Question.find(params[:questionId])\n render :json=> question.response\n end", "def index\n \t @responses = Response.all\n end", "def show\n @responses = Response.find(params[:id])\n respond_with @response\n end", "def responses\n @responses\n end", "def ...
[ "0.7442789", "0.72299486", "0.6957288", "0.67711747", "0.6641187", "0.65913343", "0.6360542", "0.6346243", "0.63390195", "0.63370043", "0.6293579", "0.62789583", "0.6241664", "0.6219194", "0.6171756", "0.608554", "0.6019136", "0.6012638", "0.59993255", "0.5984308", "0.5983643...
0.71078247
5
GET /responses/1 GET /responses/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def responses\n question=Question.find(params[:questionId])\n render :json=> question.response\n end", "def index\n \t @responses = Response.all\n end", "def show\n @responses = Response.find(params[:id])\n respond_with @response\n end", "def index\n @responses = Response.all\n end", "d...
[ "0.7103356", "0.68198735", "0.6745719", "0.66933954", "0.66933954", "0.66933954", "0.66933954", "0.66933954", "0.65169305", "0.64567405", "0.6422451", "0.6310916", "0.6305161", "0.6295606", "0.62789196", "0.6144893", "0.6113847", "0.6094109", "0.6064051", "0.60312355", "0.603...
0.0
-1
redirect survey submission GET /responses/1/thanks
def thanks end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n redirect_to root_path, notice: \"Survey submitted!\"\n end", "def ask\n if @help_request.valid?\n MyousicaMailer.deliver_help_request(@help_request)\n flash[:notice] = \"Thanks for contacting us! Your question has been sent to our help desk, you'll receive a reply in few hours.\"\n ...
[ "0.65794855", "0.63923126", "0.63610834", "0.6313721", "0.60594034", "0.60523164", "0.60272413", "0.6022261", "0.59659415", "0.59226036", "0.58624274", "0.58624274", "0.58122236", "0.58053094", "0.57920927", "0.57791436", "0.5769017", "0.5763459", "0.5755207", "0.5750806", "0...
0.57031703
23
POST /responses POST /responses.json
def create @response = Response.new(response_params) #mine @survey = Survey.find(params[:survey_id]) @response.ip = request.remote_ip @response.survey_id = @survey.id @response.survey_id = params[:survey_id] respond_to do |format| if @response.save if user_signed_in? ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def responses\n question=Question.find(params[:questionId])\n render :json=> question.response\n end", "def create\n \n respond_to do |format|\n \n if !params[:questions].nil? \n params[:questions].each {\n |q| \n type = Question.find_by_id(q[0]).question_type\...
[ "0.66384083", "0.66362196", "0.63350517", "0.6251072", "0.6227423", "0.62105536", "0.61883014", "0.61792064", "0.6148914", "0.6131653", "0.6131653", "0.6131653", "0.6131653", "0.6131653", "0.6126999", "0.60825485", "0.6013456", "0.5997124", "0.5995606", "0.5994499", "0.597849...
0.5551878
60
PATCH/PUT /responses/1 PATCH/PUT /responses/1.json
def update respond_to do |format| if @response.update(response_params) format.html { redirect_to survey_response_path(params[:survey_id], @response.id), notice: 'Response was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update!(**args)\n @simple_responses = args[:simple_responses] if args.key?(:simple_responses)\n end", "def update!(**args)\n @simple_responses = args[:simple_responses] if args.key?(:simple_responses)\n end", "def patch\n headers = {\"If-Match\" => @version}\n resp...
[ "0.68573046", "0.685703", "0.67085457", "0.66725254", "0.6267275", "0.6257241", "0.6252938", "0.62127554", "0.6126895", "0.6120123", "0.611336", "0.611336", "0.61077875", "0.61034954", "0.6102206", "0.6102206", "0.6025933", "0.6023345", "0.5989466", "0.5985376", "0.59757376",...
0.616937
8
DELETE /responses/1 DELETE /responses/1.json
def destroy @response.destroy respond_to do |format| format.html { redirect_to responses_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @response = Response.find(params[:id])\n @response.destroy\n\n respond_to do |format|\n format.html { redirect_to responses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @response = Response.find(params[:id])\n @response.destroy\n\n respond_to...
[ "0.7359098", "0.7359098", "0.7288968", "0.72205526", "0.72205526", "0.7153428", "0.71407366", "0.71169347", "0.7056873", "0.7040096", "0.7040096", "0.7026196", "0.70257586", "0.7010011", "0.7006222", "0.70005715", "0.69626963", "0.69626963", "0.69626963", "0.69626963", "0.696...
0.7251925
6
Use callbacks to share common setup or constraints between actions.
def set_response @response = Response.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 response_params params.require(:response).permit( :ip, :survey_id, :answers_attributes => [ :id, :answer, {:resp => []}, :survey_id, :question_id, :response_id, :user_id ]) 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.6981269", "0.6783559", "0.6746007", "0.67423046", "0.6735905", "0.6593568", "0.6504213", "0.649792", "0.6482664", "0.6478558", "0.64566684", "0.64392304", "0.6380194", "0.6376366", "0.636562", "0.63208145", "0.63006365", "0.63001287", "0.6292953", "0.62927175", "0.62911004...
0.0
-1
GET /program_roles GET /program_roles.json
def index @program_roles = ProgramRole.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n client_application_id = current_user.client_application_id.to_s\n @roles = Role.where(client_application_id: client_application_id)\n end", "def get_user_roles\n @roles = @user.roles.pluck(:name)\n render json: @roles\n end", "def index\n authorize Role\n\n respond_to do |format...
[ "0.7160705", "0.692546", "0.68148494", "0.68008137", "0.67080367", "0.6706053", "0.6699604", "0.66965353", "0.6679418", "0.6678615", "0.6677299", "0.6626799", "0.66218996", "0.65868527", "0.6548711", "0.6544704", "0.6505644", "0.64779556", "0.6466281", "0.6435268", "0.6430266...
0.79618704
0
GET /program_roles/1 GET /program_roles/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @program_roles = ProgramRole.all\n end", "def index\n client_application_id = current_user.client_application_id.to_s\n @roles = Role.where(client_application_id: client_application_id)\n end", "def index\n authorize Role\n\n respond_to do |format|\n format.json { render json:...
[ "0.78310233", "0.6979005", "0.6842128", "0.6736196", "0.6718737", "0.6611689", "0.6586265", "0.6487119", "0.64856386", "0.64476764", "0.64417964", "0.6422455", "0.63888687", "0.63547456", "0.63522327", "0.63478357", "0.6347692", "0.63105786", "0.62905544", "0.62781763", "0.62...
0.0
-1
POST /program_roles POST /program_roles.json
def create @program_role = ProgramRole.new(program_role_params) respond_to do |format| if @program_role.save format.html { redirect_to @program_role, notice: 'Program role was successfully created.' } format.json { render :show, status: :created, location: @program_role } format.j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def program_role_params\n params.require(:program_role).permit(:program_id, :name, :description)\n end", "def post_role(role)\n role = {\n \"id\"=>nil,\n \"name\"=>nil, \n \"description\"=>\"\", \n \"sessionTimeout\"=>\"60\",\n \"roles\"=>[],\n \"privileges\"=>[]\n }.m...
[ "0.66698897", "0.6597888", "0.6571709", "0.654499", "0.6481686", "0.64601356", "0.6424445", "0.6322422", "0.62147695", "0.6182538", "0.61217517", "0.6060442", "0.6056948", "0.5997524", "0.59845555", "0.59518945", "0.5945317", "0.5933638", "0.59213585", "0.59032583", "0.589741...
0.5901104
20
PATCH/PUT /program_roles/1 PATCH/PUT /program_roles/1.json
def update respond_to do |format| if @program_role.update(program_role_params) format.html { redirect_to @program_role, notice: 'Program role was successfully updated.' } format.json { render :show, status: :ok, location: @program_role } format.js {render :js => "window.location.reload...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @app_role = AppRole.find(params[:id])\n\n respond_to do |format|\n if @app_role.update_attributes(params[:app_role])\n format.html { redirect_to @app_role, notice: 'App role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { rend...
[ "0.6724169", "0.66943383", "0.65701014", "0.653137", "0.6495982", "0.64923596", "0.6394307", "0.63874406", "0.63765085", "0.6363398", "0.6335036", "0.63189685", "0.6314944", "0.63034904", "0.62989026", "0.6291607", "0.6282458", "0.62762886", "0.62708884", "0.62493056", "0.623...
0.6361786
10
DELETE /program_roles/1 DELETE /program_roles/1.json
def destroy @program_role.destroy respond_to do |format| format.html { redirect_to program_roles_url, notice: 'Program role was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n chef_server_rest.delete(\"roles/#{@name}\")\n end", "def destroy\n @app_role = AppRole.find(params[:id])\n @app_role.destroy\n\n respond_to do |format|\n format.html { redirect_to app_roles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @la...
[ "0.7098761", "0.70470405", "0.6871573", "0.6854509", "0.6720887", "0.6694757", "0.66842824", "0.66813177", "0.666031", "0.66542315", "0.6630741", "0.66298467", "0.6629561", "0.66215837", "0.6606561", "0.6602413", "0.6592406", "0.65846384", "0.6561936", "0.6554934", "0.6524996...
0.73100746
0
Use callbacks to share common setup or constraints between actions.
def set_program_role @program_role = ProgramRole.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 program_role_params params.require(:program_role).permit(:program_id, :name, :description) 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.6980957", "0.6783065", "0.6747844", "0.6741468", "0.67356336", "0.6592548", "0.65036845", "0.64978707", "0.64825076", "0.64795035", "0.64560914", "0.64397955", "0.6379666", "0.6376688", "0.6366702", "0.6319728", "0.6300833", "0.6300629", "0.6294277", "0.6293905", "0.629117...
0.0
-1
Downloads a file from specified URL === Parameters url(String):: URL to file path(String):: downloaded file path === Return downloaded(Boolean):: true if downloaded and saved successfully
def download_files(url, path) client = RightSupport::Net::HTTPClient.new response = client.get(url, :timeout => 10) File.open(path, "wb") { |file| file.write(response) } unless response.empty? File.exists?(path) rescue Exception => e Log.error("#{e.class.name}: #{e.message} - #{e.backt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_to_file(url, path)\n result = false\n\n uri = URI(url)\n if uri.scheme == 'file'\n result = FileUtils.mv uri.path, path\n Rails.logger.info \"Moved to #{path}\" if result == 0\n else\n result = download_url_to_file uri, path\n end\n result\n end", ...
[ "0.7948928", "0.7827738", "0.7641382", "0.76208985", "0.7596842", "0.7508345", "0.7350064", "0.7347866", "0.73391056", "0.7248995", "0.7214659", "0.71736395", "0.7138284", "0.71327925", "0.7113165", "0.7016232", "0.7002229", "0.6990173", "0.6978503", "0.6927993", "0.6926819",...
0.71879816
11
Extracts an archive and moves files to destination directory Supported archive types are: .tar.bz2 / .tbz .tar.gz / .tgz .zip === Parameters username(String):: account's username filename(String):: archive's path destination_path(String):: path where extracted files should be moved === Return extracted(Boolean):: true ...
def extract_files(username, filename, destination_path) escaped_filename = Shellwords.escape(filename) case filename when /(?:\.tar\.bz2|\.tbz)$/ %x(sudo tar jxf #{escaped_filename} -C #{destination_path}) when /(?:\.tar\.gz|\.tgz)$/ %x(sudo tar zxf #{escaped_filename} -C #{dest...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract\n base.say_status 'extract', @file\n if @zip_file\n base.exec(\"cd #{@temp_dir} ; unzip #{@file}\")\n else\n base.exec(\"cd #{@temp_dir} ; tar xvfpz #{@file}\")\n end\n \n # Remove the file\n base.destination_files.rm_rf(@file_path)\n ...
[ "0.66632813", "0.65840715", "0.65485084", "0.650058", "0.6401965", "0.6256552", "0.6256498", "0.6246172", "0.6242412", "0.6209801", "0.61655986", "0.61594856", "0.61594856", "0.61509734", "0.6134453", "0.61210567", "0.6083085", "0.6083079", "0.5973994", "0.5969615", "0.591337...
0.78096545
0
Calculates MD5 checksum for specified file and saves it === Parameters username(String):: account's username target(String):: path to file checksum_path(String):: relative path to checksum file destination(String):: path to file where checksum should be saved === Return nil
def save_checksum(username, target, checksum_path, destination) checksum = Digest::MD5.file(target).to_s temp_dir = File.join(File.dirname(target), File.dirname(checksum_path)) temp_path = File.join(File.dirname(target), checksum_path) FileUtils.mkdir_p(temp_dir) FileUtils.chmod_R(0771, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checksum\n\t\t@checksum ||= FileManager.checksum(@path)\n #\t\tif file?\n #\t\t\treturn FileManager.checksum(@path)\n #\t\tend\n end", "def checksum_handler(file_path, hash_db, hash_class, _bit_size, debugmode, samefolder)\n # Reference for hash banner to notice wat function is using\n reference...
[ "0.655791", "0.63595295", "0.6203491", "0.60712963", "0.6065391", "0.6065391", "0.59883535", "0.5987315", "0.59683573", "0.59631896", "0.5929783", "0.59174764", "0.5891865", "0.5846139", "0.57696486", "0.57402", "0.5724951", "0.5720665", "0.5713279", "0.56972724", "0.56669503...
0.77670276
0
Changes owner of directories and files from given path === Parameters username(String):: desired owner's username group(String):: desired group name path(String):: path for owner changing === Return chowned(Boolean):: true if owner changed successfully
def change_owner(username, group, path) %x(sudo chown -R #{Shellwords.escape(username)}:#{Shellwords.escape(group)} #{path}) $?.success? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chown(path, owner, options = {})\n paths = glob(path, options)\n owner = Etc.getpwnam(owner)\n changed = false\n\n paths.each do |f|\n stat = File.stat(f)\n unless stat.uid == owner.uid && stat.gid == owner.gid\n old_owner = \"#{Etc.getpwuid(stat.uid).name}:#{Etc.getgrgid(stat....
[ "0.765575", "0.7601131", "0.7367573", "0.70836854", "0.6810176", "0.67796016", "0.67701614", "0.6747492", "0.67356884", "0.6684101", "0.6579322", "0.6528231", "0.6527542", "0.64928484", "0.64785534", "0.64591134", "0.6429735", "0.6297109", "0.6201744", "0.61671245", "0.604854...
0.8158358
0
GET /tmpdatabasaes GET /tmpdatabasaes.json
def index @tmpdatabasaes = Tmpdatabasae.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDBData(urlInput)\n url = URI.parse(urlInput)\n server = Couch::Server.new(url.host, url.port)\n res = server.GET(urlInput)\n puts \"PARSING JSON FILE--------------\"\n json = JSON.parse(res.body)\n return json\n end", "def get_all()\n return JSON.parse(File.read(@database_file))\...
[ "0.6257828", "0.59449387", "0.5699782", "0.5668252", "0.56635076", "0.56470776", "0.5640116", "0.56331855", "0.5593336", "0.558828", "0.55831575", "0.55791515", "0.5571716", "0.54984653", "0.54783124", "0.54510826", "0.54388815", "0.53583413", "0.5344349", "0.5341112", "0.533...
0.626782
0
GET /tmpdatabasaes/1 GET /tmpdatabasaes/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDBData(urlInput)\n url = URI.parse(urlInput)\n server = Couch::Server.new(url.host, url.port)\n res = server.GET(urlInput)\n puts \"PARSING JSON FILE--------------\"\n json = JSON.parse(res.body)\n return json\n end", "def index\n @tmpdatabasaes = Tmpdatabasae.all\n end", "def ind...
[ "0.6267641", "0.60782343", "0.602439", "0.59950167", "0.5929149", "0.5900516", "0.5837888", "0.58153254", "0.58068115", "0.57473886", "0.57308805", "0.5724693", "0.5706981", "0.57047105", "0.56976306", "0.5694405", "0.5678112", "0.5675294", "0.56662405", "0.56395614", "0.5633...
0.0
-1
POST /tmpdatabasaes POST /tmpdatabasaes.json
def create @tmpdatabasae = Tmpdatabasae.new(tmpdatabasae_params) respond_to do |format| if @tmpdatabasae.save format.html { redirect_to @tmpdatabasae, notice: 'Tmpdatabasae was successfully created.' } format.json { render :show, status: :created, location: @tmpdatabasae } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tmpdatabasae_params\n params.require(:tmpdatabasae).permit(:name)\n end", "def create\n chef_server_rest.post(\"data/#{data_bag}\", self)\n self\n end", "def main\n create_table\n set_timestamp_to_now\n json = fetch_data.to_json\n store json\nend", "def post(data)\n jss = ...
[ "0.6231851", "0.60301113", "0.57809436", "0.57570004", "0.56783336", "0.5674594", "0.5647127", "0.5642727", "0.5615541", "0.5570912", "0.55071616", "0.54441196", "0.5403012", "0.53745013", "0.5353893", "0.5309762", "0.5296846", "0.52718437", "0.5256034", "0.52416366", "0.5237...
0.63570863
0
PATCH/PUT /tmpdatabasaes/1 PATCH/PUT /tmpdatabasaes/1.json
def update respond_to do |format| if @tmpdatabasae.update(tmpdatabasae_params) format.html { redirect_to @tmpdatabasae, notice: 'Tmpdatabasae was successfully updated.' } format.json { render :show, status: :ok, location: @tmpdatabasae } else format.html { render :edit } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json...
[ "0.6173865", "0.60880625", "0.60709566", "0.6009486", "0.5981946", "0.5891586", "0.58766025", "0.583543", "0.5765471", "0.5762002", "0.5748813", "0.573044", "0.572513", "0.569601", "0.56580174", "0.5647833", "0.5647833", "0.5624276", "0.56188273", "0.55887973", "0.55856305", ...
0.62270826
0
DELETE /tmpdatabasaes/1 DELETE /tmpdatabasaes/1.json
def destroy @tmpdatabasae.destroy respond_to do |format| format.html { redirect_to tmpdatabasaes_url, notice: 'Tmpdatabasae was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @database = Database.find(params[:id])\n path = @database.path\n delete = %x[rm -R #{path}]\n @database.destroy\n\n respond_to do |format|\n format.html { redirect_to databases_url }\n format.json { head :no_content }\n end\n end", "def delete()\n db = PG connect( {dbn...
[ "0.700574", "0.6978514", "0.68039125", "0.67368376", "0.6735827", "0.6715214", "0.6679646", "0.66786546", "0.66033375", "0.65950775", "0.6591951", "0.65708303", "0.65677506", "0.6539019", "0.6534072", "0.6503255", "0.6495313", "0.64122945", "0.63992995", "0.63820165", "0.6379...
0.69063586
2
Use callbacks to share common setup or constraints between actions.
def set_tmpdatabasae @tmpdatabasae = Tmpdatabasae.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 tmpdatabasae_params params.require(:tmpdatabasae).permit(:name) 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
The frame that contains the CLE Forums objects
def frm self.frame(:src=>/sakai2forums.launch.html/) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frm\n self.frame(:src=>/TBD/)\n end", "def frm\n self.frame(:src=>/TBD/)\n end", "def frm\n self.frame(:src=>/TBD/)\n end", "def frm\n self.frame(:src=>/TBD/)\n end", "def frame\n context.frame\n end", "def frames; end", "def forum\n\t\tself.forums[0]\n\tend", "def content...
[ "0.62220657", "0.62220657", "0.62220657", "0.62220657", "0.60188454", "0.58284163", "0.5814337", "0.5756414", "0.57351995", "0.56959164", "0.5652529", "0.5595426", "0.5543598", "0.55136126", "0.5491267", "0.54868644", "0.54568493", "0.542545", "0.53959423", "0.53959423", "0.5...
0.5941013
5
Updated move_to in a cleaner way. But same idea that you created.
def move_to!(new_x, new_y) transaction do raise ArgumentError, "#{type} has not moved." unless real_move?(new_x, new_y) occupying_piece = game.get_piece_at_coor(new_x, new_y) raise ArgumentError, 'That is an invalid move. Cannot capture your own piece.' if same_color?(occupying_piece) captur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(to)\n @moved = true\n super(to)\n end", "def move_to to\n\t\td = Distance.get( @square, to)\n\t\tmove d.dir( @square), to\n\tend", "def move\n move_by a, m\n end", "def move_to(x, y); end", "def move; end", "def move; end", "def lmove(source, destination, where_source, where_destina...
[ "0.759899", "0.74747807", "0.7236389", "0.72142863", "0.7088728", "0.7088728", "0.69941837", "0.69941837", "0.6859401", "0.6848305", "0.6814157", "0.68023485", "0.67569464", "0.67460287", "0.6719138", "0.6719138", "0.6709708", "0.6703926", "0.6703926", "0.67018676", "0.670091...
0.63297886
64
start stubs to make Rspec work
def valid_move?(new_x, new_y) true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stubs; end", "def verify_stubbed_calls; end", "def generate\n `rspec --init`\n end", "def init\n if RSpec::Mocks::Version::STRING >= '3.0'\n require 'rspec/mocks/standalone'\n else\n RSpec::Mocks.setup(self) unless self.respond_to? :allow\n end\n end", "def rspec\n\tsystem('...
[ "0.7501891", "0.637728", "0.6322178", "0.6315502", "0.6264048", "0.6236139", "0.6226587", "0.6196155", "0.61686796", "0.6127084", "0.61216795", "0.61216795", "0.6093682", "0.6070613", "0.60676384", "0.60484207", "0.604041", "0.6033175", "0.59837455", "0.59662116", "0.5927187"...
0.0
-1
end stubs to make Rspec work
def is_vertically_obstructed?(new_x, new_y) x1 = x_position y1 = y_position if y1 < new_y small_y = y1 big_y = new_y else small_y = new_y big_y = y1 end i = small_y + 1 while i < big_y if get_piece_at_coor(x1, i).nil? i += 1 else return t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stubs; end", "def spec; end", "def spec; end", "def stub_implementation; end", "def verify_stubbed_calls; end", "def stubs=(_arg0); end", "def stub!\n return if stub?\n self.status = :stub\n self.store\n end", "def hunter_stub\n\tend", "def __mock_reset; end", "def s...
[ "0.7797385", "0.7163423", "0.7163423", "0.6904748", "0.67000496", "0.66231185", "0.6435554", "0.64297175", "0.63653976", "0.62925595", "0.6213504", "0.62020576", "0.6176564", "0.6176564", "0.6176564", "0.6176564", "0.6176564", "0.6176564", "0.6176564", "0.6176564", "0.6176564...
0.0
-1
Instance Methods Retrieve the current user from the GraphQL context. This current user must be injected in context inside the GraphqlController.
def current_user @current_user ||= context[:current_user] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_user\n get_from_options_or_controller(:current_user)\n end", "def me\n context[:current_user]\n end", "def get_current_user\n request(Route.new(:GET, '/users/@me'))\n end", "def current_user\n @current_user ||= fetch_user_from_request\n end", "def cur...
[ "0.8058897", "0.7910391", "0.77097124", "0.77055544", "0.769212", "0.7659673", "0.7656189", "0.76445806", "0.7604289", "0.7597166", "0.7592566", "0.75861394", "0.7574021", "0.75531757", "0.75531757", "0.75456375", "0.75456375", "0.7537341", "0.75330186", "0.75329435", "0.7532...
0.76528853
7
Reject request if the user is not authenticated
def authorized?(**args) super && (!defined?(Pundit) || current_user || raise(Pundit::NotAuthorizedError)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate_request\n render :json => { :error => :unauthorized }, :status => :unauthorized unless current_user\n end", "def handle_unverified_request\n reset_session\n render :nothing => true, :status => 401\n end", "def prevent_authenticated_user!\n if signed_in?\n head :forbidden\n ...
[ "0.7350265", "0.7288755", "0.7181677", "0.71773785", "0.71593827", "0.7143885", "0.7121259", "0.7091384", "0.70405006", "0.70368904", "0.7004817", "0.6960785", "0.6925928", "0.6925928", "0.6916996", "0.6916996", "0.6916996", "0.6910918", "0.690655", "0.6880957", "0.68766856",...
0.0
-1
Return the name of the association that should be defined on the parent object
def parent_association_name self.class.resolver_opts[:relation] || self.class.model_klass.to_s.underscore.pluralize end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name\n association.name\n end", "def association\n self.parent && self.parent.dbi.reflect_on_association(self.association_name)\n end", "def parent_association\n # needed for the show view\n @parent_object = parent_object\n parent_object.names\n end", "def trackable_parent_c...
[ "0.7963792", "0.79045546", "0.7806775", "0.7576978", "0.75361466", "0.74422604", "0.7306032", "0.7298931", "0.7278898", "0.7236335", "0.7195222", "0.71878344", "0.7061372", "0.70020515", "0.69537395", "0.6948288", "0.6917352", "0.6889668", "0.68570065", "0.6842146", "0.682153...
0.85657513
0
Return the instantiated resource scope via Pundit If a parent object is defined then it is assumed that the resolver is called within the context of an association
def pundit_scope base_scope = object ? object.send(parent_association_name) : self.class.model_klass # Enforce Pundit control if the gem is present # This current user must be injected in context inside the GraphqlController. if defined?(Pundit) self.class.pundit_scope_klass.new(current...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scope\n Pundit.policy_scope!(user, record.class)\n end", "def scope_parent_association\n @scope_association ||= scoping_object.send(parent_model_to_method_sym).find(parent_param).send(model_name_to_method_sym)\n end", "def pundit_user\n CurrentAuthority.new(current_user, current_right)\n...
[ "0.6682145", "0.667602", "0.64812416", "0.62486196", "0.6226837", "0.6224512", "0.6209419", "0.62066793", "0.61895967", "0.61764014", "0.61467475", "0.61270946", "0.6120109", "0.6111195", "0.61109173", "0.61063635", "0.6050967", "0.59678984", "0.5949521", "0.5949521", "0.5909...
0.78896844
0
Actual resolver method performing the ActiveRecord filtering query The resolver supports filtering via a range of operators: => field equal to value _gt => strictly greater than _gte => greater than or equal _lt => strictly less than _lte => less than or equal _in => value in array _nin => value not in array > See Appl...
def resolve(sort_by: nil, **args) pundit_scope.with_api_filters(args).with_sorting(sort_by) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_orm_filters\n filters = [[]]\n date_format = I18n.t(:\"date.formats.default\", {:locale => I18n.locale })\n self.data_grid.columns.each_with_index do |col, col_index|\n if col.filter and !col.filter_value.blank?\n case col.filter\n when :boolean\n filt...
[ "0.58265924", "0.57672423", "0.562267", "0.5554322", "0.55542636", "0.5474647", "0.54677385", "0.5454169", "0.54471576", "0.5445239", "0.5443195", "0.54378325", "0.5431661", "0.54021496", "0.5317348", "0.531287", "0.531081", "0.53094757", "0.5303264", "0.5272125", "0.52690804...
0.50407296
45
Attach this volume to an instance
def attach(instance) # Attach to the instance $ec2.attach_volume(self.id, instance.id, '/dev/sdh') # Wait for it to be attached while true done = false $ec2.describe_volumes([self.id]).each do |result| if result[:aws_attachment_status] == 'attached' done = true end...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attach(instance_id, volume)# rubocop:disable Metrics/AbcSize\n inst_details = AttrFinder.new(@instanceparameters)\n @options[:inst] = volume\n inst_details.options = @options\n inst_details.validate = @validate\n inst_details.function = 'server'\n opts = {}\n BmcAuthenticate.new(@options)\...
[ "0.7703411", "0.7568828", "0.75306076", "0.72756225", "0.7093399", "0.70637226", "0.6945211", "0.690933", "0.68529505", "0.6731073", "0.66374433", "0.6562723", "0.65572", "0.6555287", "0.64232063", "0.6335072", "0.6284795", "0.6262083", "0.6240992", "0.6180463", "0.6179218", ...
0.7965055
0
Detach this volume from any instance it may be attached to
def detach() $ec2.describe_volumes([self.id]).each do |result| if result[:aws_attachment_status] == 'attached' $ec2.detach_volume(self.id) end end self.attached_instance = nil self.save() end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detach!(volume_or_id)\n @@ec2.detach_volume(volume_or_id, id, device)\n @volumes = nil\n end", "def detach_volume( options = {} )\n options = { :volume_id => '' }.merge(options)\n raise ArgumentError, \"No :volume_id provided\" if options[:volume_id].nil? || options[:volume_id].emp...
[ "0.76810867", "0.72623754", "0.71592456", "0.7075084", "0.7007257", "0.6953284", "0.6941065", "0.6799593", "0.6764348", "0.67617863", "0.6738761", "0.66455966", "0.66319454", "0.6525794", "0.64989793", "0.6452983", "0.6382688", "0.6330026", "0.6313096", "0.6204531", "0.613082...
0.8336842
0
Check this volume is still up
def check() # check if teh volume still exists begin volumes = $ec2.describe_volumes([self.id]) rescue RightAws::AwsError if $!.errors[0][0] == "InvalidVolume.NotFound" puts "WARN: Volume #{self.id} is not running" delete() return else p $!.code end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ready?\n return false unless @status =~ /down/i\n volumes.each do |volume|\n return false if volume.status =~ /locked/i\n end\n true\n end", "def held?\n status.queued_held?\n end", "def detachvolume\n false\n end", "def held?\n status == 'Held'\n end...
[ "0.7357753", "0.65032184", "0.62945133", "0.62190425", "0.62190425", "0.61636066", "0.61490685", "0.613664", "0.6120908", "0.611338", "0.6111871", "0.6111871", "0.60927606", "0.6075019", "0.6060724", "0.60309535", "0.6025659", "0.6023833", "0.60235417", "0.6016827", "0.599134...
0.7315565
1
GET /uniprots/1 GET /uniprots/1.json
def show @uniprot = Uniprot.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @uniprot } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @proteins = Protein.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proteins }\n end\n end", "def show\n @produkt = Produkt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render...
[ "0.61618567", "0.6119148", "0.60780853", "0.6026249", "0.5992821", "0.59263504", "0.59037286", "0.59016716", "0.58371323", "0.5823513", "0.5823513", "0.57704663", "0.5754282", "0.5716178", "0.5715905", "0.57079947", "0.56751215", "0.5664344", "0.5644126", "0.5644036", "0.5642...
0.6775008
0
GET /uniprots/new GET /uniprots/new.json
def new @uniprot = Uniprot.new respond_to do |format| format.html # new.html.erb format.json { render json: @uniprot } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @proef = Proef.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proef }\n end\n end", "def new\n @prob = Prob.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prob }\n end\n end", ...
[ "0.7220043", "0.7100107", "0.7049194", "0.7027216", "0.70175123", "0.6994732", "0.69927436", "0.69808847", "0.6933911", "0.692602", "0.6921422", "0.6913564", "0.69100547", "0.6903693", "0.6873813", "0.68733615", "0.6817858", "0.68104017", "0.6810223", "0.6798389", "0.67689055...
0.7419177
0
POST /uniprots POST /uniprots.json
def create @uniprot = Uniprot.new(params[:uniprot]) respond_to do |format| if @uniprot.save format.html { redirect_to @uniprot, notice: 'Uniprot was successfully created.' } format.json { render json: @uniprot, status: :created, location: @uniprot } else format.html { render...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @unp = Unp.new(params[:unp])\n\n respond_to do |format|\n if @unp.save\n format.html { redirect_to @unp, notice: 'Unp was successfully created.' }\n format.json { render json: @unp, status: :created, location: @unp }\n else\n format.html { render action: \"new\" }\...
[ "0.5621501", "0.5548818", "0.54935247", "0.5481052", "0.54493266", "0.5434987", "0.5429591", "0.5401746", "0.5401471", "0.5385279", "0.5324516", "0.53195345", "0.5311947", "0.52978057", "0.5262293", "0.5240733", "0.5227673", "0.5215766", "0.520483", "0.5194973", "0.5190889", ...
0.6368075
0
PUT /uniprots/1 PUT /uniprots/1.json
def update @uniprot = Uniprot.find(params[:id]) respond_to do |format| if @uniprot.update_attributes(params[:uniprot]) format.html { redirect_to @uniprot, notice: 'Uniprot was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @new_pro = NewPro.find(params[:id])\n\n respond_to do |format|\n if @new_pro.update_attributes(params[:new_pro])\n format.html { redirect_to @new_pro, notice: 'New pro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render act...
[ "0.6137402", "0.5983416", "0.5921866", "0.5905767", "0.5879377", "0.58742744", "0.5863611", "0.58470684", "0.58313704", "0.58280444", "0.5824384", "0.580485", "0.57670146", "0.5765323", "0.57610667", "0.5745044", "0.57383746", "0.56838995", "0.5682707", "0.5676542", "0.566284...
0.636404
0
DELETE /uniprots/1 DELETE /uniprots/1.json
def destroy @uniprot = Uniprot.find(params[:id]) @uniprot.destroy respond_to do |format| format.html { redirect_to uniprots_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @tuhu_prodoct.destroy\n respond_to do |format|\n format.html { redirect_to tuhu_prodocts_url, notice: 'Prodoct was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @produccion = Produccion.find(params[:id])\n @produccion.destroy\n\...
[ "0.68776006", "0.6748578", "0.6733896", "0.67069364", "0.67008746", "0.6684336", "0.6614855", "0.66051376", "0.65862477", "0.65795326", "0.6558158", "0.65568614", "0.6549761", "0.6542882", "0.6530855", "0.6530838", "0.6516836", "0.6511096", "0.6507633", "0.6500255", "0.649364...
0.7057375
0
Send announcements to slack
def slack @slack ||= Slack::Notifier.new Shepherd::Application.config.slack_api[:url], channel: Shepherd::Application.config.slack_api[:channel] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_to_slack(token, channel_id, report_data) \n Slack.configure do |config|\n config.token = token\n end\n\n client = Slack::Web::Client.new\n client.auth_test\n\n message_title = \"Standup Report\"\n\n send_message_to_channel(client, channel_id, message_title, report_data)\nend", "def post(tit...
[ "0.71033573", "0.7103303", "0.6873441", "0.67597026", "0.66372836", "0.6627392", "0.65919936", "0.65709955", "0.6569993", "0.64546716", "0.63766456", "0.6366195", "0.63268197", "0.6322263", "0.6313222", "0.631194", "0.6215291", "0.6204316", "0.618768", "0.616959", "0.6150757"...
0.57862157
38
Public: Initialize a new Message. args Hash of attributes of the message. block An optional block that can be used to build a new message using DSLlike syntax. Examples message = Mobitex::Message.new(:to => '48123456789', :body => 'Hello!') message = Mobitex::Message.new do to '48123456789' body 'Hello!' end message = ...
def initialize(*args, &block) @delivery_handler = nil @delivery_method = Mobitex.delivery_method.dup options = args.first.respond_to?(:each_pair) ? args.first : {} Configuration::VALID_OPTIONS.each do |key| send("#{key}=", options[key] || options[key.to_sym] || Configuration.instance.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def message(body: nil, to: nil, from: nil, method: nil, action: nil, status_callback: nil, **keyword_args)\n message = Message.new(\n body: body,\n to: to,\n from: from,\n method: method,\n action: action,\n status_callback: status_callback,\n *...
[ "0.6945445", "0.6799981", "0.6655902", "0.65940243", "0.6551946", "0.6420826", "0.6364688", "0.6348609", "0.63151526", "0.62963766", "0.62854904", "0.6250521", "0.6198297", "0.61739707", "0.610433", "0.608178", "0.6078023", "0.60393864", "0.6037454", "0.6031217", "0.60244423"...
0.60786086
16
reset transcript to it's original state Update Transcript update TranscriptLines delete TrancriptEdits for the transcript delete TranscriptSpeakerEdit for the transcript
def reset ActiveRecord::Base.transaction do reset_transcript reset_transcript_lines reset_transcript_edits reset_trasncript_speaker_edits end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_reset\n\t\t\n\t\t\t# Mark state as reset\n\t\t\t@reset = true\n\t\t\t\n\t\t\t# Revert text and palette\n\t\t\tself.text = nil \n\t\t\tself.palette = @palette_normal\t\t\t\n\t\tend", "def set_transcript\n @transcript = Transcript.find(params[:id])\n end", "def set_transcript\n @transcript = ...
[ "0.60478497", "0.5963738", "0.5963738", "0.59354067", "0.57740414", "0.5642915", "0.56395483", "0.55310965", "0.55310965", "0.5530763", "0.546828", "0.5442384", "0.543311", "0.54328483", "0.5408891", "0.54065144", "0.5367696", "0.53656024", "0.53656024", "0.5364641", "0.53009...
0.7470768
0
GET /tasks GET /tasks.json
def index @task = Task.new if params[:range].blank? @daterange = Date.today.beginning_of_month.strftime('%Y/%m/%d') + ' - ' + Date.today.end_of_month.strftime('%Y/%m/%d') else @daterange = params[:range] end @tasks = Task.between(@daterange).includes(:project) if params[:commit] == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tasks\n uri = URI(BASE_URL + TASKS_ENDPOINT)\n\n make_request(uri)\n end", "def tasks\n @todos = Todo.all\n render json: @todos\n end", "def index\n render json: {\n tasks: tasks.map(&:to_hash)\n }\n end", "def index\n @tasks = Task.all\n\n render json: @tasks\n end", "...
[ "0.7889543", "0.7751927", "0.7619872", "0.75984913", "0.75936216", "0.7505406", "0.7464987", "0.74337274", "0.7383206", "0.7344766", "0.7322099", "0.7322099", "0.7322099", "0.7303383", "0.7263056", "0.72467685", "0.72430325", "0.7233159", "0.7165631", "0.7160025", "0.713756",...
0.0
-1
GET /tasks/1 GET /tasks/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @task = Task.find(params[:id])\n\n render json: @task\n end", "def task(name)\n get \"#{base_url}/tasks/#{name}\"\n end", "def show\n render :json => Project.find(params[:project_id]).tasks.find(params[:id])\n end", "def show\n \n @task = @project.tasks.find(params[:i...
[ "0.76096785", "0.7555889", "0.7456459", "0.74471563", "0.73451596", "0.7336069", "0.7332103", "0.72564024", "0.7243799", "0.72252154", "0.72077334", "0.72030824", "0.72028416", "0.72028416", "0.72028416", "0.72028416", "0.72028416", "0.72028416", "0.72028416", "0.72028416", "...
0.0
-1
POST /tasks POST /tasks.json
def create @task = Task.new(task_params) respond_to do |format| if @task.save if params[:create_and_continue] format.html { redirect_to new_task_url, notice: 'Task was successfully created.' } else format.html { redirect_to tasks_url, notice: 'Task was successfully cre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n #@task = Task.new(task_params)\n task = @task_list.tasks.create!(task_params)\n render json: task\n end", "def create\n @task = Task.new(task_params)\n\n if @task.save\n render json: @task, status: :created\n else\n render json: @task.errors, status: :unprocessable_entit...
[ "0.7529737", "0.74976224", "0.7411092", "0.7389878", "0.7261207", "0.72587913", "0.7183996", "0.7147952", "0.71120256", "0.70759165", "0.70639485", "0.70576006", "0.70560944", "0.70294535", "0.7016957", "0.7012058", "0.70110804", "0.7009976", "0.6993863", "0.69896185", "0.698...
0.6737928
66
PATCH/PUT /tasks/1 PATCH/PUT /tasks/1.json
def update respond_to do |format| if @task.update(task_params) format.html { redirect_to @task, notice: 'Task was successfully updated.' } format.json { render :show, status: :ok, location: @task } else format.html { render :edit } format.json { render json: @task.errors,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\r\n @tasks = Task.find(params[:id])\r\n if @tasks.update(task_params)\r\n render json: @tasks\r\n else\r\n render json: @tasks.errors, status: :unprocessable_entity\r\n end\r\n end", "def update\n task = Task.find(params[:id])\n if task.update(t...
[ "0.7446562", "0.7293086", "0.7265396", "0.7265396", "0.71397257", "0.70778626", "0.70257324", "0.6966163", "0.6963022", "0.69535804", "0.6911542", "0.6907889", "0.6907889", "0.6907889", "0.6897803", "0.6897803", "0.6897803", "0.6897803", "0.6897803", "0.6897803", "0.6897803",...
0.6713498
70
DELETE /tasks/1 DELETE /tasks/1.json
def destroy @task.destroy respond_to do |format| format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_task id\n request :delete, \"tasks/#{id}\"\n nil\n end", "def delete_task\n @task = Task.find_by(id: params[:id])\n @task.destroy\n render :json => @task.as_json(:only => [:id])\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |f...
[ "0.78326327", "0.75876695", "0.7564121", "0.75633883", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7488168", "0.7488168", "0.7488168", "0.7488168", ...
0.7151728
96
Use callbacks to share common setup or constraints between actions.
def set_task @task = Task.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 task_params params.require(:task).permit(:name, :date, :starttime, :endtime, :project_id) 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
Used only for voting.
def update comment = Comment.find(params[:id]) # ratings will be 1 or -1. non numbers will conveniently translate to 0 comment.rating += params[:rating].to_i comment.save websockets = clients(controller: :discussions, id: comment.discussion_id) # p "NUMBER OF CLIENTS TO UPDATE: #{websockets.si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vote\n\tend", "def vote up\n end", "def voting_method\n VOTING_METHODS[self.voting_method_id]\n end", "def vote_up\n 15\n end", "def vote\n puts \"-----------------------------------------------\nSorry, voting system is currently not working\"\n \nend", "def post_votes\n []\n end",...
[ "0.6905395", "0.6608655", "0.6492294", "0.64389145", "0.639134", "0.6384183", "0.6327041", "0.6327041", "0.6327041", "0.630992", "0.6249005", "0.61725473", "0.6158447", "0.61545014", "0.6147177", "0.61327094", "0.6116712", "0.60826325", "0.60821366", "0.60749966", "0.60744", ...
0.0
-1
Generate a RandomNumber program that lets the user guess a random number rand(10) + 1 will return a random number between 1 and 10 Usage: ./warmup_02.rb I've picked a random number between 1 and 10. What is your guess? 5 Too High! What is your guess? 3 Too Low! What is your guess? 4 You got it in 3 guesses. Good job!
def guess(max_number) number_of_guesses = 0 correct_number = rand(max_number) + 1 guess = 0 puts "I've picked a random number between 1 and #{max_number}.\n\n" while (guess != correct_number) print "What is your guess? " guess = gets.chomp.to_i number_of_guesses += 1 if (guess > correct_number...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def guess_number_1\n random_number = rand(100) # rand gives random number between 0 and x-1\n puts \"Guess a number any number\"\nend", "def guess_number_2\n random_number = rand(100) # rand gives random number between 0 and x-1\n puts \"Guess a number any number\"\nend", "def run_guessing_game\n ...
[ "0.79080015", "0.77332807", "0.72438496", "0.72154", "0.71397024", "0.7075987", "0.6962652", "0.69218546", "0.6891901", "0.6835226", "0.6830538", "0.67933154", "0.67673594", "0.6758808", "0.67438847", "0.6707147", "0.6687615", "0.66805595", "0.66715324", "0.6669245", "0.66348...
0.6685688
17
0=>creado 1=>configurado 2=>con cuestionario 3=>confirmado
def state_label self.state == 3 ? "Confirmado" : "Borrador" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conf_universidad\n reset_session\n @valin = params['in']\n @alert = params['alert']\n valor = @valin.split(\"_\")\n cod = desencriptar(valor[0].to_i)\n id = desencriptar(valor[1].to_i)\n data = Usuario.find_by(cod_recovery: cod, id: id)\n if data.blank?\n redirect_to({:action=>\"in...
[ "0.5954218", "0.58820814", "0.5879895", "0.58652693", "0.58427703", "0.5753744", "0.5738454", "0.5692629", "0.56703824", "0.56615734", "0.5610344", "0.5596441", "0.5594319", "0.55772555", "0.5561904", "0.5525908", "0.55232334", "0.54908013", "0.5489248", "0.54823554", "0.5473...
0.5364345
34
GET /test_records GET /test_records.json
def index @test_records = TestRecord.where(:user_id => @current_user.id).order(created_at: :desc) @test_record = @test_record end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_records\n return error_response unless is_get_records_request?\n as_json\n end", "def listing\n tests = Test.where( user_id: test_params[:user_id] )\n all = TestSerializer.new.all_test(tests)\n return render json: all.as_json\n end", "def index\n @dummy_records = Dum...
[ "0.68814", "0.66473806", "0.655098", "0.6464924", "0.6402987", "0.63718057", "0.63668865", "0.62844896", "0.62437177", "0.611684", "0.6101751", "0.60444707", "0.6035131", "0.60255176", "0.60220414", "0.59859437", "0.5916318", "0.59161127", "0.59153473", "0.58910066", "0.58910...
0.6030368
13
GET /test_records/1 GET /test_records/1.json
def show @test_record = TestRecord.find(params[:id]) @test = Test.find_by_id(@test_record.test_id) session[:test_record] = @test_record.id respond_to do |format| format.html format.js end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_records\n return error_response unless is_get_records_request?\n as_json\n end", "def index\n @dummy_records = DummyRecord.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @dummy_records }\n end\n end", "def get_one\n te...
[ "0.65224737", "0.64760476", "0.64325166", "0.6251326", "0.61319643", "0.61216396", "0.61216015", "0.6102726", "0.60768116", "0.6068095", "0.60630476", "0.6057032", "0.605161", "0.59715843", "0.5942923", "0.5934088", "0.5915759", "0.58925265", "0.5887277", "0.5885489", "0.5873...
0.0
-1
POST /test_records POST /test_records.json
def create @test_record = TestRecord.new(test_record_params) respond_to do |format| if @test_record.save format.html { redirect_to @test_record, notice: 'Test record was successfully created.' } format.json { render :show, status: :created, location: @test_record } else fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_sample_traces\n header 'Content-Type', 'application/json'\n\n (0..4).each do |i|\n data = File.read \"sample-traces/#{i}.json\"\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n assert last_response.ok?\n end\n end", "def test_post_then_get\n header 'Content-...
[ "0.68736005", "0.61804223", "0.6168987", "0.61115533", "0.6060622", "0.5949695", "0.59023255", "0.5898824", "0.58660614", "0.58657616", "0.58277893", "0.58212614", "0.5815306", "0.57738274", "0.5756233", "0.57459146", "0.5729317", "0.5726208", "0.5647825", "0.5644253", "0.561...
0.6891704
0
PATCH/PUT /test_records/1 PATCH/PUT /test_records/1.json
def update respond_to do |format| if @test_record.update(test_record_params) format.html { redirect_to @test_record, notice: 'Test record was successfully updated.' } format.json { render :show, status: :ok, location: @test_record } else format.html { render :edit } forma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-T...
[ "0.6383902", "0.618346", "0.6057256", "0.6050495", "0.6043484", "0.6034891", "0.6018771", "0.5984147", "0.5970096", "0.5963631", "0.5928122", "0.5918487", "0.58936435", "0.58825296", "0.5882447", "0.58474594", "0.5804689", "0.5784626", "0.5778738", "0.57645375", "0.57568187",...
0.63406765
1
DELETE /test_records/1 DELETE /test_records/1.json
def destroy @test_record.destroy respond_to do |format| format.html { redirect_to test_records_url, notice: 'Test record was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON....
[ "0.7267971", "0.6915853", "0.68317395", "0.67183375", "0.6715136", "0.6691895", "0.66263884", "0.6607132", "0.6580058", "0.6579418", "0.6578201", "0.65539765", "0.65539765", "0.6551171", "0.6536254", "0.651439", "0.6497181", "0.6495974", "0.64886445", "0.64886445", "0.6488644...
0.7085315
1
Use callbacks to share common setup or constraints between actions.
def set_test_record @test_record = TestRecord.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 test_record_params params.fetch(:test_record, {}) params.require(:test_record).permit(:user_id, :test_id, :status, :start_date, :finish_time, :score, :purchased_date, :test_begin_photo, :test_end_photo) 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.6980957", "0.6783065", "0.6747844", "0.6741468", "0.67356336", "0.6592548", "0.65036845", "0.64978707", "0.64825076", "0.64795035", "0.64560914", "0.64397955", "0.6379666", "0.6376688", "0.6366702", "0.6319728", "0.6300833", "0.6300629", "0.6294277", "0.6293905", "0.629117...
0.0
-1
GET /roads/1 GET /roads/1.json
def show @road = Road.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @road } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @roads = Road.all\n end", "def show\n @mostsmallroad = Mostsmallroad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmallroad }\n end\n end", "def show\n @medium_road = MediumRoad.find(params[:id])\n\n respo...
[ "0.71458477", "0.7105162", "0.6980016", "0.6979757", "0.6943531", "0.68467283", "0.67241156", "0.6661562", "0.6511174", "0.63494", "0.6347818", "0.6310896", "0.6309319", "0.62812304", "0.6273642", "0.62688655", "0.6264557", "0.626024", "0.62481105", "0.61280286", "0.6117816",...
0.7722632
0
GET /roads/new GET /roads/new.json
def new @road = Road.new respond_to do |format| format.html # new.html.erb format.json { render json: @road } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @mini_map_road = MiniMapRoad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mini_map_road }\n end\n end", "def new\n @mostsmallroad = Mostsmallroad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { ...
[ "0.7631659", "0.76309234", "0.758195", "0.7574224", "0.7530297", "0.7394111", "0.7336576", "0.7336576", "0.7336576", "0.73358536", "0.7252092", "0.715859", "0.7108904", "0.70540977", "0.70372957", "0.6989967", "0.6987589", "0.6983505", "0.6983505", "0.69749427", "0.69749427",...
0.82702607
0
POST /roads POST /roads.json
def create @road = Road.new(params[:road]) respond_to do |format| if @road.save format.html { redirect_to @road, notice: 'Road was successfully created.' } format.json { render json: @road, status: :created, location: @road } else format.html { render action: "new" } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @road = Road.new(road_params)\n\n respond_to do |format|\n if @road.save\n format.html { redirect_to @road, notice: 'Road was successfully created.' }\n format.json { render :show, status: :created, location: @road }\n else\n format.html { render :new }\n fo...
[ "0.73740125", "0.67650515", "0.674056", "0.6624314", "0.65954626", "0.6577094", "0.6483776", "0.6314278", "0.63095003", "0.6280266", "0.6233016", "0.617114", "0.61679876", "0.6106962", "0.5978173", "0.5906087", "0.58790064", "0.5839494", "0.58185637", "0.57927144", "0.5770132...
0.73957497
0
PUT /roads/1 PUT /roads/1.json
def update @road = Road.find(params[:id]) respond_to do |format| if @road.update_attributes(params[:road]) format.html { redirect_to @road, notice: 'Road was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @road.update(road_params)\n format.html { redirect_to @road, notice: 'Road was successfully updated.' }\n format.json { render :show, status: :ok, location: @road }\n else\n format.html { render :edit }\n format.json { render json: @...
[ "0.7051911", "0.6633282", "0.65678775", "0.64669603", "0.6402101", "0.6343166", "0.6274116", "0.6274116", "0.6270203", "0.62382126", "0.62318844", "0.6223344", "0.61076117", "0.60755736", "0.6067895", "0.60504293", "0.59921277", "0.5963126", "0.59416896", "0.58728254", "0.584...
0.7231341
0
DELETE /roads/1 DELETE /roads/1.json
def destroy @road = Road.find(params[:id]) @road.destroy respond_to do |format| format.html { redirect_to roads_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @medium_road = MediumRoad.find(params[:id])\n @medium_road.destroy\n\n respond_to do |format|\n format.html { redirect_to medium_roads_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mostsmallroad = Mostsmallroad.find(params[:id])\n @mostsmallroad...
[ "0.7461137", "0.7449094", "0.7432126", "0.71752447", "0.71632594", "0.714366", "0.7142122", "0.7109841", "0.6927688", "0.6772552", "0.6761658", "0.6747224", "0.6743712", "0.6717594", "0.67017215", "0.670029", "0.6684139", "0.6682598", "0.6680155", "0.6647011", "0.66437787", ...
0.7872252
0
GET /radio_groups GET /radio_groups.json
def new @radio_group = RadioGroup.new authorize @radio_group end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_groups\n frm.radio(:id=>\"groups\").set\n end", "def index\n\t@radios = Radio.all\n respond_to do |format|\n format.json { render json: @radios, status: :ok }\n end\nend", "def index\n @groups = Group.all\n\n respond_to do |format|\n format.html\n format.json { render json:...
[ "0.6511048", "0.6456083", "0.6205195", "0.6184246", "0.61662525", "0.6134002", "0.61130047", "0.609279", "0.608771", "0.6085427", "0.60773534", "0.60773534", "0.6023644", "0.59977967", "0.5921092", "0.59198374", "0.58893216", "0.58840185", "0.58787805", "0.5876089", "0.585631...
0.57852036
31
GET /radio_groups/new GET /radio_groups/new.json
def edit; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @breadcrumb = 'create'\n @ratio_group = RatioGroup.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ratio_group }\n end\n end", "def create\n @radio_group = RadioGroup.new(params[:radio_group])\n\n respond_to do |form...
[ "0.755309", "0.72927743", "0.7263044", "0.7261111", "0.72416025", "0.72416025", "0.72416025", "0.72416025", "0.72416025", "0.72416025", "0.72416025", "0.72416025", "0.72386384", "0.7216458", "0.7191427", "0.71732557", "0.71732557", "0.7134435", "0.71301514", "0.7064212", "0.7...
0.0
-1
POST /radio_groups POST /radio_groups.json
def create @radio_group = RadioGroup.new radio_group_params authorize @radio_group flash.now[:notice] = 'Radio group was successfully created.' if @radio_group.save respond_with @radio_group end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @radio_group = RadioGroup.new(params[:radio_group])\n\n respond_to do |format|\n if @radio_group.save\n format.html { redirect_to(@radio_group, :notice => 'Radio group was successfully created.') }\n format.xml { render :xml => @radio_group, :status => :created, :location => ...
[ "0.6852723", "0.65394074", "0.62854743", "0.60722536", "0.6005272", "0.59700644", "0.59333867", "0.5924714", "0.58970577", "0.5851252", "0.5849577", "0.5826475", "0.5804", "0.5765343", "0.5748695", "0.5737072", "0.5737072", "0.57278526", "0.5693503", "0.5654808", "0.56510794"...
0.68495136
1
PUT /radio_groups/1 PUT /radio_groups/1.json
def update if @radio_group.update radio_group_params flash.now[:notice] = 'Radio group was successfully updated.' end respond_with @radio_group end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @radio_group = RadioGroup.find(params[:id])\n\n respond_to do |format|\n if @radio_group.update_attributes(params[:radio_group])\n format.html { redirect_to(@radio_group, :notice => 'Radio group was successfully updated.') }\n format.xml { head :ok }\n else\n form...
[ "0.7107325", "0.6549735", "0.6421569", "0.6221669", "0.60891557", "0.6088377", "0.60723734", "0.607057", "0.6065074", "0.6049953", "0.5989555", "0.5981869", "0.5975079", "0.59132075", "0.59076726", "0.5895199", "0.58801067", "0.5801867", "0.57868755", "0.57570684", "0.5752020...
0.7231785
0
DELETE /radio_groups/1 DELETE /radio_groups/1.json
def destroy @radio_group.destroy respond_with @radio_group, location: radio_groups_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @radio_group = RadioGroup.find(params[:id])\n @radio_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(radio_groups_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @radio = Radio.find(params[:id])\n @radio.destroy\n respond_to do |format|\...
[ "0.76463753", "0.72448", "0.70316434", "0.702294", "0.6967199", "0.6967199", "0.69484544", "0.6865038", "0.6741285", "0.6667165", "0.66456014", "0.6644685", "0.66411537", "0.66388416", "0.6627469", "0.6625584", "0.66108805", "0.66108805", "0.6599525", "0.6599525", "0.6599525"...
0.76645476
0
GET /documents GET /documents.json
def index @documents = Document.all 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.6671473
51
GET /documents/1 GET /documents/1.json
def show respond_to do |format| format.html format.pdf do render pdf: @document.name, template: "documents/plain.pdf.erb", locals: {:document => @document}, layout: 'layouts/application.pdf.erb', :margin => { :bottom => 45, :top => 66, :left => 0, :right=>0 }, ...
{ "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
with footer, title document
def show_title respond_to do |format| format.html format.pdf do render pdf: @document.name , template: "layouts/title.html.erb", locals: {:document => @document}, layout: 'layouts/application.pdf.erb', :margin => { :bottom => 0, :top => 0, :left => 0, :right =>0 }, show_a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def header_and_footer\n @title = _'Labvirt'\n @footer = _'Something nice should go down here...'\n end", "def footer\n end", "def add_footer=(_arg0); end", "def build_footer\n pad(10) do\n pdf_writer.y = pdf_writer.absolute_bottom_margin + 10\n add_text \"Copyright 2010 - Sand Br...
[ "0.7004243", "0.680803", "0.6799906", "0.6533892", "0.6533892", "0.6533892", "0.6281186", "0.6281186", "0.6262334", "0.6260784", "0.62520576", "0.6245519", "0.62311214", "0.6164288", "0.6157346", "0.61571306", "0.613329", "0.6116487", "0.6094517", "0.6044731", "0.6011483", ...
0.0
-1
without footer, plain document
def show_green_corner respond_to do |format| format.html format.pdf do render pdf: @document.name , template: "documents/plain.pdf.erb", locals: {:document => @document}, layout: 'layouts/application.pdf.erb', :margin => { :bottom => 45, :top => 66, :left => 0 }, header: {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_document\n\tprint_header\n\tprint_document\n\tprint_footer\nend", "def start_document; end", "def start_document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end"...
[ "0.7100432", "0.68752366", "0.68752366", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216",...
0.0
-1
without footer, plain document
def show_plain respond_to do |format| format.html format.pdf do render pdf: @document.name, template: "documents/plain.pdf.erb", locals: {:document => @document}, layout: 'layouts/application.pdf.erb', :margin => { :bottom => 45, :top => 66, :left => 0 }, header: { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_document\n\tprint_header\n\tprint_document\n\tprint_footer\nend", "def start_document; end", "def start_document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end"...
[ "0.7100432", "0.68752366", "0.68752366", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216", "0.67781216",...
0.57663053
70
POST /documents POST /documents.json
def create @document = Document.new(document_params) respond_to do |format| if @document.save if @document.show_pdf_type == "Plain" format.html { redirect_to id: @document, action: 'show_plain', format: 'pdf' } elsif @document.show_pdf_type == "Document" format.html...
{ "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.72675", "0.72270125", "0.7202067", "0.7202067", "0.71927583", "0.71516854", "0.7137915", "0.71379024", "0.712435", "0.7049302", "0.68928266", "0.6876889", "0.6837602", "0.6818319", "0.68161947", "0.6751123", "0.67454964", "0.6734003", "0.6723543", "0.66879636", "0.6685973"...
0.0
-1
PATCH/PUT /documents/1 PATCH/PUT /documents/1.json
def update respond_to do |format| if @document.update(document_params) # format.html { redirect_to id: @document, action: 'show', format: 'pdf' } if @document.show_pdf_type == "Plain" format.html { redirect_to id: @document, action: 'show_plain', format: 'pdf' } elsif @do...
{ "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.70415807", "0.6928848", "0.6853448", "0.6813872", "0.6812295", "0.6795494", "0.67924744", "0.677597", "0.677597", "0.677597", "0.6772859", "0.6748014", "0.67393625", "0.6724304", "0.67236394", "0.6705887", "0.6704051", "0.66894454", "0.66894454", "0.66894454", "0.6686796",...
0.0
-1
DELETE /documents/1 DELETE /documents/1.json
def destroy @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.7229978
43
Use callbacks to share common setup or constraints between actions.
def set_document @document = Document.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 document_params params.require(:document).permit(:name, :client, :body_text, :file_date, :footer, :show_pdf_type) 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.6980957", "0.6783065", "0.6747844", "0.6741468", "0.67356336", "0.6592548", "0.65036845", "0.64978707", "0.64825076", "0.64795035", "0.64560914", "0.64397955", "0.6379666", "0.6376688", "0.6366702", "0.6319728", "0.6300833", "0.6300629", "0.6294277", "0.6293905", "0.629117...
0.0
-1
A new instance of Gricer::Config. Configure options can be passed in a block.
def initialize(&block) configure(&block) if block_given? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config(&block)\n instance_eval(&block) if block_given?\n end", "def config(&block)\n if block_given?\n c = Config.new\n c.instance_eval(&block)\n @config = c\n end\n\n @config ||= Config.new\n end", "def config(&block)\n if block_given?\n @@config ...
[ "0.7842633", "0.7821714", "0.76513386", "0.7636558", "0.76221097", "0.75244176", "0.75244176", "0.75215274", "0.75151336", "0.74791884", "0.74407965", "0.7400547", "0.7396955", "0.73781717", "0.73781717", "0.73707175", "0.73353595", "0.73313504", "0.7284416", "0.7275677", "0....
0.7112893
41
Configure your Gricer Rails Engine with the given parameters in the block. For possible options see Instance Attributes.
def configure(&block) yield(self) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure(&block)\n self.instance_eval(&block)\n end", "def configure(&block)\n self.instance_eval(&block) if block_given?\n end", "def configure(&block)\n instance_eval(&block)\n end", "def configure(&block)\n instance_eval(&block)\n end", "def configure &block\n\t\tins...
[ "0.6784512", "0.6780554", "0.67591405", "0.67591405", "0.67345935", "0.66418195", "0.6589332", "0.65070504", "0.6496306", "0.6496306", "0.6430142", "0.6380303", "0.6369579", "0.6361816", "0.6360516", "0.63413966", "0.63096356", "0.62885565", "0.62377894", "0.62350273", "0.620...
0.60552335
48
The prefix for table names of gricer database tables. Default value is 'gricer_'
def table_name_prefix @table_name_prefix ||= 'gricer_' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def table_name_prefix; end", "def table_name_prefix\n \"ext_#{self.registered_name.to_s.underscore}_\"\n end", "def roomer_full_table_name_prefix(schema_name)\n \"#{schema_name.to_s}#{Roomer.schema_seperator}\"\n end", "def table_name_prefix(model)\n return model::Base.tabl...
[ "0.80942893", "0.7722725", "0.7681433", "0.7583201", "0.75324774", "0.7264514", "0.720212", "0.71805924", "0.7137219", "0.6965972", "0.6866644", "0.6824141", "0.681711", "0.6764411", "0.67458713", "0.67335606", "0.67273206", "0.6712029", "0.670987", "0.66413087", "0.66405153"...
0.88935685
0
Configure the prefix for admin pages paths Default value is 'gricer'
def admin_prefix @admin_prefix.blank? ? 'gricer' : @admin_prefix end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prefix(options={})\n default = site.path\n default << '/' unless default[-1..-1] == '/'\n self.prefix = default\n prefix(options)\n end", "def path_prefix=(value); end", "def path_prefix\n @path_prefix ||= '/'\n end", "def nav\n 'nav_admin'\n end", "def admi...
[ "0.6827761", "0.6204942", "0.6127032", "0.596859", "0.5956257", "0.59324753", "0.59300816", "0.5908139", "0.5908072", "0.5890855", "0.5890855", "0.5888765", "0.5882896", "0.5875923", "0.5851806", "0.58316594", "0.5824542", "0.58021384", "0.5770377", "0.5752708", "0.5733188", ...
0.8094265
0
Configure to use another layout than the application default for Gricer controllers Default value is nil
def admin_layout @admin_layout end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_layout\n if 1==1\n 'application'\n else\n 'dean'\n end\n end", "def default_layout\n site.config.page_layout\n end", "def default_layout\n nil\n end", "def default_layout\n 'default' if html?\n end", "def set_layout\n if %w( print plain ).include? params[...
[ "0.8415202", "0.79077345", "0.78848803", "0.7868949", "0.7663965", "0.75976974", "0.75695837", "0.7499185", "0.7491608", "0.74757254", "0.7435235", "0.74113035", "0.7411299", "0.74022526", "0.73720425", "0.73542964", "0.73497", "0.73434216", "0.7296102", "0.72438025", "0.7216...
0.6431851
93
Configure the structure of Gricer's admin menu Default value see source
def admin_menu @admin_menu ||= [ ['overview', :dashboard, {controller: 'gricer/dashboard', action: 'overview'}], ['visitors', :menu, [ ['entry_pages', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'entry_path'}], ['referers', :spread, {controller: 'gr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main_menu\n h = {\n a: :ag,\n z: :z_interface,\n # f: :file_actions,\n b: :bookmark_menu,\n c: :create_menu,\n f: :filter_menu,\n o: :order_menu,\n s: :selection_menu,\n t: :toggle_menu,\n v: :view_menu,\n '`' => :goto_parent_dir,\n x: :extras\n }\n menu 'Main Menu', h\n...
[ "0.66448885", "0.6585077", "0.6390173", "0.6372529", "0.63679826", "0.63012296", "0.6285788", "0.6269507", "0.6222167", "0.6211009", "0.6210531", "0.6206594", "0.617184", "0.61708874", "0.6166922", "0.6142254", "0.6141835", "0.612159", "0.61058253", "0.61047447", "0.6104013",...
0.6807771
0
Configure page urls matching this Expression to be excluded from being tracked in Gricer statistics Default is to exclude the admin pages
def exclude_paths @exclude_paths ||= /^#{admin_prefix}$/ end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ignore_urls\n @url_rules.reject\n end", "def set_exclude_from_analytics\n @exclude_from_analytics = request.env['HTTP_USER_AGENT'].try(:match, /http/i) || request.remote_ip == \"68.108.56.31\" || (!current_user.nil? && current_user.email.match(/bluefields.com/i))\n end", "def filter_private_pag...
[ "0.6456261", "0.58706784", "0.580636", "0.57335883", "0.5636094", "0.557285", "0.5547181", "0.5520241", "0.5502317", "0.5498183", "0.5455054", "0.5285901", "0.52542275", "0.52458245", "0.5234754", "0.52225107", "0.5199882", "0.51997274", "0.5196723", "0.51715183", "0.5159603"...
0.5986263
1
Configure the data file used by GeoIP If you configure geoip_db this property will be ignored. Default is no data file given.
def geoip_dat @geoip_dat end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geoip_path\n \"#{Rails.root}/db/res/GeoIP.dat\"\n end", "def set_data_file_path(data_file_path)\n PureHailDB.ib_cfg_set(\"data_file_path\", :string, data_file_path)\n end", "def geoip_db \n @geoip_db ||= geoip_dat ? GeoIP::City.new(geoip_dat, :index, false) : nil\n end", "def default_...
[ "0.6598422", "0.6168267", "0.5853105", "0.5748127", "0.5718079", "0.5691812", "0.56885266", "0.5636325", "0.5607044", "0.55128723", "0.5489291", "0.54808265", "0.5459354", "0.5390814", "0.5385072", "0.53845316", "0.537316", "0.5340109", "0.53365844", "0.53365844", "0.5323063"...
0.51847285
27
Configure the database instance used by GeoIP Default is none GeoIP database configured
def geoip_db @geoip_db ||= geoip_dat ? GeoIP::City.new(geoip_dat, :index, false) : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def database(loc)\n @db = GeoIPCity::Database.new(loc, :filesystem)\n end", "def database(options = nil)\n unless options.nil?\n @database = options\n ::DataMapper.setup(:default, @database)\n end\n @database\n end", "def setup!\n ActiveRecord::Base.configurations[c...
[ "0.67741215", "0.63840115", "0.63620156", "0.6354106", "0.6331464", "0.6273962", "0.6269629", "0.6269629", "0.60842526", "0.6054013", "0.60205024", "0.601701", "0.6008095", "0.600572", "0.5988313", "0.5951083", "0.59494317", "0.59349614", "0.59349614", "0.5905202", "0.5904020...
0.69286484
0