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 |
|---|---|---|---|---|---|---|
GET /host_states/1 GET /host_states/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @host_states = HostState.all\n end",
"def get_state\n @states = State.find_state(params[:id])\n respond_to do |format|\n format.json { render :json => @states }\n end\n end",
"def index\n @api_states = Api::State.all\n end",
"def get_states\n perform(:get, 'en... | [
"0.74115807",
"0.7052342",
"0.6925709",
"0.68751335",
"0.6613906",
"0.658993",
"0.65271866",
"0.6340429",
"0.6340429",
"0.63083714",
"0.62982845",
"0.6280394",
"0.6256599",
"0.6256599",
"0.6256599",
"0.6256599",
"0.6256599",
"0.62221545",
"0.6188102",
"0.61712134",
"0.6162728... | 0.0 | -1 |
POST /host_states POST /host_states.json | def create
@host_state = HostState.new(host_state_params)
respond_to do |format|
if @host_state.save
format.html { redirect_to @host_state, notice: 'Host state was successfully created.' }
format.json { render :show, status: :created, location: @host_state }
else
format.html { render :new }
format.json { render json: @host_state.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def host_state_params\n params.require(:host_state).permit(:name)\n end",
"def create\n @project_states = ProjectState.create!(project_state_params)\n json_response(@project_states, :created)\n end",
"def index\n @host_states = HostState.all\n end",
"def create\n @api_state = Api::State... | [
"0.654604",
"0.63822395",
"0.6341647",
"0.6176897",
"0.6072829",
"0.60607713",
"0.60364217",
"0.59012187",
"0.589734",
"0.584827",
"0.58350354",
"0.58149356",
"0.57847863",
"0.57847863",
"0.5740959",
"0.57045966",
"0.56913495",
"0.56911147",
"0.5685016",
"0.56608015",
"0.5640... | 0.728463 | 0 |
PATCH/PUT /host_states/1 PATCH/PUT /host_states/1.json | def update
respond_to do |format|
if @host_state.update(host_state_params)
format.html { redirect_to @host_state, notice: 'Host state was successfully updated.' }
format.json { render :show, status: :ok, location: @host_state }
else
format.html { render :edit }
format.json { render json: @host_state.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @api_state = Api::State.find(params[:id])\n\n if @api_state.update(api_state_params)\n head :no_content\n else\n render json: @api_state.errors, status: :unprocessable_entity\n end\n end",
"def doUpdate(startState)\n if (new_resource.rackID.nil? || new_resource.rackID.empty?)... | [
"0.6497511",
"0.64649504",
"0.6267247",
"0.60965145",
"0.6086928",
"0.6080035",
"0.5969168",
"0.5969168",
"0.5962687",
"0.5962687",
"0.5962687",
"0.59392345",
"0.593494",
"0.58545715",
"0.581591",
"0.5802865",
"0.5795398",
"0.57630813",
"0.57114613",
"0.5705047",
"0.5684276",... | 0.7084269 | 0 |
DELETE /host_states/1 DELETE /host_states/1.json | def destroy
@host_state.destroy
respond_to do |format|
format.html { redirect_to host_states_url, notice: 'Host state was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @state.destroy\n respond_to do |format|\n format.html { redirect_to states_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @state = State.find(params[:id])\n @state.destroy\n\n respond_to do |format|\n format.html { redirect_to states_url }\n ... | [
"0.7050063",
"0.69603527",
"0.69603527",
"0.6844968",
"0.682533",
"0.682533",
"0.6792103",
"0.67317134",
"0.6710184",
"0.6671888",
"0.6667248",
"0.6662834",
"0.6634493",
"0.6606606",
"0.65867525",
"0.6580446",
"0.6539016",
"0.65047234",
"0.64885247",
"0.64866644",
"0.6475302"... | 0.7547102 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_host_state
@host_state = HostState.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 host_state_params
params.require(:host_state).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 |
GET /warehouse_lists GET /warehouse_lists.xml | def index
@warehouse_lists = get_warehouse_lists(:page => params[:page])
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @warehouse_lists }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @warehouse_list = WarehouseList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @warehouse_list }\n end\n end",
"def index\n @list = List.find(params[:list_id])\n @list_items = @list.list_items.find(:all)\n\n respon... | [
"0.7143045",
"0.68311036",
"0.6796568",
"0.66165483",
"0.6465858",
"0.64015865",
"0.63735044",
"0.6365254",
"0.6299561",
"0.6297443",
"0.6289316",
"0.6277761",
"0.61959577",
"0.6194372",
"0.6188527",
"0.61832726",
"0.61490804",
"0.61489165",
"0.6148731",
"0.6147261",
"0.61342... | 0.78969884 | 0 |
GET /warehouse_lists/1 GET /warehouse_lists/1.xml | def show
@warehouse_list = WarehouseList.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @warehouse_list }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @warehouse_lists = get_warehouse_lists(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @warehouse_lists }\n end\n end",
"def index\n @list = List.find(params[:list_id])\n @list_items = @list.list_items.find(:al... | [
"0.78040993",
"0.6989726",
"0.67724437",
"0.6578505",
"0.6502015",
"0.64768416",
"0.6421959",
"0.64177686",
"0.6362747",
"0.63504845",
"0.6283207",
"0.626409",
"0.62463486",
"0.62199175",
"0.62149996",
"0.6178516",
"0.61613166",
"0.61356306",
"0.6131409",
"0.6109113",
"0.6082... | 0.74691695 | 1 |
GET /warehouse_lists/new GET /warehouse_lists/new.xml | def new
@warehouse_list = WarehouseList.new
@customers = Customer.all(:order => "name")
@customer = Customer.new
@products = Product.all(:order => "name,spec")
3.times { @warehouse_list.warehouse_list_items.build }
respond_to do |format|
format.js
format.html # new.html.erb
format.xml { render :xml => @warehouse_list }
end
rescue ActiveRecord::RecordNotFound # Kicks in if related asset was not found.
respond_to_related_not_found(model, :js) if model
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n\t\t@list = List.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml\t{ render :xml => @list }\n\t\tend\n\tend",
"def new\n @thing_list = ThingList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing_list }\n... | [
"0.7018633",
"0.70162207",
"0.7008626",
"0.69832104",
"0.68971634",
"0.68905205",
"0.68689895",
"0.6863876",
"0.6840788",
"0.6794133",
"0.67395264",
"0.6720193",
"0.67079693",
"0.67011034",
"0.669366",
"0.66740865",
"0.66705793",
"0.66705793",
"0.66705793",
"0.66622686",
"0.6... | 0.63278407 | 61 |
POST /warehouse_lists POST /warehouse_lists.xml | def create
@warehouse_list = WarehouseList.new(params[:warehouse_list])
@customer = Customer.save_for_warehouse_list(params)
@warehouse_list.customer_id = @customer.id
respond_to do |format|
if @warehouse_list.save
@warehouse_lists = get_warehouse_lists
get_data_for_sidebar
format.js
format.html { redirect_to(@warehouse_list) }
format.xml { render :xml => @warehouse_list, :status => :created, :location => @warehouse_list }
else
@customers = Customer.all(:order => "name")
@products = Product.all(:order => "name,spec")
unless params[:customer][:id].blank?
@customer = Customer.find(params[:customer][:id])
else
if request.referer =~ /\/customers\/(.+)$/
@customer = Customer.find($1) # related customer
else
@acustomer = Customer.new
end
end
format.js
format.html { render :action => "new" }
format.xml { render :xml => @warehouse_list.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @wellist = Wellist.new(wellist_params)\n\n if @wellist.save\n render json: @wellist, status: :created, location: @wellist\n else\n render json: @wellist.errors, status: :unprocessable_entity\n end\n end",
"def create_list(params={})\n @obj.post('create-list', @auth.merge(... | [
"0.6684553",
"0.66708857",
"0.6340397",
"0.62764144",
"0.6275581",
"0.6235567",
"0.6208683",
"0.6176153",
"0.61346126",
"0.6114738",
"0.61128765",
"0.61101836",
"0.6091015",
"0.60893077",
"0.6058783",
"0.60430133",
"0.6008604",
"0.5997881",
"0.59887356",
"0.59887356",
"0.5972... | 0.61300457 | 9 |
PUT /warehouse_lists/1 PUT /warehouse_lists/1.xml | def update
@warehouse_list = WarehouseList.find(params[:id])
@customer = Customer.save_for_warehouse_list(params)
@warehouse_list.customer_id = @customer.id
respond_to do |format|
if @warehouse_list.update_attributes(params[:warehouse_list])
get_data_for_sidebar if called_from_index_page?
format.js
format.html { redirect_to(@warehouse_list) }
format.xml { head :ok }
else
@customers = Customer.all(:order => "name")
@products = Product.all(:order => "name,spec")
if @warehouse_list.customer
@customer = Customer.find(@warehouse_list.customer.id)
else
@customer = Customer.new
end
format.js
format.html { render :action => "edit" }
format.xml { render :xml => @warehouse_list.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_list(id, list)\n record \"/todos/update_list/#{id}\", :list => list\n end",
"def update_list(list_id, name)\n data = {\n list: {\n name: name\n }\n }\n rest(\"patch\", \"lists/#{list_id}\", data)\n end",
"def update\n @wellist = Wellist.find(params[:id])\n\n if @... | [
"0.65312403",
"0.651661",
"0.6412526",
"0.6272228",
"0.62439203",
"0.62073153",
"0.61909777",
"0.61448526",
"0.6122082",
"0.61196214",
"0.6118115",
"0.61169535",
"0.61169535",
"0.6116812",
"0.61163366",
"0.61012685",
"0.6094728",
"0.60798913",
"0.6077888",
"0.6077559",
"0.606... | 0.604637 | 24 |
DELETE /warehouse_lists/1 DELETE /warehouse_lists/1.xml | def destroy
@warehouse_list = WarehouseList.find(params[:id])
@warehouse_list.destroy if @warehouse_list
respond_to do |format|
format.js { respond_to_destroy(:ajax) }
format.html { respond_to_destroy(:html) }
format.xml { head :ok }
end
rescue ActiveRecord::RecordNotFound
respond_to_not_found(:html, :js, :xml)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_list(list_id)\n rest(\"delete\", \"lists/#{list_id}\")\n\n return true\n end",
"def destroy\n @mylist = Mylist.find(params[:id])\n @mylist.destroy\n\n respond_to do |format|\n format.html { redirect_to(mylists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy... | [
"0.6606977",
"0.6593074",
"0.65571195",
"0.6547252",
"0.65350497",
"0.6533649",
"0.6525709",
"0.64876723",
"0.6481481",
"0.64744043",
"0.64740044",
"0.64667594",
"0.64636606",
"0.6449062",
"0.64387345",
"0.6422095",
"0.64169186",
"0.6357732",
"0.634697",
"0.6319635",
"0.63142... | 0.624306 | 32 |
this is where parameters are taken when the command is called | def initialize(device_uuid, secret)
@device_uuid = device_uuid
@secret = secret
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cmdarg; end",
"def cmdarg; end",
"def cmdarg; end",
"def command; end",
"def command; end",
"def command; end",
"def command; end",
"def command; end",
"def command; end",
"def cmd; end",
"def command_builder; end",
"def command_name=(_arg0); end",
"def commands; end",
"def arguments;... | [
"0.76458204",
"0.76458204",
"0.76458204",
"0.7218767",
"0.7218767",
"0.7218767",
"0.7218767",
"0.7218767",
"0.7218767",
"0.69253933",
"0.685244",
"0.6834739",
"0.68273985",
"0.67915624",
"0.67915624",
"0.67915624",
"0.67661494",
"0.67661494",
"0.67661494",
"0.6757295",
"0.673... | 0.0 | -1 |
The other coordinate is smaller only when it's in first quarter based on current coordinate | def <=>(other)
if x_param == other.x_param && y_param == other.y_param
0
elsif other.x_param <= x_param && other.y_param <= y_param
1
else
-1
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lookup_quarter(x, y)\n return 1 if x >= 0 && y <= -1\n return 2 if x < 0 && y <= -1\n return 3 if x < 0 && y > -1\n return 4\n end",
"def min_value_quarter_sheet(value)\n only_values = self.class.only_values\n min = only_values.first\n only_values.each do |only_value|\n ... | [
"0.661567",
"0.5715831",
"0.56116825",
"0.5479185",
"0.5454377",
"0.5438296",
"0.5438067",
"0.5388649",
"0.53784883",
"0.53659296",
"0.5359253",
"0.5306278",
"0.530079",
"0.52997184",
"0.5277799",
"0.5276029",
"0.5266987",
"0.52605104",
"0.52414113",
"0.52353823",
"0.5228379"... | 0.0 | -1 |
Iterates until reaches coordinate | def each_until(coordinate)
raise UnexpectedUntilCoordinate if coordinate < self
(y_param..coordinate.y).each do |j|
(x_param..coordinate.x).each do |i|
yield(Coordinate.new(i, j))
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def loop\n measurement = yield @position\n\n while true do\n position = control measurement\n\n measurement = yield position\n end\n end",
"def get_next_coords_with_check(rv_inst)\n x, y = next_step(rv_inst)\n return false unless within_boundary?(x, y)\n [x, y]\n end",
"def each\n... | [
"0.6523282",
"0.6360793",
"0.6354928",
"0.63234884",
"0.63194156",
"0.631505",
"0.6284666",
"0.6135726",
"0.60872346",
"0.6002506",
"0.5974839",
"0.5931942",
"0.58962446",
"0.5892695",
"0.58629024",
"0.5848547",
"0.5833824",
"0.5828226",
"0.5788702",
"0.577835",
"0.57647467",... | 0.7370368 | 0 |
def user_project_participation(project_id) self.participants.where(project_id: project_id).first end | def current_project_participant(project_id)
# if self.has_accepted?(project_id)
Participant.where(project_id: project_id, user_id: self.id).first
# end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def project_membership_for(project)\n ProjectMembership.where(:user_id => self.id , :project_id => project.id ).first\n end",
"def set_project_participant\n @project_participant = ProjectParticipant.find(params[:id])\n end",
"def team_member_by_id(user_id)\n users_projects.find_by_user_id(user_i... | [
"0.73596805",
"0.6996389",
"0.6979085",
"0.69536024",
"0.6896722",
"0.67803675",
"0.674018",
"0.66495156",
"0.66357595",
"0.6621383",
"0.65551883",
"0.6523127",
"0.6487788",
"0.6459968",
"0.6458519",
"0.64512056",
"0.6442027",
"0.6372113",
"0.6370301",
"0.6370301",
"0.6363528... | 0.8785469 | 0 |
overrides the response for login (POST /auth/sign_in) | def render_create_success
render json: UserSerializer.new(@resource, include: [:roles]).serialized_json
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n respond_to do |format|\n format.html { super }\n format.json {render :json => {:success => false, :errors => {:message => I18n.t('session.sign_in.failed.message'),\n :reason => I18n.t('session.sign_in.failed.wrong_password')}}... | [
"0.6944364",
"0.682541",
"0.67671",
"0.67313886",
"0.67197853",
"0.66121066",
"0.6608107",
"0.65838295",
"0.6577535",
"0.6480334",
"0.6438396",
"0.6434034",
"0.64292264",
"0.64290094",
"0.6408391",
"0.639902",
"0.6366977",
"0.6338295",
"0.6318638",
"0.6314633",
"0.63138086",
... | 0.0 | -1 |
GET /electronic_prescriptions/1 GET /electronic_prescriptions/1.json | def show
PhxErxProcessor.parse_erx_file @electronic_prescription
render :edit
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_electronic_prescription\n @electronic_prescription = ElectronicPrescription.find(params[:id])\n end",
"def index\n @prescriptions = Prescription.all\n end",
"def index\n # @prenotations = Prenotation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json... | [
"0.6285052",
"0.59483534",
"0.57002324",
"0.56890583",
"0.56842476",
"0.56371576",
"0.5618511",
"0.56046486",
"0.5578423",
"0.550097",
"0.54844314",
"0.54687935",
"0.5455063",
"0.5425719",
"0.5418331",
"0.5410704",
"0.5399116",
"0.5393933",
"0.53831005",
"0.5377472",
"0.53602... | 0.5178608 | 50 |
POST /electronic_prescriptions POST /electronic_prescriptions.json | def create
electronic_prescription_params[:status] = electronic_prescription_params[:status].to_i
@electronic_prescription = ElectronicPrescription.new(electronic_prescription_params)
respond_to do |format|
if @electronic_prescription.save
format.html { redirect_to @electronic_prescription, notice: 'Electronic prescription was successfully created.' }
format.json { render :show, status: :created, location: @electronic_prescription }
else
format.html { render :new }
format.json { render json: @electronic_prescription.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_electronic_prescription\n @electronic_prescription = ElectronicPrescription.find(params[:id])\n end",
"def create\n @patient = Patient.find(params[:patient_id])\n @prescription = @patient.prescriptions.build(prescription_params)\n @prescription.formulary_status = FORMULARY_STATUSES.sampl... | [
"0.6454775",
"0.6200591",
"0.61784387",
"0.57580733",
"0.57375103",
"0.56991684",
"0.5672648",
"0.56177115",
"0.56099194",
"0.55871487",
"0.5541126",
"0.55156654",
"0.5419449",
"0.5417522",
"0.5398359",
"0.5385897",
"0.53522325",
"0.53424793",
"0.5315568",
"0.5310835",
"0.530... | 0.6846904 | 0 |
PATCH/PUT /electronic_prescriptions/1 PATCH/PUT /electronic_prescriptions/1.json | def update
electronic_prescription_params[:status] = electronic_prescription_params[:status].to_i
respond_to do |format|
if @electronic_prescription.update(electronic_prescription_params)
format.html { redirect_to @electronic_prescription, notice: 'Electronic prescription was successfully updated.' }
format.json { render :show, status: :ok, location: @electronic_prescription }
else
format.html { render :edit }
format.json { render json: @electronic_prescription.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_electronic_prescription\n @electronic_prescription = ElectronicPrescription.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @prescription.update(prescription_params)\n format.html { redirect_to @prescription, notice: 'Prescription was successfully updated.' }\n ... | [
"0.5922881",
"0.58994466",
"0.585252",
"0.58353597",
"0.58185875",
"0.5803188",
"0.5802312",
"0.5777868",
"0.5719064",
"0.5700488",
"0.56282824",
"0.5626181",
"0.56121945",
"0.5609578",
"0.5609193",
"0.55819356",
"0.5573889",
"0.5572505",
"0.5549453",
"0.5548523",
"0.55394995... | 0.65522915 | 0 |
DELETE /electronic_prescriptions/1 DELETE /electronic_prescriptions/1.json | def destroy
@electronic_prescription.destroy
respond_to do |format|
format.html { redirect_to electronic_prescriptions_url, notice: 'Electronic prescription was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @prescription.destroy\n respond_to do |format|\n format.html { redirect_to prescriptions_url, notice: 'Prescription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_aos_version(a... | [
"0.66685146",
"0.66485566",
"0.66148996",
"0.65510267",
"0.65432596",
"0.65199184",
"0.6503917",
"0.64740396",
"0.6459258",
"0.64404917",
"0.6439363",
"0.64307564",
"0.6426494",
"0.6418418",
"0.6417049",
"0.64164597",
"0.6397672",
"0.63815844",
"0.63809764",
"0.63780427",
"0.... | 0.7207343 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_electronic_prescription
@electronic_prescription = ElectronicPrescription.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 electronic_prescription_params
params.require(:electronic_prescription).permit(:transmission_number, :prescriber_spi_number, :prescriber_order_number, :prescriber_reference_number, :prescriber_reference_number_qualifier, :prescriber_clinic_name_extended, :prescriber_service_location, :prescriber_facility_qualifier, :prescriber_facility_code, :prescriber_claim_frequency, :prescriber_specialty, :prescriber_agency_qualifier, :prescriber_specialty_code, :prescriber_last_name, :prescriber_first_name, :prescriber_middle_name, :prescriber_suffix, :prescriber_prefix, :prescriber_zip_code, :prescriber_clinic_name, :prescriber_clinic_address1, :prescriber_clinic_address2, :prescriber_clinic_city, :prescriber_clinic_state, :prescriber_clinic_zip, :prescriber_phone_number, :prescriber_phone_number_qualifier, :prescriber_agent_last_name, :prescriber_agent_first_name, :prescriber_agent_middle_name, :prescriber_agent_suffix, :prescriber_agent_prefix, :patient_individual_relationship, :patient_birthdate, :patient_last_name, :patient_first_name, :patient_middle_name, :patient_suffix, :patient_prefix, :patient_gender, :patient_id_number, :patient_id_number_qualifier, :patient_address1, :patient_address2, :patientcity, :patient_state, :patient_zip, :patient_phone_number, :patient_phone_number_qualifier, :item_description, :item_number, :item_number_qualiifer, :item_dosage_form_code, :item_strength, :item_strength_quallifier, :item_database_code, :item_database_source, :item_name_long1, :item_name_long2, :item_name_long3, :item_form_source_code, :item_form_code, :item_strength_source_code, :item_drug_strength, :item_dea_schedule, :item_quantity_qualifier, :item_quantity, :item_quantity_list_qualiifer, :item_quantity_unit_source_code, :item_quantity_potency_code, :item_sig1, :item_sig2, :item_date_qualifier, :item_date, :item_date_format, :item_substitution_code, :item_refill_prescribed_qualifier, :item_refill_prescribed, :diagnosis_qualifier, :diagnosis_code, :prior_authorization_number, :prior_authorization_qualifier, :free_text, :dur_reason_code, :dur_professional_code, :dur_result_code, :coagent_id, :coagent_id_qualifier, :clinical_priority, :acknowledgement_reason, :coverage_status_code, :prior_authorization_status, :do_not_fill, :need_by_date_qualifier, :need_by_date, :need_by_date_format, :timezone_id, :timezon_different_quantity, :need_by_reason, :supervisor_spi_number, :supervisor_qualifier, :supervisor_facility_qualifier, :supervisor_facility_code, :supervisor_claim_frequency, :supervisor_specialty, :supervisor_agency_qualifier, :supervisor_specialty_code, :supervisor_last_name, :supervisor_first_name, :supervisor_middle_name, :supervisor_suffix, :supervisor_prefix, :supervisor_zip_code, :supervisor_clinic_name, :supervisor_clinic_address1, :supervisor_clinic_address2, :supervisor_clinic_city, :supervisor_clinic_state, :supervisor_clinic_zip, :supervisor_phone_number, :supervisor_phone_number_qualifier, :supervisor_agent_last_name, :supervisor_agent_first_name, :supervisor_agent_middle_name, :supervisor_agent_suffix, :supervisor_agent_prefix)
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 |
Greet displays a greeting. | def greet
puts '------------------------'
puts "Greetings to you #{@name}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def greet\n separator\n puts \"Welcome to #{pastel.bright_cyan('Groupie')}.\"\n puts \"Keep up with your favorite bands, never miss a show!\"\n puts \"Type #{pastel.bright_cyan('concerts')} to get started.\"\n separator\n end",
"def greet\n separator\n puts \"Welcome to #{pastel.bright_cyan... | [
"0.80120677",
"0.80120677",
"0.7954985",
"0.791066",
"0.79105985",
"0.7864962",
"0.77740765",
"0.77100253",
"0.76761246",
"0.764491",
"0.7588278",
"0.7587949",
"0.75714904",
"0.75714904",
"0.75493693",
"0.74946696",
"0.7472094",
"0.74581087",
"0.7372165",
"0.73680884",
"0.733... | 0.8350204 | 0 |
Joke displays a joke. | def joke
puts "#{@name} here is a joke for you:"
puts ''
puts "Teacher: Anyone who thinks he's stupid may stand up!"
puts ''
puts 'Nobody stands up'
puts ''
puts 'Teacher: Im sure there are some stupid students over here!!'
puts ''
puts 'Little Johnny stands up'
puts ''
puts "Teacher: Ohh, Johnny you think you're stupid?"
puts ''
puts "Little Johnny: No... i just feel bad that you're standing alone..."
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n\t\t@joke = Joke.find(params[:id])\n\tend",
"def show\n @joke = Joke.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @joke }\n end\n end",
"def joke; end",
"def set_joke\n @joke = Joke.find(params[:id])\n end",
... | [
"0.73874974",
"0.6765242",
"0.6705981",
"0.6505746",
"0.6505746",
"0.6357412",
"0.63181466",
"0.6234914",
"0.622758",
"0.62187207",
"0.6072637",
"0.602608",
"0.5950052",
"0.58317834",
"0.571904",
"0.5716257",
"0.5625925",
"0.5597951",
"0.55358344",
"0.55128044",
"0.5499703",
... | 0.6988611 | 1 |
Fact displays a fact. | def fact
puts ''
puts '---Did you know?---'
puts 'A pregnant goldfish is called a twit.'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fact_display(category)\n puts \"\\n\"\n puts fact_parser(category)\n end",
"def show\n @fact = Fact.find(params[:id])\n\t\n\t\tif params[:vote]\n\t\t\t@vote = @fact.rankings.by(current_user).first\n\t\t\t@vote = Ranking.new(:rankable_id => @fact.id, :rankable_type => 'Fact', :user => curr... | [
"0.76070005",
"0.6741901",
"0.65177864",
"0.6496082",
"0.64940906",
"0.64940906",
"0.64940906",
"0.64940906",
"0.64940906",
"0.64202034",
"0.639161",
"0.639161",
"0.6260576",
"0.6071591",
"0.6029329",
"0.6029329",
"0.597749",
"0.5959982",
"0.5949472",
"0.5925339",
"0.5921397"... | 0.64030296 | 10 |
Write a method that takes a positive integer, n, as an argument, and displays a right triangle whose sides each have n stars. The hypotenuse of the triangle (the diagonal side in the images below) should have one end at the lowerleft of the triangle, and the other end at the upperright. | def triangle(num)
spaces = num - 1
stars = 1
loop do
puts " "*spaces + "*"*stars
break if stars == num
spaces -= 1
stars += 1
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tl_triangle(n)\n stars = n\n n.times do\n puts '*' * stars\n stars -= 1\n end\nend",
"def upside_down_triangle(n)\n triangle = []\n stars = n\n spaces = 0\n\n n.times do\n triangle << (' ' * spaces) + ('*' * stars)\n stars -= 1\n spaces += 1\n end\n\n triangle.each { |line| puts line ... | [
"0.8119516",
"0.79531175",
"0.7895377",
"0.78844136",
"0.787584",
"0.78125906",
"0.7769238",
"0.7735018",
"0.75095046",
"0.75004435",
"0.7488488",
"0.74771017",
"0.7453717",
"0.74520373",
"0.74115497",
"0.73635685",
"0.73549837",
"0.7273766",
"0.72183466",
"0.72132975",
"0.71... | 0.66717935 | 37 |
GET /splits GET /splits.json | def index
@splits = Split.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stock_splits_with_http_info(symbol, from, to, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.stock_splits ...'\n end\n # verify the required parameter 'symbol' is set\n if @api_client.config.client_side_validation && symbol.nil... | [
"0.6231144",
"0.60699904",
"0.6005092",
"0.6005092",
"0.5919354",
"0.5505157",
"0.542354",
"0.5385456",
"0.5378271",
"0.529883",
"0.52949107",
"0.5273118",
"0.52076787",
"0.520723",
"0.52013344",
"0.5185526",
"0.51850635",
"0.51794523",
"0.51708585",
"0.5166124",
"0.51606214"... | 0.65537053 | 0 |
GET /splits/1 GET /splits/1.json | def show
@credits = (@split.availability.end_time.to_i - @split.availability.start_time.to_i)/3600
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @splits = Split.all\n end",
"def stock_splits_with_http_info(symbol, from, to, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.stock_splits ...'\n end\n # verify the required parameter 'symbol' is set\n if @api_cli... | [
"0.6277736",
"0.5932151",
"0.571351",
"0.56335145",
"0.5578401",
"0.5578401",
"0.5385288",
"0.53787893",
"0.522895",
"0.52123296",
"0.5203745",
"0.5195336",
"0.5191753",
"0.5190951",
"0.5186052",
"0.5134054",
"0.5131104",
"0.5129085",
"0.50873876",
"0.50696653",
"0.5061728",
... | 0.0 | -1 |
POST /splits POST /splits.json | def create
@split = Split.new(split_params)
respond_to do |format|
if @split.save
format.html { redirect_to @split, notice: 'Split was successfully created.' }
format.json { render :show, status: :created, location: @split }
else
format.html { render :new }
format.json { render json: @split.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @test_split = TestSplit.new(test_split_params)\n\n respond_to do |format|\n if @test_split.save\n format.html { redirect_to @test_split, notice: 'Test split was successfully created.' }\n format.json { render :show, status: :created, location: @test_split }\n else\n ... | [
"0.6476602",
"0.63241184",
"0.618205",
"0.6164083",
"0.573422",
"0.56279194",
"0.559353",
"0.55533266",
"0.5549331",
"0.5482597",
"0.532622",
"0.5202808",
"0.52014714",
"0.51888865",
"0.51056457",
"0.51000106",
"0.5061213",
"0.50597984",
"0.5024198",
"0.5017644",
"0.50047326"... | 0.6598925 | 0 |
PATCH/PUT /splits/1 PATCH/PUT /splits/1.json | def update
respond_to do |format|
if @split.update(split_params)
format.html { redirect_to @split, notice: 'Split was successfully updated.' }
format.json { render :show, status: :ok, location: @split }
else
format.html { render :edit }
format.json { render json: @split.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @split = Split.find(params[:id])\n\n respond_to do |format|\n if @split.update_attributes(params[:split])\n format.html { redirect_to(@split, :notice => 'Split was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\... | [
"0.6155166",
"0.6092165",
"0.5983275",
"0.59644645",
"0.58819485",
"0.58766145",
"0.57270175",
"0.55355525",
"0.551988",
"0.5509019",
"0.54922634",
"0.5476285",
"0.54658496",
"0.54658496",
"0.54658496",
"0.54610956",
"0.54610956",
"0.54610956",
"0.54610956",
"0.5455925",
"0.5... | 0.62421286 | 0 |
DELETE /splits/1 DELETE /splits/1.json | def destroy
@split.destroy
respond_to do |format|
format.html { redirect_to splits_url, notice: 'Split was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @split = Split.find(params[:id])\n @split.destroy\n\n respond_to do |format|\n format.html { redirect_to(splits_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @item_split.destroy\n respond_to do |format|\n format.html { redirect_to item_splits_url }... | [
"0.68012905",
"0.65741265",
"0.645117",
"0.6365106",
"0.620803",
"0.6162729",
"0.6156314",
"0.6150774",
"0.6146079",
"0.6134942",
"0.60868806",
"0.6068242",
"0.59982467",
"0.59869677",
"0.59481984",
"0.59379613",
"0.5935878",
"0.5928589",
"0.59187114",
"0.59006506",
"0.589829... | 0.66208994 | 1 |
Use callbacks to share common setup or constraints between actions. | def set_split
@split = Split.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 split_params
params.require(:split).permit(:availability_id, :user_id, :approved, :cancelled)
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 |
FILE_PATH = File.join(Rails.root, "../dataDownloads") | def figure_1
#file_path = File.join(Rails.root, "public/images", "")
send_file(File.join(FILE_PATH, "LgrNucDist.jpg"), :type => 'image/png', :disposition => 'inline')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_data_file_path(file_name)\n base = File.dirname __FILE__\n File.join(base, \"data\", file_name)\nend",
"def file_dir\n 'files'\n end",
"def store_dir\n \"#{Rails.root}/app/files/uploads/#{ENV['PROJECT_ID']}/\"\n end",
"def file_path\n File.dirname(__FILE__) + '/' + @file_name\n end",
... | [
"0.72755086",
"0.7152731",
"0.7067475",
"0.69959426",
"0.6960311",
"0.6904632",
"0.6870603",
"0.6865643",
"0.68167585",
"0.67851406",
"0.67839956",
"0.6766811",
"0.6765746",
"0.6759179",
"0.67417616",
"0.6741246",
"0.6734575",
"0.6723445",
"0.6722542",
"0.6714544",
"0.6686597... | 0.0 | -1 |
for testing, hardcoded here, later loop through these, capturing file name, trunc the filetype | def table_1
@table1 = read_table(File.join(FILE_PATH, "Lgr_prelim_FPKM.txt"))
#send_file(File.join(FILE_PATH, "Lgr_prelim_FPKM.txt"), :type => 'text/csv', :disposition => 'inline')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def file_type file_name \n\t\tFile.extname( file_name ).gsub /^\\./, '' \n\tend",
"def file_type file_name \n File.extname( file_name ).gsub /^\\./, '' \n end",
"def file_type(file_name)\n @file_class.extname(file_name).gsub( /^\\./, '' ).downcase \n end",
"def file_type(file_name)\n File.exna... | [
"0.729894",
"0.7267986",
"0.70823866",
"0.6731864",
"0.67213476",
"0.67138404",
"0.663306",
"0.6610679",
"0.64110565",
"0.63667023",
"0.63455635",
"0.6323867",
"0.6273904",
"0.6250385",
"0.6193314",
"0.6157634",
"0.6098511",
"0.60543025",
"0.60485613",
"0.60190845",
"0.599839... | 0.0 | -1 |
GET /courses GET /courses.json | def index
@courses = current_teacher.courses.all.to_a + Course.find(current_teacher.jobs.pluck(:course_id).uniq)
@course = current_teacher.courses.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n\t\t@courses = Course.all\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @courses }\n\t\tend\n\tend",
"def index\n @courses = Course.all\n render json: @courses, status: :ok\n end",
"def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).or... | [
"0.7943173",
"0.78570646",
"0.7742099",
"0.7729055",
"0.7729055",
"0.76939315",
"0.76708746",
"0.76526207",
"0.752899",
"0.74440956",
"0.74415404",
"0.73988724",
"0.7373047",
"0.7365082",
"0.73555565",
"0.7347125",
"0.7311683",
"0.7271882",
"0.7270879",
"0.72251445",
"0.72230... | 0.0 | -1 |
GET /courses/1 GET /courses/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def course\n\t\t@course = Course.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.json\n\t\tend\n\tend",
"def index\n @courses = Course.all\n render json: @courses, status: :ok\n end",
"def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).order(:name)\n respond_to do... | [
"0.7639248",
"0.7600732",
"0.7561499",
"0.7498261",
"0.7492566",
"0.7492566",
"0.7460362",
"0.7459336",
"0.7438278",
"0.7280991",
"0.7248682",
"0.7241407",
"0.723878",
"0.72222453",
"0.72222453",
"0.72222453",
"0.72222453",
"0.72222453",
"0.72222453",
"0.721023",
"0.71961445"... | 0.0 | -1 |
POST /courses POST /courses.json | def create
@course = current_teacher.courses.new(course_params)
respond_to do |format|
if @course.save
format.html { redirect_to courses_url, notice: 'Course was successfully created.' }
format.json { render :show, status: :created, location: @course }
else
format.html { render :new }
format.json { render json: @course.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n # render plain: params[:courses].inspect\n @courses = Courses.new(courses_params)\n\n respond_to do |format|\n if @courses.save\n format.html { redirect_to @courses, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @cour... | [
"0.76898974",
"0.73798543",
"0.7334656",
"0.72327256",
"0.72273064",
"0.7128817",
"0.71268123",
"0.7109645",
"0.71044004",
"0.71044004",
"0.71044004",
"0.71044004",
"0.71044004",
"0.71044004",
"0.71044004",
"0.7092889",
"0.70824045",
"0.70697033",
"0.7053714",
"0.7053714",
"0... | 0.7157716 | 5 |
PATCH/PUT /courses/1 PATCH/PUT /courses/1.json | def update
respond_to do |format|
if @course.update(course_params)
format.html { redirect_to @course, notice: 'Course was successfully updated.' }
format.json { render :show, status: :ok, location: @course }
else
format.html { render :edit }
format.json { render json: @course.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @course.update(course_params)\n render_jsonapi_response(@course)\n end",
"def update\n @course = Course.find(params[:id])\n respond_to do |format|\n if @course.update(courses_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n f... | [
"0.72374034",
"0.7137671",
"0.7121435",
"0.7102951",
"0.708175",
"0.708175",
"0.708175",
"0.708175",
"0.708175",
"0.708175",
"0.708175",
"0.708175",
"0.70531946",
"0.70469433",
"0.6967811",
"0.696716",
"0.6964841",
"0.6954444",
"0.6949194",
"0.6934083",
"0.6929629",
"0.6929... | 0.6830851 | 46 |
DELETE /courses/1 DELETE /courses/1.json | def destroy
@course.destroy
respond_to do |format|
format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n ... | [
"0.77230847",
"0.77079666",
"0.77079666",
"0.77079666",
"0.77079666",
"0.76962376",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.76494783",
"0.76408905",
"0.7619815",
"0.76093... | 0.73929405 | 67 |
Use callbacks to share common setup or constraints between actions. | def set_course
@course = Course.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 course_params
params.require(:course).permit(:code, :name, :semester, :year)
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 |
Fetch recordings from their sources to local paths | def fetch
@recordings.map do |uri, path|
STDERR.puts("# Fetching #{uri} to #{path}")
fetch = Mixlib::ShellOut.new(
"curl --continue-at - --output #{path} #{uri}",
live_stream: STDERR
)
fetch.run_command
{
path: path,
result: fetch.exitstatus,
uri: uri
}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_remote_files\n manager = @current_source.file_manager\n manager.start do \n @current_source.folders.each do |folder|\n @files[folder] = manager.find_files folder\n @files[folder] = @files[folder].take(@take) if @take\n Logger.<<(__FILE__... | [
"0.6627812",
"0.63842523",
"0.63178474",
"0.6213546",
"0.6194053",
"0.60738885",
"0.58785415",
"0.5864768",
"0.5858369",
"0.58271086",
"0.57969624",
"0.57946855",
"0.5767589",
"0.5754805",
"0.5730557",
"0.5719597",
"0.5674711",
"0.56639427",
"0.5632406",
"0.56231606",
"0.5609... | 0.6591445 | 1 |
Load configuration from `path`. It should be a YAMLformatted file with this content: `base_uri`: the base URI common to all recordings `base_path`: the base local path common to all recordings `file_pattern`: a pattern to construct each file's name, in `format`'s format. The format may vary yeartoyear. `recordings`: a hash specifying the recordings, with this structure: : : In 2018, the recordings were named `speaker`. | def load_config(path)
# Read and parse the YAML configuration file
config = YAML.safe_load(File.read(path))
recordings = []
# Build a hash whose keys are URIs and values are local file paths
# Iterate over the list of each speaker's recordings
config['recordings'].map do |speaker, sessions|
# Iterate over the list of sessions
sessions.map do |session, parts|
# Iterate over the list of session parts
(1..parts).map do |part|
# Assemble a [uri, path] list from the interpolated file name
->(file) do
recordings << %w[uri path].map do |suffix|
File.join(config["base_#{suffix}"], file)
end
end.call(
format(
config['file_pattern'],
{ speaker: speaker, session: session, part: part }
)
)
end
end
end
Hash[recordings]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse(path)\n YAML.load(File.read(path))\n end",
"def load_file(path)\n @configuration_data = YAML.load_file(path)[CONFIGURATION_KEY]\n end",
"def load!(path)\n settings = YAML.safe_load(ERB.new(File.new(path).read).result)['api']\n from_hash(settings) if settings.is_a? Hash\n ... | [
"0.64147174",
"0.6405994",
"0.6370983",
"0.6341235",
"0.6307997",
"0.6246298",
"0.616635",
"0.6074817",
"0.6064165",
"0.6048362",
"0.60279423",
"0.5988539",
"0.5932992",
"0.5883497",
"0.5875856",
"0.5869258",
"0.5860466",
"0.58380675",
"0.58353287",
"0.5823937",
"0.58114713",... | 0.7753792 | 0 |
GET /school_cycle_has_subjects GET /school_cycle_has_subjects.json | def index
@school_cycle_has_subjects = SchoolCycleHasSubject.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_subjects\n if params[:c].present?\n sc_id = params[:c].to_i\n subjects = Subject.joins(:school_cycle_has_subjects).where(\"school_cycle_id = ?\", sc_id)\n msg = { \"success\": \"true\", \"subjects\": subjects }\n else\n msg = { \"success\": false, \"subjects\": 0 }\n end\n\n ... | [
"0.8250047",
"0.7859793",
"0.72918236",
"0.69697446",
"0.69675344",
"0.66187626",
"0.6572242",
"0.65063876",
"0.6480948",
"0.6432814",
"0.63595474",
"0.63192",
"0.6291933",
"0.627432",
"0.627426",
"0.62609845",
"0.6259299",
"0.62522626",
"0.62480086",
"0.62480086",
"0.6246840... | 0.75059223 | 2 |
GET /school_cycle_has_subjects/1 GET /school_cycle_has_subjects/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_subjects\n if params[:c].present?\n sc_id = params[:c].to_i\n subjects = Subject.joins(:school_cycle_has_subjects).where(\"school_cycle_id = ?\", sc_id)\n msg = { \"success\": \"true\", \"subjects\": subjects }\n else\n msg = { \"success\": false, \"subjects\": 0 }\n end\n\n ... | [
"0.8099305",
"0.76864564",
"0.74699354",
"0.71605575",
"0.70073044",
"0.69595957",
"0.6805312",
"0.6750411",
"0.6686584",
"0.66773075",
"0.6485978",
"0.647921",
"0.64334124",
"0.6422973",
"0.6405134",
"0.6383223",
"0.6383223",
"0.6368782",
"0.634731",
"0.6340893",
"0.63406694... | 0.0 | -1 |
POST /school_cycle_has_subjects POST /school_cycle_has_subjects.json | def create
@school_cycle_has_subject = SchoolCycleHasSubject.new(school_cycle_has_subject_params)
respond_to do |format|
if @school_cycle_has_subject.save
format.html { redirect_to ["asig",@school_cycle_has_subject], notice: 'La relacion maestro-grupo ha sido creada' }
format.json { render :show, status: :created, location: @school_cycle_has_subject }
else
format.html { render :new }
format.json { render json: @school_cycle_has_subject.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_subjects\n if params[:c].present?\n sc_id = params[:c].to_i\n subjects = Subject.joins(:school_cycle_has_subjects).where(\"school_cycle_id = ?\", sc_id)\n msg = { \"success\": \"true\", \"subjects\": subjects }\n else\n msg = { \"success\": false, \"subjects\": 0 }\n end\n\n ... | [
"0.751072",
"0.71531874",
"0.70572037",
"0.6933418",
"0.69173944",
"0.68118703",
"0.64249957",
"0.64220464",
"0.631099",
"0.63059056",
"0.6303154",
"0.62958187",
"0.6256324",
"0.62490124",
"0.6209975",
"0.61879426",
"0.616028",
"0.6153597",
"0.61484545",
"0.6148235",
"0.61059... | 0.650712 | 6 |
PATCH/PUT /school_cycle_has_subjects/1 PATCH/PUT /school_cycle_has_subjects/1.json | def update
respond_to do |format|
if @school_cycle_has_subject.update(school_cycle_has_subject_params)
format.html { redirect_to ["asig",@school_cycle_has_subject], notice: 'School cycle has subject was successfully updated.' }
format.json { render :show, status: :ok, location: @school_cycle_has_subject }
else
format.html { render :edit }
format.json { render json: @school_cycle_has_subject.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @manual_subject = Manual::Subject.find(params[:id])\n\n respond_to do |format|\n if @manual_subject.update_attributes(params[:manual_subject])\n format.html { redirect_to @manual_subject, notice: 'Subject was successfully updated.' }\n format.json { head :no_content }\n e... | [
"0.708378",
"0.7005787",
"0.69465834",
"0.6943446",
"0.6921974",
"0.6832406",
"0.6823597",
"0.68084157",
"0.6792497",
"0.6765972",
"0.6758409",
"0.66994804",
"0.6636598",
"0.6636386",
"0.6609275",
"0.6609275",
"0.65811723",
"0.65713036",
"0.655361",
"0.65315545",
"0.65271455"... | 0.73374045 | 0 |
DELETE /school_cycle_has_subjects/1 DELETE /school_cycle_has_subjects/1.json | def destroy
@school_cycle_has_subject.destroy
respond_to do |format|
format.html { redirect_to asig_school_cycle_has_subjects_path, notice: 'School cycle has subject was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @manual_subject = Manual::Subject.find(params[:id])\n @manual_subject.destroy\n\n respond_to do |format|\n format.html { redirect_to manual_subjects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @university_subject.destroy\n respond_to do |format... | [
"0.7499838",
"0.7461394",
"0.7353867",
"0.7336008",
"0.73294383",
"0.7318542",
"0.73138005",
"0.72352684",
"0.72241604",
"0.71797633",
"0.7178253",
"0.71506447",
"0.7117193",
"0.70920557",
"0.7075181",
"0.7070072",
"0.7068816",
"0.704322",
"0.70381296",
"0.70363796",
"0.70278... | 0.78074205 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_school_cycle_has_subject
@school_cycle_has_subject = SchoolCycleHasSubject.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 school_cycle_has_subject_params
params.require(:school_cycle_has_subject).permit(:school_cycle_id, :teacher_id, :subject_id, :lunes, :martes, :miercoles, :jueves, :viernes, :sabado, :horario_clases)
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 |
Returns a list of ECF Unfunded Mentors Providers can see their ECF Unfunded Mentors details via this endpoint GET /api/v3/unfundedmentors/ecf?filter[updated_since]=20221113T11:21:55Z&sort=updated_at,full_name | def index
render json: serializer_class.new(paginate(ecf_unfunded_mentors)).serializable_hash.to_json
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @epu = Election.find(params[:id]).elections_participated_users.includes(:user)\n (@filterrific = initialize_filterrific(\n Member,\n params[:filterrific]\n )) || return\n @members = @filterrific.find.where(tenant_id: current_tenant.id).includes(:roles).page(params[:page])\n end",
... | [
"0.5496127",
"0.5372884",
"0.5286411",
"0.51972145",
"0.51972145",
"0.5160774",
"0.51256484",
"0.5076362",
"0.5076362",
"0.5040046",
"0.49732637",
"0.49607384",
"0.49207768",
"0.49067444",
"0.48928815",
"0.48686838",
"0.48598355",
"0.4828297",
"0.48216313",
"0.4799586",
"0.47... | 0.5115426 | 7 |
Returns a single ECF Unfunded Mentor Providers can see a specific ECF Unfunded Mentor details via this endpoint GET /api/v3/unfundedmentors/ecf/:id | def show
render json: serializer_class.new(ecf_unfunded_mentor).serializable_hash.to_json
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @epu = Election.find(params[:id]).elections_participated_users.includes(:user)\n (@filterrific = initialize_filterrific(\n Member,\n params[:filterrific]\n )) || return\n @members = @filterrific.find.where(tenant_id: current_tenant.id).includes(:roles).page(params[:page])\n end",
... | [
"0.572603",
"0.5557755",
"0.52802235",
"0.5231837",
"0.5209486",
"0.51395565",
"0.5111269",
"0.5111269",
"0.51035655",
"0.5088826",
"0.5067503",
"0.50606465",
"0.50603616",
"0.5055631",
"0.50248003",
"0.50121444",
"0.5007236",
"0.49860573",
"0.49830687",
"0.49806538",
"0.4974... | 0.5405743 | 2 |
Instance methods transform categories hash into nested objects for view simplicity | def categories
raw_categories.to_hashugar
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def categories\n Hash[self.class.catalogs.map { |fld, klass|\n name = fld.gsub(/_id$/, '_name');\n [fld, {:id => self.send(fld), :name => self.send(name)}] rescue nil\n }.reject {|cat| cat.nil?}]\n end",
"def extract_categories cats\n cats.inject Hash.new do |hash, tag|\n\... | [
"0.67276347",
"0.6575168",
"0.65098906",
"0.6462346",
"0.64343816",
"0.64003175",
"0.6368787",
"0.6296995",
"0.62545556",
"0.6230784",
"0.6230784",
"0.62003106",
"0.61347383",
"0.6066618",
"0.60473025",
"0.60440326",
"0.5909906",
"0.5891107",
"0.57944393",
"0.57944393",
"0.57... | 0.70369136 | 0 |
GET /ads GET /ads.json | def index
@ads = Ad.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @ads = Ad.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads }\n end\n end",
"def index\n @ads = Ad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads }\n end\n end",
"def... | [
"0.7752131",
"0.7749316",
"0.7291679",
"0.726539",
"0.7224467",
"0.712877",
"0.712877",
"0.712877",
"0.7110715",
"0.6884924",
"0.68810844",
"0.68610626",
"0.6854222",
"0.68104106",
"0.67929673",
"0.67929673",
"0.6782109",
"0.6770735",
"0.67337316",
"0.6730005",
"0.6673539",
... | 0.71702427 | 7 |
GET /ads/1 GET /ads/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @ads = Ad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads }\n end\n end",
"def index\n @ads = Ad.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads }\n end\n end",
"def... | [
"0.75970733",
"0.7587807",
"0.730965",
"0.730965",
"0.730965",
"0.71618325",
"0.7091579",
"0.7060379",
"0.698387",
"0.698387",
"0.698387",
"0.698387",
"0.698387",
"0.6965706",
"0.69487184",
"0.6883612",
"0.68527615",
"0.6832596",
"0.6781336",
"0.6744042",
"0.67338634",
"0.6... | 0.0 | -1 |
POST /ads POST /ads.json | def create
@ad = Ad.new(ad_params)
respond_to do |format|
if @ad.save
format.html { redirect_to @ad, notice: 'Ad was successfully created.' }
format.json { render :show, status: :created, location: @ad }
else
format.html { render :new }
format.json { render json: @ad.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @ad = Ad.new(ad_params)\n\n if @ad.save\n render :show, status: :created, location: @ad\n else\n render json: @ad.errors, status: :unprocessable_entity\n end\n end",
"def create\n fix_tokenized_input_params\n @ad = @org.ads.build(ad_params)\n\n respond_to do |format|\... | [
"0.71051663",
"0.70117784",
"0.69783634",
"0.6958402",
"0.687992",
"0.6796889",
"0.6729126",
"0.66890365",
"0.6644174",
"0.66278136",
"0.649528",
"0.64633185",
"0.64579415",
"0.6427978",
"0.64220244",
"0.6417364",
"0.63306385",
"0.63099897",
"0.6308368",
"0.62947494",
"0.6282... | 0.7014856 | 1 |
PATCH/PUT /ads/1 PATCH/PUT /ads/1.json | def update
respond_to do |format|
if @ad.update(ad_params)
format.html { redirect_to @ad, notice: 'Ad was successfully updated.' }
format.json { render :show, status: :ok, location: @ad }
else
format.html { render :edit }
format.json { render json: @ad.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n if @ad.update_attributes(params[:ad])\n format.html { redirect_to @ad, notice: 'Ad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n form... | [
"0.69383",
"0.69383",
"0.67188334",
"0.6641892",
"0.6612114",
"0.6575076",
"0.6553201",
"0.6546139",
"0.65125585",
"0.65049094",
"0.6492367",
"0.6475903",
"0.64591247",
"0.64585716",
"0.64578116",
"0.64555466",
"0.6452212",
"0.6446261",
"0.6434833",
"0.6422958",
"0.64109385",... | 0.66695863 | 5 |
DELETE /ads/1 DELETE /ads/1.json | def destroy
@ad.destroy
respond_to do |format|
format.html { redirect_to ads_url, notice: 'Ad was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @ad = Ad.find(params[:id])\n @ad.destroy\nrender json: 1\n end",
"def destroy\n @ad = Ad.find(params[:id])\n @ad.destroy\n\n respond_to do |format|\n format.html { redirect_to ads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @home_indices_... | [
"0.7637339",
"0.7542011",
"0.75137264",
"0.73285",
"0.72981167",
"0.7294329",
"0.7290231",
"0.7290231",
"0.72807807",
"0.72807807",
"0.7275584",
"0.7233481",
"0.72154176",
"0.72154176",
"0.72154176",
"0.72122157",
"0.7201754",
"0.7187984",
"0.71771216",
"0.71671426",
"0.71496... | 0.7211167 | 18 |
Use callbacks to share common setup or constraints between actions. | def set_ad
@ad = Ad.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 ad_params
params.require(:ad).permit(:user_id, :titel, :description, :price, :price_type, :postal_code, :place_id, :street, :ad_type, :contact_name, :phonenumber, :in_galery, :galery_end, :top_ad, :top_ad_end, :highlight, :highlight_end, :repeat_to_top, :repeat_to_top_end, :main_image, :category_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 |
Handle ordinal/dayname formats: o u | def handle_o_dn
handle_o
handle_possible(SeparatorSpace)
handle_dn
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ordinal_suffix(date)\n number = date.strftime('%e').to_i\n if (11..13).include?(number % 100)\n \"th\"\n else\n case number % 10\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\n end"... | [
"0.66976017",
"0.6593926",
"0.6592836",
"0.6549197",
"0.6518705",
"0.65027404",
"0.6470497",
"0.6424473",
"0.6380269",
"0.63734055",
"0.63484997",
"0.6294696",
"0.6283819",
"0.62375814",
"0.62309706",
"0.6222071",
"0.6197715",
"0.61763024",
"0.6166795",
"0.61426693",
"0.61293... | 0.0 | -1 |
Handle ordinal/unit formats: o u | def handle_o_u
handle_o
handle_possible(SeparatorSpace)
handle_u
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_unit!\n begin\n parse_alpha_unit!\n rescue InvalidFormat\n parse_numeric_unit!\n end\n end",
"def handle_u\n @unit = @tokens[@index].get_tag(Unit).type\n @index += 1\n @precision = :unit\n end",
"def parse_units\n # extract the unit suffix\n if self =~ /(\\... | [
"0.68760693",
"0.6566012",
"0.64165664",
"0.63850677",
"0.62318206",
"0.6229607",
"0.61723965",
"0.6167533",
"0.61117",
"0.6091142",
"0.608896",
"0.6072607",
"0.60217917",
"0.6021327",
"0.60170305",
"0.5985593",
"0.5968899",
"0.5966985",
"0.5942487",
"0.5891441",
"0.58528376"... | 0.0 | -1 |
Handle ordinalday/grabber/unitmonth formats: dd(st|nd|rd|th) of last/this/next month | def handle_od_gr
handle_od
next_tag
handle_gr
# ignore unit
@year, @month = Date::add_month(@local_date.year, @local_date.month, @modifier)
next_tag
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def day_of_month\n ordinal = case @time.day\n when 1 then \"st\"\n when 2 then \"nd\"\n when 3 then \"rd\"\n else \"th\"\n end\n \"#{@time.day}#{ordinal}\"\n end",
"def ordinal_suffix(date)\n number = date.strftime('%e').to_i\n if (11..13).include?(number % 100... | [
"0.7263979",
"0.67658365",
"0.6726652",
"0.67033803",
"0.66507995",
"0.6506593",
"0.64195263",
"0.64153194",
"0.62813324",
"0.62441784",
"0.62441784",
"0.62375194",
"0.6230108",
"0.6219399",
"0.6188863",
"0.61822635",
"0.61409277",
"0.61209714",
"0.61145145",
"0.6085115",
"0.... | 0.5702108 | 74 |
Handle ordinalmonth/grabber/unityear formats: mm(st|nd|rd|th) of last/this/next year | def handle_om_gr
handle_om
next_tag
handle_gr
# ignore unit
@year = @local_date.year + @modifier
next_tag
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rsmonth(month)\n case month\n when 1\n return 'januar'\n when 2\n return 'februar'\n when 3\n return 'mart'\n when 4\n return 'april'\n when 5\n return 'maj'\n when 6\n return 'jun'\n when 7\n return 'jul'\n when 8\n return 'avgust'\n when 9\n... | [
"0.6739005",
"0.67068005",
"0.660776",
"0.6509744",
"0.6473491",
"0.6465945",
"0.64577407",
"0.639909",
"0.6391643",
"0.6377075",
"0.6373626",
"0.63594055",
"0.63594055",
"0.63290685",
"0.6325708",
"0.6293293",
"0.62800103",
"0.62650424",
"0.626115",
"0.6254773",
"0.62470067"... | 0.57961345 | 78 |
Handle grabber/ordinal/unit formats: last/this/next o u | def handle_gr_o_u
handle_gr
next_tag
handle_o_u
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_unit!\n begin\n parse_alpha_unit!\n rescue InvalidFormat\n parse_numeric_unit!\n end\n end",
"def handle_u\n @unit = @tokens[@index].get_tag(Unit).type\n @index += 1\n @precision = :unit\n end",
"def parse_units\n # extract the unit suffix\n if self =~ /(\\... | [
"0.6214327",
"0.6195001",
"0.6116868",
"0.5942038",
"0.5874218",
"0.5874218",
"0.56306803",
"0.56019396",
"0.55520356",
"0.55068713",
"0.55068713",
"0.5488915",
"0.5435044",
"0.5406877",
"0.538845",
"0.5349595",
"0.53475016",
"0.53010434",
"0.5299056",
"0.52872163",
"0.528713... | 0.0 | -1 |
GET /users GET /users.xml | def index
@users = User.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @users }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_users\n self.class.get('/users')\n end",
"def index\n @users = LinkedData::Client::Models::User.all\n respond_to do |format|\n format.html\n format.xml { render xml: @users.to_xml }\n end\n end",
"def me\n users(request(\"users/authenticate.xml\", :auth => true))\n en... | [
"0.7657926",
"0.76263535",
"0.7490723",
"0.7470033",
"0.74069935",
"0.7387062",
"0.7248585",
"0.72448206",
"0.721343",
"0.7211573",
"0.7210826",
"0.71998477",
"0.71764135",
"0.71337295",
"0.71337295",
"0.71337295",
"0.7132803",
"0.7132208",
"0.7130947",
"0.70905775",
"0.70857... | 0.7115423 | 19 |
GET /users/1 GET /users/1.xml | def show
@user = User.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @user }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @users = LinkedData::Client::Models::User.all\n respond_to do |format|\n format.html\n format.xml { render xml: @users.to_xml }\n end\n end",
"def me\n users(request(\"users/authenticate.xml\", :auth => true))\n end",
"def index\n @users = User.all\n render :xml ... | [
"0.7207758",
"0.71160614",
"0.7054628",
"0.70484746",
"0.6916555",
"0.6916146",
"0.6915502",
"0.6890011",
"0.68641984",
"0.68633956",
"0.6853434",
"0.68511736",
"0.68511736",
"0.68511736",
"0.6828291",
"0.68280435",
"0.68278646",
"0.68065727",
"0.6801009",
"0.6786165",
"0.676... | 0.6510219 | 60 |
GET /users/new GET /users/new.xml | def new
@user = User.new
@addresses = Address.all
@address = Address.new
widok = 'new'
widok = 'user_new' if !(admin_logged_in?)
respond_to do |format|
format.html { render widok } # new.html.erb
format.xml { render :xml => @user }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n logger.debug(\"Create a new user\")\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.xml { render xml: @user}\n end\n end"... | [
"0.77330446",
"0.7697235",
"0.7628986",
"0.75933844",
"0.7592385",
"0.75490505",
"0.7536828",
"0.7530958",
"0.7530958",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
... | 0.7135706 | 70 |
POST /users POST /users.xml | def create
genotyp = nil
genotyp = Genotype.find(:first, :conditions => { :genotyp => params[:genotyp] }) if params[:genotyp] != nil
autoryzowane = false
autoryzowane = true if admin_logged_in?
autoryzowane = true if !admin_logged_in? && !genotyp.nil?
widok = 'new'
widok = 'user_new' if !(admin_logged_in?)
przekierowanie = users_path
przekierowanie = root_path if !(admin_logged_in?)
if !admin_logged_in? && !genotyp
flash[:error] = "Nieprawidłowa fraza"
else
flash[:error] = nil
end
params[:user].delete(:address_opises)
@user = User.new(params[:user])
@addresses = Address.all
respond_to do |format|
if autoryzowane && @user.save
if !admin_logged_in?
notice = "Możesz się teraz zalogować"
genotyp.destroy
system('curl http://reader.appload.pl/shedule/' << @user.klucz << '!' << @user.rss_pass)
else
notice = "Pomyślnie dodano nowego użytkownika #{@user.klucz} => #{@user.id}"
end
format.html { redirect_to(przekierowanie, :notice => notice) }
format.xml { render :xml => @user, :status => :created, :location => @user }
else
format.html { render widok, :action => "new" }
format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end",
"def post body=nil, headers={}\n @connection.post \"users.json\", body, headers\n end",
"def CreateUser params = {}\n \n ... | [
"0.71678036",
"0.6338476",
"0.6224363",
"0.61548346",
"0.6088076",
"0.6079892",
"0.60536397",
"0.60094374",
"0.5940851",
"0.59352076",
"0.59313804",
"0.59236705",
"0.59006655",
"0.58788294",
"0.5857175",
"0.58492076",
"0.58427423",
"0.58262956",
"0.58248377",
"0.5821217",
"0.... | 0.0 | -1 |
PUT /users/1 PUT /users/1.xml | def update
@user = User.find(params[:id])
# @filtry = params[:filters]
# if @filtry != nil
# params[:user][:obserwowane] = @filtry.join(" ")
# else
# params[:user][:obserwowane] = nil
# end
#przekierowanie = users_path
przekierowanie = users_path
przekierowanie = root_path if !(admin_logged_in?)
zmiana_subskrypcji = false
if !params[:user][:zmiana_subskrypcji].nil?
zmiana_subskrypcji = true
params[:user].delete(:zmiana_subskrypcji)
end
if zmiana_subskrypcji
params[:user][:address_ids] = [] if out = params[:user][:address_ids].nil?
params[:user][:address_opises] = [] if out = params[:user][:address_opises].nil?
identyfikatory = params[:user][:address_ids]
opisy = params[:user][:address_opises]
params[:user].delete(:address_opises)
end
respond_to do |format|
if @user.update_attributes(params[:user])
if zmiana_subskrypcji
identyfikatory.each do |id|
# Zapisanie opisu użytkownika
@user.sites.find_by_address_id(id).update_attributes(:opis => opisy[id])
# Zapisanie opisu globalnego (w addresses, rodzaj cache)
@adres = Address.find(id)
alternatywy = []
@adres.sites.each do |site|
alternatywy << site.opis
end
liczby_alternatyw = (alternatywy.inject(Hash.new(0)) { |h, i| h[i] += 1; h }).to_a
liczba_uzytkownikow = Address.find(id).sites.length
max = 0
best_opis = ''
liczby_alternatyw.each do |opis, liczba|
if liczba > max
max = liczba
( best_opis = opis) if opis != ''
end
end
( best_opis = 'brak opisu' ) if (best_opis == '')
poprzedni_opis = @adres.opis
@adres.update_attributes(:opis => best_opis)
end
end
format.html { redirect_to(przekierowanie, :notice => 'Ustawienia zapisane') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @user = V1::User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'V1::User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :a... | [
"0.6635185",
"0.6546547",
"0.6365357",
"0.6259716",
"0.6222739",
"0.62200224",
"0.6171894",
"0.6131896",
"0.61308634",
"0.61273426",
"0.6110778",
"0.6106035",
"0.61059886",
"0.60566944",
"0.603521",
"0.603402",
"0.6016474",
"0.6012614",
"0.6003888",
"0.5980906",
"0.59783655",... | 0.0 | -1 |
DELETE /users/1 DELETE /users/1.xml | def destroy
@user = User.find(params[:id])
@user.destroy
Site.where(:user_id => params[:id]).each do |site|
site.destroy
puts "chciałbym usunąć adres #{site.adres.to_yaml}"
end
respond_to do |format|
format.html { redirect_to(users_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n @user = User.find(params[:id])\n @user.rvsps.delete_all()\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def delete_users\n delete(users_path)\n end",
"def destroy\n @user = ... | [
"0.7177572",
"0.7172003",
"0.70611066",
"0.70607454",
"0.7031703",
"0.70033735",
"0.69609874",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",... | 0.0 | -1 |
CRUD example with an api | def list_employees(api_object)
puts "Current Employees:"
doc = Nokogiri::XML.parse api_object.read
names = doc.xpath('employees/employee/name').collect {|e| e.text }
puts names.join(", ")
puts ""
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def api; end",
"def api; end",
"def crud *args\n @crud = args.first if args.size > 0\n end",
"def demo(id)\n get_record \"/demos/#{id}\"\n end",
"def index\n @apis = Api.all.order(:status)\n @api = Api.new\n end",
"def define_restful_api(model)\n get \"/#{model.resource}\" do\n sle... | [
"0.63147134",
"0.63147134",
"0.6197791",
"0.6041492",
"0.59219843",
"0.59210443",
"0.59193707",
"0.58374035",
"0.58264816",
"0.5819316",
"0.5808636",
"0.5782093",
"0.5775803",
"0.57510877",
"0.574921",
"0.5739456",
"0.5739456",
"0.5737173",
"0.57363474",
"0.5731568",
"0.57167... | 0.0 | -1 |
Get current battler's aggressive level | def get_reaction_name
return "" unless @battler
return "" unless @battler.aggressive_level
return ":" + $data_states[PONY::StateID[:aggressive_level][@battler.aggressive_level]].name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getBasicValue\n combatLevel \n end",
"def getCombatLevel\n combatLevel = @level\n @visibleTreasures.each { |treasure| combatLevel += treasure.getBonus}\n combatLevel\n end",
"def effective_level\n level + level_bonus\n end",
"def level_bonus\n (MAX_LEVEL - level) /... | [
"0.7549608",
"0.70879817",
"0.70867574",
"0.70090246",
"0.69639707",
"0.69488525",
"0.6907802",
"0.6861772",
"0.68503183",
"0.6711179",
"0.660632",
"0.6515652",
"0.64010984",
"0.63752776",
"0.63361067",
"0.6281089",
"0.6272425",
"0.625709",
"0.61785793",
"0.6165152",
"0.61523... | 0.6012323 | 33 |
Todo: Anyone can write or view the list of reviews for a movie, but only an admin or the user who created a review should be allowed to edit or delete it Implement this by removing the edit and delete buttons on the reviewshow page except for Admins, and create a link on the user profile page to My Reviews. Create a new view for the current user's reviews with options to edit and delete there. | def index
@reviews = @movie.reviews
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @reviews = current_user.reviews\n end",
"def my_reviews\n @owner = current_user\n @reviews = Review.find(:all, :conditions => [\"user_id = ?\", @owner.id])\n render :action => \"index\"\n end",
"def set_movie_review\n @movie_review = MovieReview.find(params[:id])\n end",
"de... | [
"0.6863232",
"0.6801164",
"0.6780731",
"0.67340565",
"0.67065465",
"0.6663382",
"0.6626354",
"0.6625354",
"0.6615033",
"0.6600781",
"0.6511863",
"0.6511863",
"0.64851224",
"0.64693564",
"0.64437056",
"0.64303917",
"0.6428562",
"0.64200634",
"0.6419192",
"0.64183176",
"0.64140... | 0.7156778 | 0 |
POST /numbers POST /numbers.json | def create
@number = Number.new(params[:number])
respond_to do |format|
if @number.save
format.json { render json: @number, status: :created }
else
format.json { render json: @number.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @num = Num.new(num_params)\n\n respond_to do |format|\n if @num.save\n format.html { redirect_to @num, notice: \"Num was successfully created.\" }\n format.json { render :show, status: :created, location: @num }\n else\n format.html { render :new, status: :unproces... | [
"0.6095283",
"0.6064746",
"0.5995411",
"0.5855993",
"0.57869804",
"0.5778158",
"0.57576627",
"0.57191694",
"0.56227565",
"0.5611352",
"0.55656797",
"0.5527828",
"0.5458485",
"0.54570806",
"0.54384583",
"0.5425506",
"0.53820324",
"0.53790694",
"0.5375236",
"0.5356631",
"0.5329... | 0.6475641 | 0 |
DELETE /numbers/1 DELETE /numbers/1.json | def destroy
@number = Number.where(:value => params[:number][:value]).first
@number.destroy
respond_to do |format|
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @num.destroy\n respond_to do |format|\n format.html { redirect_to nums_url, notice: \"Num was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @number.destroy\n respond_to ... | [
"0.6984806",
"0.6934817",
"0.6903177",
"0.6854766",
"0.6800874",
"0.67897856",
"0.6745548",
"0.673172",
"0.67171174",
"0.66145045",
"0.66094214",
"0.6599608",
"0.65958166",
"0.65958166",
"0.6590628",
"0.6587603",
"0.6579372",
"0.6579372",
"0.6579372",
"0.6579372",
"0.6573329"... | 0.7314413 | 0 |
GET /contentperpages GET /contentperpages.json | def index
@contentperpages = Contentperpage.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pages\n project_size = Project.all.length\n\n puts project_size\n\n respond_to do |format|\n format.json {\n @pages = (project_size/10.0).ceil\n render :json => @pages \n }\n end\n end",
"def index\n respond_to do |format|\... | [
"0.74854624",
"0.69791067",
"0.67317206",
"0.67220896",
"0.66817164",
"0.6681638",
"0.6668635",
"0.66148823",
"0.66008604",
"0.65884984",
"0.65853417",
"0.65749717",
"0.65550464",
"0.65483326",
"0.6512134",
"0.6512056",
"0.6495431",
"0.64908034",
"0.6466655",
"0.646083",
"0.6... | 0.74143445 | 1 |
GET /contentperpages/1 GET /contentperpages/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @contentperpages = Contentperpage.all\n end",
"def pages\n project_size = Project.all.length\n\n puts project_size\n\n respond_to do |format|\n format.json {\n @pages = (project_size/10.0).ceil\n render :json => @pages \n }\... | [
"0.7519971",
"0.73810714",
"0.69596297",
"0.6845108",
"0.6837901",
"0.6744085",
"0.6690901",
"0.6688018",
"0.6640872",
"0.6610267",
"0.6609181",
"0.6579637",
"0.65564114",
"0.65562",
"0.65513533",
"0.65462697",
"0.65462697",
"0.65462697",
"0.65462697",
"0.65462697",
"0.654626... | 0.0 | -1 |
POST /contentperpages POST /contentperpages.json | def create
@contentperpage = Contentperpage.new(contentperpage_params)
respond_to do |format|
if @contentperpage.save
format.html { redirect_to @contentperpage, notice: 'Contentperpage was successfully created.' }
format.json { render :show, status: :created, location: @contentperpage }
else
format.html { render :new }
format.json { render json: @contentperpage.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contentperpage_params\n params.require(:contentperpage).permit(:contentid, :subitemid)\n end",
"def pages\n project_size = Project.all.length\n\n puts project_size\n\n respond_to do |format|\n format.json {\n @pages = (project_size/10.0).ceil\n ... | [
"0.692979",
"0.6776244",
"0.66119695",
"0.6409838",
"0.63278866",
"0.6066663",
"0.5993099",
"0.5983188",
"0.5963665",
"0.5960876",
"0.5957527",
"0.59421784",
"0.590076",
"0.5892784",
"0.5879677",
"0.5866372",
"0.58314043",
"0.5816018",
"0.5811279",
"0.5778164",
"0.57739073",
... | 0.631745 | 5 |
PATCH/PUT /contentperpages/1 PATCH/PUT /contentperpages/1.json | def update
respond_to do |format|
if @contentperpage.update(contentperpage_params)
format.html { redirect_to @contentperpage, notice: 'Contentperpage was successfully updated.' }
format.json { render :show, status: :ok, location: @contentperpage }
else
format.html { render :edit }
format.json { render json: @contentperpage.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n authorize @page_content.page, :update?\n\n respond_to do |format|\n if @page_content.update(page_content_params)\n format.json { render :show, status: :ok, location: @page_content }\n else\n format.json { render json: @page_content.errors, status: :unprocessable_entity }\... | [
"0.6984614",
"0.67693335",
"0.67587143",
"0.66510755",
"0.65030694",
"0.64939773",
"0.6458537",
"0.64460236",
"0.6378556",
"0.634167",
"0.6336183",
"0.6332773",
"0.63246524",
"0.63081795",
"0.62519807",
"0.6249785",
"0.6232803",
"0.62251186",
"0.6208463",
"0.61989087",
"0.618... | 0.7100395 | 0 |
DELETE /contentperpages/1 DELETE /contentperpages/1.json | def destroy
@contentperpage.destroy
respond_to do |format|
format.html { redirect_to contentperpages_url, notice: 'Contentperpage was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_page(id)\n @client.raw('delete', \"/content/pages/#{id}\")\n end",
"def destroy\n @page = current_cms.pages.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(big_cms_pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n... | [
"0.7242123",
"0.7154377",
"0.7109982",
"0.7057982",
"0.7038644",
"0.7029839",
"0.7024557",
"0.7015564",
"0.7015564",
"0.7015564",
"0.7015564",
"0.7005398",
"0.69948715",
"0.69797426",
"0.69797426",
"0.69797426",
"0.69797426",
"0.69797426",
"0.69797426",
"0.69797426",
"0.69797... | 0.7574797 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_contentperpage
@contentperpage = Contentperpage.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 contentperpage_params
params.require(:contentperpage).permit(:contentid, :subitemid)
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 |
Function used to ask users about setting up his account. | def Setup(oCloudObj, sAccountName = nil)
return nil if not oCloudObj or not @oCoreObject
@oCoreObject.Setup(oCloudObj, sAccountName)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sign_up_helper\n username = prompt.ask(\"Enter Username\")\n while User.find_by(name: username.downcase)\n puts \"This username is already taken, please create a different username\"\n username = prompt.ask(\"Enter Username\")\n end\n password = prompt.ask(\"En... | [
"0.67329925",
"0.65980184",
"0.65634817",
"0.64511585",
"0.6417748",
"0.64082086",
"0.63905174",
"0.63653237",
"0.6354242",
"0.6354242",
"0.63255936",
"0.630943",
"0.6207658",
"0.6205053",
"0.61886024",
"0.61742014",
"0.61559236",
"0.6142021",
"0.61393535",
"0.6124959",
"0.60... | 0.0 | -1 |
Functions used to set simple data/Object for controller/process function call. TODO: to revisit this function, as we may consider simple data, as ForjLib::Data object | def []= (*key, value)
return nil if [:object, :query].include?(key[0])
rhSet(@hParams, value, key)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_data\n end",
"def data=(_arg0); end",
"def data=(_arg0); end",
"def data=(_arg0); end",
"def data=(_arg0); end",
"def do_data(data); end",
"def object(data)\n @_data = data unless @_locals[:object]\n end",
"def initialize_data\n end",
"def perform\n\n set_user(@data['u... | [
"0.6435117",
"0.6429237",
"0.6429237",
"0.6429237",
"0.6429237",
"0.6381962",
"0.63081616",
"0.6229137",
"0.6197975",
"0.6161204",
"0.5970299",
"0.5964407",
"0.5964407",
"0.5964407",
"0.5964407",
"0.5964407",
"0.5964407",
"0.5964407",
"0.5964407",
"0.58748496",
"0.5870205",
... | 0.0 | -1 |
This function returns a list of objects | def Query(sCloudObj, hQuery)
return nil if not sCloudObj
raise ForjError.new(), "$s.Get: '%s' is not a known object type." % [self.class, sCloudObj] if rhExist?(@@meta_obj, sCloudObj) != 1
# Check if we can re-use a previous query
oList = @ObjectData[:query, sCloudObj]
unless oList.nil?
if oList[:query] == hQuery
ForjLib.debug(3, "Using Object '%s' query cache : %s" % [sCloudObj, hQuery])
return oList
end
end
pProc = rhGet(@@meta_obj, sCloudObj, :lambdas, :query_e)
return nil if pProc.nil?
# Check required parameters
oObjMissing = _check_required(sCloudObj, :query_e, pProc).reverse
while oObjMissing.length >0
sElem = oObjMissing.pop
raise ForjError.new(),"Unable to create Object '%s'" % sElem if not Create(sElem)
oObjMissing = _check_required(sCloudObj, :query_e, pProc).reverse
raise ForjError.new(), "loop detection: '%s' is required but Query(%s) did not loaded it." % [sElem, sElem] if oObjMissing.include?(sElem)
end
@RuntimeContext[:oCurrentObj] = sCloudObj # Context: Default object used.
# build Function params to pass to the Process Event handler.
aParams = _get_object_params(sCloudObj, :query_e, pProc)
# Call the process function.
# At some point, the process will call the controller, via the framework.
# This controller call via the framework has the role to
# create an ObjectData well formatted, with _return_map function
# See Definition.connect/create/update/query/get functions (lowercase)
oObject = @oForjProcess.method(pProc).call(sCloudObj, hQuery, aParams)
# return usually is the main object that the process called should provide.
unless oObject.nil?
# Save Object if the object has been created by the process, without controller
@ObjectData.add(oObject)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def objects\n return @objects unless @objects.nil?\n objs = []\n dict = @instance.getDictionary\n (0 ... dict.getChildCount).each do |i|\n obj = dict.getChildAt(i)\n objs << {\n :name => obj.getName,\n :qual => obj.getQualification.toString.downcase.to_sym,\n ... | [
"0.7284758",
"0.7205446",
"0.6986376",
"0.69834936",
"0.6967095",
"0.69623643",
"0.68796635",
"0.6874596",
"0.68508726",
"0.68129116",
"0.67356616",
"0.6730807",
"0.6721768",
"0.6704683",
"0.6696705",
"0.66573125",
"0.66452366",
"0.6642948",
"0.6632491",
"0.6621784",
"0.66068... | 0.0 | -1 |
Initialize Cloud object Data | def initialize(oForjConfig, oForjProcess, oForjProvider = nil)
# Object Data object. Contains all loaded object data.
# This object is used to build hParams as well.
@ObjectData = ObjectData.new(true)
#
@RuntimeContext = {
:oCurrentObj => nil
}
@oForjConfig = oForjConfig
raise ForjError.new(), "'%s' is not a valid ForjAccount or ForjConfig Object." % [oForjConfig.class] if not oForjConfig.is_a?(ForjAccount) and not oForjConfig.is_a?(ForjConfig)
@oProvider = oForjProvider
if oForjProvider
raise ForjError.new(), "'%s' is not a valid ForjProvider Object type." % [oForjProvider.class] if not oForjProvider.is_a?(BaseController)
end
@oForjProcess = oForjProcess
raise ForjError.new(), "'%s' is not a valid BaseProcess Object type." % [oForjProcess.class] if not oForjProcess.is_a?(BaseProcess)
@oForjProcess.set_BaseObject(self)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_data\n end",
"def initialize\n super()\n init_data()\n end",
"def init_data\n end",
"def initialize\n @data = Data.instance\n end",
"def initialize\n load_data\n end",
"def initialize(data)\n\n end",
"def initialize data\n self.data = data\n end",
... | [
"0.7572795",
"0.73860735",
"0.7267619",
"0.6879901",
"0.68410105",
"0.6774036",
"0.6728262",
"0.6728262",
"0.6728262",
"0.6728262",
"0.6728262",
"0.6728262",
"0.6728262",
"0.6728262",
"0.6696164",
"0.6674611",
"0.6617485",
"0.66101927",
"0.65782803",
"0.65560806",
"0.65560806... | 0.0 | -1 |
Functions used by processes functions Ex: object.set_data(...) config Function to manipulate the config object. 2 kind of functions: set (key, value) and []=(key, value) From processes, you can set a runtime data with: config.set(key, value) OR config[key] = value get (key, default) and [](key, default) default is an optional value. From processes, you can get a data (runtime/account/config.yaml or defaults.yaml) with: config.get(key) OR config[key] | def config
raise ForjError.new(), "No config object loaded." if not @oForjConfig
@oForjConfig
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_config(config)\n\t\tend",
"def []=(key, value)\n config[key] = value\n end",
"def set_config(*args); end",
"def set_config(*args); end",
"def set_config(*args); end",
"def set_config(*args); end",
"def set_config(*args); end",
"def config_set key, value\n self.config\n e... | [
"0.6600663",
"0.6535007",
"0.65323913",
"0.65323913",
"0.65323913",
"0.65323913",
"0.65323913",
"0.65096784",
"0.64741683",
"0.6366999",
"0.6366999",
"0.63625187",
"0.63625187",
"0.63625187",
"0.6352882",
"0.63445306",
"0.63445306",
"0.62965673",
"0.6265768",
"0.6265768",
"0.... | 0.0 | -1 |
Before doing a query, mapping fields Transform Object query field to Provider query Fields | def query_map(sCloudObj, hParams)
return nil if not sCloudObj or not [String, Symbol].include?(sCloudObj.class)
return {} if not hParams
sCloudObj = sCloudObj.to_sym if sCloudObj.class == String
hReturn = {}
hMap = rhGet(@@meta_obj, sCloudObj, :query_mapping)
hParams.each { |key, value|
oKeyPath = KeyPath.new(key)
sKeyPath = oKeyPath.sFullPath
raise ForjError.new(), "Forj query field '%s.%s' not defined by class '%s'" % [sCloudObj, oKeyPath.sKey, self.class] if not hMap.key?(oKeyPath.sFullPath)
oMapPath = KeyPath.new(hMap[oKeyPath.sFullPath])
hValueMapping = rhGet(@@meta_obj, sCloudObj, :value_mapping, sKeyPath)
if hValueMapping
raise ForjError.new(), "'%s.%s': No value mapping for '%s'" % [sCloudObj, oKeyPath.sKey, value] if rhExist?(hValueMapping, value) != 1
rhSet(hReturn, hValueMapping[value], oMapPath.aTree)
else
rhSet(hReturn, value, oMapPath.aTree)
end
}
hReturn
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fields_for_query\n self.class.fields_coercions.keys.each_with_object({}) do |field_name, results|\n results[field_name] = @fields.each_with_object({}) do |(locale, fields), field_results|\n field_results[locale] = get_value_from(fields, field_name)\n end\n end\n ... | [
"0.7044666",
"0.7044666",
"0.639103",
"0.6147704",
"0.6071293",
"0.5899231",
"0.588907",
"0.585449",
"0.58095974",
"0.57969356",
"0.57765466",
"0.5699842",
"0.56909966",
"0.56753796",
"0.5668904",
"0.56677127",
"0.5667058",
"0.562876",
"0.562161",
"0.5619363",
"0.5614173",
... | 0.0 | -1 |
Used by the Process. Ask controller get_attr to get a data The result is the data of a defined data attribute. If the value is normally mapped (value mapped), the value is returned as a recognized data attribute value. | def get_attr(oObject, key)
raise ForjError.new(), "'%s' is not a valid Object type. " % [oObject.class] if not oObject.is_a?(Hash) and rhExist?(oObject, :object_type) != 1
sCloudObj = oObject[:object_type]
oKeyPath = KeyPath.new(key)
raise ForjError.new(), "'%s' key is not declared as data of '%s' CloudObject. You may need to add obj_needs..." % [oKeyPath.sKey, sCloudObj] if rhExist?(@@meta_obj, sCloudObj, :returns, oKeyPath.sFullPath) != 3
begin
oMapPath = KeyPath.new(rhGet(@@meta_obj, sCloudObj, :returns, oKeyPath.sFullPath))
hMap = oMapPath.sFullPath
value = @oProvider.get_attr(get_cObject(oObject), hMap)
hValueMapping = rhGet(@@meta_obj, sCloudObj, :value_mapping, oKeyPath.sFullPath)
if hValueMapping
hValueMapping.each { | found_key, found_value |
if found_value == value
value = found_key
break
end
}
end
rescue => e
raise ForjError.new(), "'%s.get_attr' fails to provide value of '%s'" % [oProvider.class, key]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data\n attributes.fetch(:data)\n end",
"def data\n attributes.fetch(:data)\n end",
"def get_attribute_value(attribute)\n data[attribute]\n end",
"def data\n attributes['data']\n end",
"def _read_attribute(attr)\n @attributes[attr]\n end",
"def attribute_val... | [
"0.6904706",
"0.6904706",
"0.6706959",
"0.6595861",
"0.64358014",
"0.6404217",
"0.6245584",
"0.6245584",
"0.6242144",
"0.61767066",
"0.6160747",
"0.6109227",
"0.60504895",
"0.60254496",
"0.6010325",
"0.59988236",
"0.599168",
"0.59786445",
"0.5965994",
"0.5964459",
"0.58934116... | 0.0 | -1 |
get an attribute/object/... from an object. | def get_data(oObj, *key)
if oObj.is_a?(Hash) and oObj.key?(:object_type)
oObjData = ObjectData.new
oObjData << oObj
else
oObjData = @ObjectData
end
oObjData[oObj, *key]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(object)\n type.get(object)\n end",
"def get(object); end",
"def fetch_attribute_from_object_and_resource(obj, attribute)\n _fetch_attribute_from_object_first(obj, attribute)\n end",
"def get_safe(obj,attr,id)\n a = get_obj(obj,id)\n return try(\"a.#{attr}\") if a and a.r... | [
"0.7240865",
"0.68330497",
"0.67181814",
"0.66553044",
"0.66433805",
"0.65401554",
"0.6509242",
"0.6486668",
"0.6468823",
"0.63785976",
"0.6300267",
"0.6252486",
"0.6252486",
"0.62396264",
"0.62396264",
"0.6232631",
"0.62048894",
"0.619135",
"0.61791545",
"0.61657566",
"0.615... | 0.0 | -1 |
~ def hParams(sCloudObj, hParams) ~ aParams = _get_object_params(sCloudObj, ":ObjectData.hParams") ~ end | def get_cObject(oObject)
return nil if rhExist?(oObject, :object) != 1
rhGet(oObject, :object)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hcGroupParams _obj, _args\n \"_obj hcGroupParams _args;\" \n end",
"def params=(hash); end",
"def params=(hash); end",
"def __get_params(data)\n if @params.kind_of?(Hash)\n @keyword_params = Utils::Hash.keys_to_sym(@params)\n @params = nil\n ... | [
"0.6136737",
"0.6020577",
"0.6020577",
"0.5861519",
"0.5722755",
"0.57027036",
"0.5662899",
"0.5618387",
"0.55719286",
"0.55719286",
"0.5543352",
"0.54801357",
"0.5471646",
"0.54489785",
"0.54458374",
"0.54438835",
"0.54155284",
"0.54060507",
"0.54060507",
"0.54041606",
"0.53... | 0.0 | -1 |
a Process can execute any kind of predefined controler task. Those function build hParams with Provider compliant data (mapped) Results are formatted as usual framework Data object and stored. | def connect(sObjectType)
hParams = _get_object_params(sObjectType, :create_e, :connect, true)
oControlerObject = @oProvider.connect(sObjectType, hParams)
oDataObject = ForjLib::Data.new
oDataObject.set(oControlerObject, sObjectType) { | sObjType, oObject |
begin
_return_map(sObjType, oObject)
rescue => e
raise ForjError.new(), "connect %s.%s : %s" % [@oForjProcess.class, sObjectType, e.message]
end
}
@ObjectData.add oDataObject
oDataObject
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def interpret_task\n\n command = params[:process].to_sym\n respond_to do |format|\n case command\n when :setup\n setup_project() if @project.may_setup?\n @project.setup! # TODO refactor setup_project as a :before callback to event\n\n format.html { redirect_to project_p... | [
"0.6199854",
"0.5831206",
"0.56781065",
"0.56056726",
"0.559536",
"0.5579903",
"0.55633",
"0.5501661",
"0.5455252",
"0.54295295",
"0.53789735",
"0.5363057",
"0.53612",
"0.53405267",
"0.52914786",
"0.52861017",
"0.5270919",
"0.5262767",
"0.5258011",
"0.52524364",
"0.5244606",
... | 0.0 | -1 |
The controller must return true to inform about the real deletion | def delete(sObjectType)
hParams = _get_object_params(sObjectType, :delete_e, :delete, true)
bState = @oProvider.delete(sObjectType, hParams)
@ObjectData.delete(sObjectType) if bState
bState
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n return false\n end",
"def delete\n\t\tfalse\n\tend",
"def destroy\n return false\n end",
"def deleted?\n end",
"def deleted?\n end",
"def destroy\n true\n end",
"def delete\n self.is_deleted = true\n save :validate => false\n true\n end",
"def destroy\n ... | [
"0.78598106",
"0.76525074",
"0.74612355",
"0.72845715",
"0.72845715",
"0.7251751",
"0.72403985",
"0.7223704",
"0.7213853",
"0.7136226",
"0.71304864",
"0.7097129",
"0.70934594",
"0.70934594",
"0.70934594",
"0.70934594",
"0.7080208",
"0.70544845",
"0.69938797",
"0.6976273",
"0.... | 0.0 | -1 |
Functions available for Process to communicate with the controler Object | def cloud_obj_requires(sCloudObj, res = {})
aCaller = caller
aCaller.pop
return res if @ObjectData.exist?(sCloudObj)
#~ return res if rhExist?(@CloudData, sCloudObj) == 1
rhGet(@@meta_obj,sCloudObj, :params).each { |key, hParams|
case hParams[:type]
when :data
if hParams.key?(:array)
hParams[:array].each{ | aElem |
aElem = aElem.clone
aElem.pop # Do not go until last level, as used to loop next.
rhGet(hParams, aElem).each { | subkey, hSubParam |
next if aElem.length == 0 and [:array, :type].include?(subkey)
if hSubParams[:required] and @oForjConfig.get(subkey).nil?
res[subkey] = hSubParams
end
}
}
else
if hParams[:required] and @oForjConfig.get(key).nil?
res[key] = hParams
end
end
when :CloudObject
#~ if hParams[:required] and rhExist?(@CloudData, sCloudObj) != 1
if hParams[:required] and not @ObjectData.exist?(sCloudObj)
res[key] = hParams
cloud_obj_requires(key, res)
end
end
}
res
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process\n end",
"def process\n raise \"Must be implemented\"\n end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def manage_processes\n puts \"in manage process... | [
"0.70587337",
"0.6702603",
"0.6643209",
"0.6643209",
"0.6643209",
"0.6643209",
"0.6643209",
"0.6643209",
"0.6643209",
"0.6643209",
"0.6455936",
"0.63539416",
"0.6318253",
"0.6318253",
"0.6272446",
"0.6266425",
"0.6260481",
"0.624903",
"0.62284136",
"0.61609733",
"0.6096788",
... | 0.0 | -1 |
Creating all Events and Locations | def get_events_from_api(name)
#make the web request
name1 = name
performer_link = "https://app.ticketmaster.com/discovery/v2/events.json?keyword=#{name1}&countrycode=US&apikey=ShI4Sd340EJ32f1k6rUgkYPocLSO2qTq"
response_string = RestClient.get(performer_link)
response_hash = JSON.parse(response_string)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_events\n end",
"def create\n @location = Location.find(params[:location_id])\n @event_types = EventType.all(:order => 'name') # strictly for display of error\n \n # sanitize and all that\n #params[:event][:event_details_attributes][:\"0\"][:desc] = format_content(params[:event][:event_... | [
"0.73659587",
"0.67742026",
"0.6745469",
"0.65251094",
"0.6504549",
"0.63806915",
"0.63742465",
"0.632731",
"0.6301749",
"0.6301749",
"0.62766266",
"0.6256654",
"0.62223446",
"0.61977",
"0.6188487",
"0.61843145",
"0.6156372",
"0.6154087",
"0.6124104",
"0.6118043",
"0.61018634... | 0.0 | -1 |
only the user (or admins) can see their own profile | def show
@user = current_user
@individual_plants = @user.individual_plants
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n authorize @user # Can only see your own profile\n end",
"def authorize_user\n @profile = current_user.profile\n return if @profile\n flash[:alert] = \"You can only edit your own profile\"\n redirect_to profile_path\n end",
"def only_your_profile_page\n @admin = Admin.find(params[... | [
"0.82277584",
"0.7772167",
"0.77507114",
"0.773031",
"0.75985533",
"0.7583857",
"0.7562777",
"0.7550676",
"0.74464935",
"0.7411911",
"0.73391086",
"0.7322837",
"0.7296186",
"0.71080685",
"0.7096989",
"0.70836824",
"0.7077489",
"0.70616287",
"0.7050788",
"0.70402366",
"0.70325... | 0.0 | -1 |
delete account: user and admins in rare occasions | def destroy
@user = current_user
@user.destroy
session[:user_id] = nil
flash[:alert] = "Account has been deleted"
redirect_to plants_path
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_accounts\n end",
"def destroy\n flash[:error] = 'Accounts can only be deleted by admins!'\n redirect_to edit_user_registration_path\n end",
"def delete_account_helper\n current_user = User.find(self.user.id)\n current_user.delete\n puts \"Your account has successfully be... | [
"0.7862512",
"0.7573379",
"0.7544054",
"0.73403275",
"0.7328477",
"0.7300385",
"0.72429764",
"0.72277313",
"0.7212393",
"0.72106904",
"0.71995294",
"0.71947587",
"0.71455735",
"0.71380955",
"0.70928735",
"0.70025",
"0.69793534",
"0.69352704",
"0.6891332",
"0.6863419",
"0.6847... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.