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 |
|---|---|---|---|---|---|---|
If user is logged in, returns them as json object else returns null TODO: (performance) don't need to return full user object
|
def get_cur_user
@user = nil
if is_logged_in session
@user = User.find_by_sunet(session[:user_hash]["username"])
end
render json: @user
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def logged_in\n #checks to see if a current user is available \n \n if @current_user\n render json: {\n logged_in: true,\n user: @current_user\n }\n else \n render json: {\n logged_in: false\n }\n end \n\n end",
"def check_for_user\n if current_user\n @user = current_user\n else\n @user = {}\n end\n render json: @user\n end",
"def user\n hash = {\n provider: 'josh_id',\n id: current_user.id.to_s,\n info: {\n email: current_user.email,\n username: current_user.username,\n #first_name: current_user.first_name,\n }\n }\n\n render json: hash.to_json\n end",
"def logged_in\n if @current_user\n #this does not return a http status because this is a get request not a post. \n render json:{\n logged_in: true, \n user: @current_user\n }\n else \n render json: {\n logged_in: false\n }\n end\n end",
"def user_hack\n user.as_json\n end",
"def user_info\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n\n respond_to do |format|\n name = @current_user.name\n username = @current_user.username\n format.json {\n render json: {\n :name => name,\n :username => username,\n }.to_json, status: 200\n }\n end\n end",
"def get_user\n if params[:email].nil?\n render json: current_user,\n except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n case_cortege: {},\n cortege: {},\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n },\n funkis_application: {\n include: [\n funkis_shift_applications: {\n include: [\n funkis_shift: {\n include: [\n :funkis_category\n ],\n except: [\n :maximum_workers\n ]\n }\n ]\n }\n ]\n }\n }\n else\n user = User.find_by email:(params[:email])\n unless user.nil?\n if current_user.has_admin_permission? AdminPermission::ALL\n render json: user,\n include: {\n case_cortege: {},\n cortege: {},\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n },\n funkis_application: {\n include: [\n funkis_shift_applications: {\n include: [\n funkis_shift: {\n include: [\n :funkis_category\n ],\n except: [\n :maximum_workers\n ]\n }\n ]\n }\n ],\n }\n }\n elsif current_user.has_admin_permission? AdminPermission::ORCHESTRA_ADMIN\n render json: user, except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n }\n }\n\n elsif current_user.has_admin_permission? \\\n AdminPermission::LIST_CORTEGE_APPLICATIONS || AdminPermission::APPROVE_CORTEGE_APPLICATIONS\n render json: user, except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n case_cortege: {},\n cortege: {},\n }\n elsif current_user.has_admin_permission? AdminPermission::LIST_FUNKIS_APPLICATIONS\n render json: user, except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n case_cortege: {},\n cortege: {},\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n },\n funkis_application: {\n include: [\n funkis_shift_applications: {\n include: [\n funkis_shift: {\n include: [\n :funkis_category\n ],\n except: [\n :maximum_workers\n ]\n }\n ]\n }\n ],\n }\n }\n else\n render json: user, except: [\n :created_at,\n :updated_at,\n :permissions\n ]\n end\n else\n render :status => '404', :json => {:message => 'Användare kunde inte hittas'}\n end\n end\n end",
"def json_show_signed_user\n\n @current_user = current_user\n respond_to do |format|\n #format.json { render json: @current_user.as_json(only:[:id,:username]), status: :ok}\n if @current_user.nil?\n format.json { render json: 'user not found' , status: :not_found }\n else\n format.json { render json: @current_user.as_json(only:[:id,:username]), status: :ok}\n end\n\n\n end\n end",
"def me\n user = current_user\n render :json => user.to_json(:only => [:id, :name, :email, :avatar_url])\n end",
"def show\n\tuser_completed = @user.as_json(:only => [:id, :username, :login, :email, :guild_id, :otp_secret, :otp_required_for_login])\n\t\t\t\t\t\t.merge(guild: @user.guild, achievments: @user.achievments)\n\tif self.user_owner?\n \trender json: user_completed, status: :ok\n\telse\n \trender json: user_completed.except(:email, :otp_required_for_login), status: :ok\n\tend\n end",
"def user\n render json: current_user\n end",
"def current_user_info\n\t\trespond_to do |format|\n\t\t\tif !current_user\n\t\t\t\tformat.json { render json: { 'User' => 'not logged in' } }\n\t\t\telse\n\t\t\t\tformat.json { render json: { 'Name' => current_user.name, 'Image' => getFacebookPicURL(current_user) } }\n\t\t\tend\n\t\tend\n\tend",
"def getUser\n render json: @current_user, status: 200\n end",
"def get_current_user\n respond_to do |format|\n format.json {\n\n if @current_user \n render :json => @current_user\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end",
"def get_current_logged_in_user \n get(\"/users.json/current\")\nend",
"def get_current_logged_in_user \n get(\"/users.json/current\")\nend",
"def logged_in\n return bad_request unless request.format.json? or request.format.js?\n @response = {:logged_in => logged_in?}\n json_response\n end",
"def logged_in_user\n unless logged_in?\n render json: false, status: :unauthorized\n # store_location\n end\n end",
"def auto_login\n render json: logged_in_user\n end",
"def my_current_user\n render json: current_user\n end",
"def user\n {\n id: object.user.id,\n email: object.user.email,\n birthday: object.user.birthday,\n first_name: object.user.first_name,\n middle_name: object.user.middle_name,\n last_name: object.user.last_name,\n phone: object.user.phone,\n gender: object.user.gender,\n neighborships: object.user.neighborships\n }\n end",
"def logged_in\n\n puts @current_user.inspect\n\n \n\n if @current_user && @current_user.email_confirmed\n\n \n \n render json: {\n \n logged_in: true,\n user: @current_user\n }\n else\n render json: {\n logged_in: false\n }\n end\n end",
"def user\n {id: object.user.id, username: object.user.username, avatar: object.user.avatar}\n end",
"def show\n if create_user\n logger.debug @user.inspect\n render json: @user\n else\n render json: { error: 'User is not logged in!' }, status: :unprocessable_entity\n end\n end",
"def user_information\n { \"username\": @user.username, \"email\": @user.email, \"id\": @user.id }\n end",
"def me\n render json: current_user\n end",
"def get_user_info\n id = params[\"id\"]\n error_list = []\n status = 1\n json_response = {}\n user = User.find_by(id: id)\n\n if user.nil?\n error_list.append(\"Error: The specified user doesn't exist.\")\n status = -1\n else\n json_response[\"user\"] = user.get_user_json_data\n end\n\n if status == -1\n json_response[\"errors\"] = error_list\n end\n\n json_response[\"status\"] = status\n\n # Format the json_response into proper JSON and respond with it\n json_response = json_response.to_json\n\n respond_to do |format|\n format.json { render json: json_response }\n end\n end",
"def auth\n\n @user = current_user\n render json: @user\n \n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n if @current_user and @current_user == @user\n format.json { render json: @user }\n else\n format.json { render :json => @user, :except => [:perishable_token, :persistence_token, :email, :single_access_token, :last_login_ip, :current_login_ip, :crypted_password, :password_salt] }\n end\n end\n end",
"def show \n render json: @current_user\n end",
"def show_current_user\n render json: current_user\n end",
"def auto_login\n render json: @user\n end",
"def user_check\n if user_signed_in?\n render status: :ok, json: current_user\n else\n render status: :forbidden, nothing: true\n end\n end",
"def login \n render json: User.first\n end",
"def is_logged_in?\n if logged_in? && current_user\n render json: {\n logged_in: true,\n user: current_user\n }\n else\n render json: {\n logged_in: false,\n message: 'no such user'\n }\n end\n end",
"def logged_in_user\n unless logged_in?\n render json: { error: 'Log in to access this page'}, status: :unauthorized\n end\n end",
"def user_info\n @user = @github.users.get user: params[:username]\n render json: Hash[@user]\n end",
"def user1\n if user = User.where(\"lower(users.login) = ?\", params[:login].downcase).first\n result = {\n :id => user.id,\n :username => user.login,\n :name => user.name,\n :avatar_url => user.avatar_url,\n :location => user.location\n }\n render json: result\n else\n head :not_found\n end\n end",
"def user\n @user = current_user\n\n respond_to do |format|\n format.json { render :json => {:user => @user.as_json(:json => 'wall') }}\n end\n end",
"def show\n render json: @currentUser\n end",
"def show \n user=current_user\n user={name: user.name,email: user.email ,phone: user.phone,avatar: user.avatar}\n json_response(user)\n end",
"def auto_login\n render json: @user\n end",
"def user\n {user_id: self.object.user.id,\n user_name: self.object.user.name\n }\n end",
"def auto_login\n render json: @user\n end",
"def auto_login\n render json: @user\n end",
"def check_sign\n user = @current_user\n render :json => { login:true , admin: user.admin, user: {login:user.login, type:user.user_type, id: user.id}}\n end",
"def show\n json_response(current_user.decorate, :ok)\n end",
"def user_data\n {\n user_id: @user.id,\n email: @user.email\n }\n end",
"def show\n # Will only reach this method if current_user is defined\n render json: { user: @current_user }\n end",
"def logged_in_user\n return nil if !logged_in?\n return session[\"app_user\"]\n end",
"def logged_in_user\n if (!logged_in?)\n return User.logged_out_user\n end\n #return nil if !logged_in?\n return session[\"app_user\"]\n end",
"def get_user_info()\n return_map = nil\n if session[:google_unique] != nil && user_credentials.access_token != nil\n return_map = {}\n return_map['email'] = session[:googleemail]\n return_map['sub'] = session[:google_unique]\n return_map['useralias'] = session[:useralias]\n end\n return return_map\nend",
"def current\n if current_user\n current_user.update!(last_login: Time.zone.now)\n render json: current_user\n else\n not_auth\n end\n end",
"def profile\n render json: @current_user\n end",
"def show \n user = User.find_by(id: session[:user_id])\n if user\n render json: user\n else \n render {error: \"Not authorized\"}, status: :unauthorized\n end\n end",
"def get_session\n if session[:user_id].present? && session[:user_name].present?\n @result = {flag:true , session_id: session[:user_id] , :user_name=> session[:user_name]}\n render :json=>@result\n else \n @result = {flag:false}\n render :json=>@result\n end\n end",
"def logged_in\n return bad_request unless request.format.json? or request.format.js?\n @response = { logged_in: logged_in? }\n render_cross_origin_json\n end",
"def user_data\n User.user_data login\n end",
"def index\n @users = User.all\n\n @user = User.find_by_id(session[:user_id])\n @logged_in = true if @user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def current\n render json: current_user\n end",
"def get_profile_info\n res = {}\n res[:user] = User.select(:login, :city_id, :email, :admin).where(id: session[:user_id]).take\n res[:character] = Character.select(:id, :title).where(id: @current_user.character_id).take\n render json: res\n end",
"def hubssolib_get_user_data\n user = self.hubssolib_current_session ? self.hubssolib_current_session.session_user : nil\n\n if (user && user.user_id)\n return user\n else\n return nil\n end\n end",
"def show\n # byebug\n user = User.find_by(id: session[:user_id])\n render json: user\n end",
"def show\n {\n id: @current_user.id,\n email: @current_user.email,\n access_token: @current_user.access_token\n }\n end",
"def user_hash\n response_hash.key?(:user) ? response_hash[:user] : {}\n end",
"def show\n {\n id: @current_user.id,\n first_name: @current_user.first_name,\n last_name: @current_user.last_name,\n email: @current_user.email,\n role_name: @current_user.super_admin ? 'Super Admin' : @current_user.role.try(:name),\n permissions: Permissions::Builder.user_permissions(@current_user)\n }\n end",
"def show\n if current_api_user.id == @user.id\n render json: @user.as_json(except: [:updated_at])\n else\n render json: @user.as_json(except: [:google_id, :updated_at])\n end\n end",
"def userinfo\n object.fetch(:userinfo) {\n @object[:userinfo] = (format_userinfo(\"\") if @object[:user])\n }\n end",
"def user_info\n @user_info ||= raw_info.nil? ? {} : raw_info\n end",
"def user_info\n @user_info ||= raw_info.nil? ? {} : raw_info\n end",
"def get_user_data\n user_data = nil\n \n if cookies.has_key?(:user_data) && cookies[:user_data].to_s != ''\n user_data = string_to_hash(cookies[:user_data])\n end\n user_data\n end",
"def to_json\n attrs = attributes\n if attrs['user'] && attrs['user']['id'] == '$current'\n attrs.delete 'user'\n end\n attrs.to_json\n end",
"def user_data\n {:username => self.username,\n :pic_url => self.user_pic,\n :profile_url => self.profile_url\n }\n end",
"def getUserInfo\n login_user_id = params[:my_id].to_i\n login_user = User.find(login_user_id)\n\n target_user_id = params[:target_id].to_i\n target_user = User.find(target_user_id)\n\n # target_userをフォローしているか\n login_user_follow = login_user.follows_of_from_user.pluck(:id).include?(target_user_id)\n\n # target_userの記事一覧を取得\n articles_hash = make_articles_hash(target_user.articles, target_user)\n\n if articles_hash.blank?\n res = {\n result: false,\n data: nil\n }\n else\n res = {\n result: true,\n data: {\n user_id: target_user_id,\n name: target_user.name,\n follow: login_user_follow,\n profile_image: target_user.profile_image_path,\n articles: articles_hash\n }\n }\n end\n\n render json: res\n end",
"def user_show_data\n user = User.find(params[:user])\n\n @data = {\n name: user.full_name,\n email: user.email,\n title: user.title,\n school_name: user.organization.name,\n logo_link: user.organization.logo_link,\n points: user.points,\n reviews: reviews_from_user(user),\n protips: protips_from_user(user),\n receives_weekly_digest: user.receives_weekly_digest,\n active: user.active\n }\n\n render json: @data\n end",
"def sign_in_json\n {\n id: pretty_id,\n email: email,\n firstname: firstname,\n lastname: lastname,\n }\n end",
"def no_call_current_user\n token = get_token\n decoded_token = decode_token(token)\n user = User.find(decoded_token['user_id'])\n {\n name: user[:name],\n email: user[:email],\n user_id: user[:id]\n }\n end",
"def current_user\n if session[:user_id] == nil\n return {}\n end\n\n # ruby - implicit return\n return run_sql(\"SELECT * FROM users WHERE id = #{session[:user_id]};\")[0]\nend",
"def getLoggedInUser\n if session[:user_id]\n return User.find(session[:user_id])\n else\n return nil\n end\n end",
"def current_user\n unless request.format.json?\n @current_user ||= User.find_by_auth_token(cookies[:auth_token]) if cookies[:auth_token]\n end\n @current_user\n end",
"def json_show_user_profile_by_user_id\n @user = User.find(params[:user_id])\n\n respond_to do |format|\n format.json { render json: @user.as_json(only:[:email,:username]) }\n end\n end",
"def show\n render json: UserSerializer.render(\n object: current_user,\n include_root: true\n )\n end",
"def get_logged_in_user\n if @logged_in\n if Student.exists?(session[:id])\n @logged_in_user = Student.find(session[:id])\n elsif Marker.exists?(session[:id])\n @logged_in_user = Marker.find(session[:id])\n end\n end\n end",
"def my_profile\n render json: { user: current_user}\n end",
"def current\n # mynamejeff = current_user.as_json(:methods => [user_requests])\n user_requests = current_user.pto_requests\n .where(is_deleted: nil)\n .or(current_user.pto_requests.where(is_deleted: 0))\n .to_a\n render json: {\n id: current_user.id,\n email: current_user.email,\n name: current_user.name,\n ten_hour_shift: current_user.ten_hour_shift,\n position: current_user.position,\n team: current_user.team,\n start_time: current_user.start_time,\n end_time: current_user.end_time,\n work_days: current_user.work_days,\n on_pip: current_user.on_pip,\n pto_requests: user_requests\n }\n end",
"def sign_in_user\n \tresult = {success: false, status_code: 403, message:\"Unprocessable Entity\"}\n\n \tunless params[:email].blank? && params[:password].blank?\n \t\tuser = User.find_for_authentication(email: params[:email])\n\n \t\tif user && user.active == true\n \t\t\tif user.valid_password?(params[:password])\n \t\t\t\tresult = {\n success: true,\n status_code: 200,\n user_name: user.name_with_surname,\n user_email: user.email,\n token: user.token_pass,\n code: user.rol.code\n }\n \t\t\tend\n else\n result[:status_code] = 401\n result[:message] = 'Unauthorized, The user is inactive.'\n \t\tend\n \tend\n\n \trender json: result.to_json(except:[:created_at, :updated_at, :active])\n end",
"def show\n render json: current_user, except: [:id]\n end",
"def show\n user = User.find_by(id: session[:user_id])\n if user\n render json: user, status: :ok\n else\n render json: {errors: \"Not authorized\"}, status: :unauthorized\n end\n end",
"def current_user_signed_in\n respond_to do |format|\n format.js { render :json => current_user }\n end\n end",
"def to_json(arg = nil)\n self.as_json(include: [:authentications]).to_json\n end",
"def show\n @user = User.find(params[:id])\n @authorized_user = User.find(session[:user_id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def logged_in?\n \trespond_to do |format|\n\t format.html { session[:currentUser].present? } \n\t format.json {\n\n begin\n if (not params[:token].nil?)\n @token = Token.where(:Value => params[:token]).first\n else\n @theparameters = JSON.parse(request.raw_post)\n @token = Token.where(:Value => @theparameters.fetch(\"token\")).first\n end\n @userr = @token.user\n\n if is_admin(@userr)\n return true\n \n elsif not @userr.events.select{ |ev| not ev.Completed and ev.EventDate.to_date + 2 >= Date.today}.empty?\n return true\n else\n raise Exception, \"There are no events currently active for this user.\"\n end\n rescue Exception => e\n raise Exception, \"can't find the user\"\n end\n }\n\t end\n end",
"def prefill_if_logged_in(data)\n return if Person.current.anonymous?\n data.name ||= Person.current.name\n data.email ||= Person.current.email\n end",
"def showUser\n render :json =>{message: @current_user}\n end",
"def show\n json_response(@user)\n end",
"def user_from_session\n user = user_from_claims\n return user unless session[:auth0_json]\n raw = JSON.parse(session[:auth0_json] || '{}').with_indifferent_access.fetch(:extra, {}).fetch(:raw_info, {})\n user.email = raw.fetch(:email, user.email)\n user.picture = raw.fetch(:picture, user.picture)\n user.user_metadata = raw.fetch(:user_metadata, user.user_metadata)\n user\n end",
"def me\n render status: 200, json: current_user.db_user.as_json(only: [:id, :email], include: { discord_identity: { }, roles: { include: { nested_roles: { include: { role_nested: { } } } } } }, methods: [:main_character])\n end",
"def get_logged_in_user\n if logged_in?\n user = User.find(session[:current_user_id])\n if user\n return user\n else\n return nil\n end\n end\n \n #default return nil\n nil\n end",
"def user_from_json\n json = JSON.parse request.body\n\n username = json['authentication']['email']\n password = json['authentication']['password']\n\n if user = User.authenticate(email, password)\n user\n else\n nil\n end\n end"
] |
[
"0.75193197",
"0.73531914",
"0.7243217",
"0.7226272",
"0.7189483",
"0.7155826",
"0.7095808",
"0.70825005",
"0.70557064",
"0.70433116",
"0.7018541",
"0.6986694",
"0.6966792",
"0.69597805",
"0.6919595",
"0.6919595",
"0.6900745",
"0.68041307",
"0.6800998",
"0.67803276",
"0.6724934",
"0.6709344",
"0.66982126",
"0.6647838",
"0.6639372",
"0.6634609",
"0.6625951",
"0.6621684",
"0.6621352",
"0.66158724",
"0.66100746",
"0.6609637",
"0.65978485",
"0.65875167",
"0.65776974",
"0.6568451",
"0.6537531",
"0.6526157",
"0.6510793",
"0.6499823",
"0.64997464",
"0.6499126",
"0.64867187",
"0.6483053",
"0.6483053",
"0.6478039",
"0.6477637",
"0.6476857",
"0.6464495",
"0.64621174",
"0.6454032",
"0.6443828",
"0.64421767",
"0.64392173",
"0.6436008",
"0.6428827",
"0.6423876",
"0.64185673",
"0.64178574",
"0.63976437",
"0.63817453",
"0.63798106",
"0.63784677",
"0.6377348",
"0.63768077",
"0.63760227",
"0.63748777",
"0.63728964",
"0.636472",
"0.636472",
"0.6362114",
"0.63619995",
"0.6352443",
"0.6350654",
"0.63477135",
"0.63477117",
"0.63474816",
"0.63463223",
"0.63405335",
"0.6323515",
"0.6322557",
"0.6314661",
"0.63139963",
"0.630996",
"0.6306539",
"0.6294631",
"0.62929887",
"0.62850785",
"0.6273686",
"0.62600994",
"0.6247427",
"0.6238674",
"0.62379515",
"0.6237726",
"0.62268364",
"0.62186855",
"0.62106586",
"0.6203236",
"0.619146"
] |
0.7386238
|
2
|
must be either asc or desc
|
def sort_direction
%w[asc desc].include?(params[:direction]) ? params[:direction] : "asc"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def is_ordering?\n name =~ /^(ascend_by|descend_by)/ || arguments.blank?\n end",
"def define_order(s_order)\n s_order=='Crescente' ? :asc : :desc\n end",
"def ascending?\n direction == :asc\n end",
"def validate_sort_field( value )\n if [ 'title', 'code', 'created_at' ].include?( value )\n return value\n else\n return 'title'\n end\n end",
"def set_order( params )\n return 'desc' if (params[:order]=='asc')\n return 'asc'\n end",
"def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"def sort_direction user_input\n if user_input.nil? then\n ret_val='asc'\n elsif user_input.downcase == 'desc' then\n ret_val= 'desc'\n else\n ret_val='asc'\n end\n return ret_val\n end",
"def sort_methods\n [\n 'score desc',\n 'authors_sort asc',\n 'authors_sort desc',\n 'title_sort asc',\n 'title_sort desc',\n 'journal_sort asc',\n 'journal_sort desc',\n 'year_sort asc',\n 'year_sort desc'\n ]\n end",
"def valid_index?\n param! :sort_by, String, default: 'id:asc'\n end",
"def valid_index?\n param! :sort_by, String, default: 'id:asc'\n end",
"def valid_index?\n param! :sort_by, String, default: 'id:asc'\n end",
"def is_sorted\r\n false\r\n end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"desc\"\n end",
"def validate_order!(options)\r\n return unless options && options[:order]\r\n\r\n (options[:order] = options[:order].to_s).split(/, +/).each do |order|\r\n sort = order.split(/ +/)\r\n\r\n if [1, 2].include? sort.size\r\n attribute, direction = sort\r\n else\r\n raise InvalidSort, \"order must be in the form 'attribute [asc/desc]'\"\r\n end\r\n\r\n if column = sortable(options[:version])[attribute.to_sym]\r\n if column.is_a? TrueClass\r\n column = attributes(options[:version])[attribute.to_sym].to_s\r\n end\r\n\r\n options[:order] = options[:order].sub attribute, column\r\n else\r\n if sortable.empty?\r\n raise InvalidSort, \"this resource can not be sorted\"\r\n else\r\n raise InvalidSort, \"order must be one of #{sortable.keys * ', '}\"\r\n end\r\n end\r\n\r\n unless direction.nil? || direction =~ /^(?:asc|desc)$/i\r\n raise InvalidSort, \"order direction must be 'asc' or 'desc'\"\r\n end\r\n end\r\n\r\n options[:order]\r\n end",
"def valid_order_by_values\n [:created_at, :updated_at]\n end",
"def hows_by_alphabetical_order\nend",
"def default_sort\n 'name asc'\n end",
"def sortable?\n return false if multiple?\n\n human_readable?\n end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"desc\"\n end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"desc\"\n end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"desc\"\n end",
"def sort_requires_case_norm?(col)\n return false if col =~ /_at$/ # no timestamps\n return false if col =~ /^is_/ # no booleans\n return false if col =~ /_count$/ # no integers\n\n true\n end",
"def asc(arg, opts=OPTS)\n SQL::OrderedExpression.new(arg, false, opts)\n end",
"def search_and_sort(value, direction)\n if value.blank? && direction.blank?\n Technologist.all.order(\"technologists.name ASC\")\n elsif value.blank? && direction=='asc'\n Technologist.all.order(\"technologists.name ASC\")\n elsif value.blank? && direction=='desc'\n Technologist.all.order(\"technologists.name DESC\")\n elsif value && direction=='asc'\n Technologist.full_text_search(value).reorder(\"technologists.name ASC\").with_pg_search_rank\n elsif value && direction=='desc'\n Technologist.full_text_search(value).reorder(\"technologists.name DESC\").with_pg_search_rank\n else\n Technologist.full_text_search(value).with_pg_search_rank\n end\n end",
"def sort_direction\n params[\"order\"][\"0\"][\"dir\"] == \"desc\" ? \"desc\" : \"asc\"\n end",
"def validate_review_sort()\n \nend",
"def add_sort_field(*) super end",
"def sort_value_from_arg(arg) # :nodoc:\n case arg\n when /^asc/i\n arg = 1\n when /^desc/i\n arg = -1\n when Number\n arg.to_i >= 0 ? 1 : -1\n else\n arg ? 1 : -1\n end\n end",
"def direction\n @params[:direction] || :desc\n end",
"def sort_direction\n params[:dir] == \"asc\" ? \"asc\" : \"desc\"\n end",
"def sort_params; end",
"def sort_params; end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end",
"def sort_value(value)\n val = value.to_s.downcase\n return 1 if ASCENDING_CONVERSION.include?(val)\n return -1 if DESCENDING_CONVERSION.include?(val)\n raise InvalidSortValueError.new(\n \"#{self} was supplied as a sort direction when acceptable values are: \" +\n \"EM::Mongo::ASCENDING, 'ascending', 'asc', :ascending, :asc, 1, EM::Mongo::DESCENDING, \" +\n \"'descending', 'desc', :descending, :desc, -1.\")\n end",
"def ordering_query; end",
"def check_sort_options #:nodoc:\r\n table_name = @tables.first[1]\r\n return if session[table_name][:sort].nil? || @records.class != Mongoid::Criteria\r\n\r\n sort, direction = session[table_name][:sort].split(' ')\r\n @records = @records.order_by( sort => direction.to_i )\r\nend",
"def a_or_d(order_end)\n case order_end\n when 'asc' then \"A\"\n when 'desc','',nil then \"D\"\n else nil\n end\n end",
"def default_ordering(field_name)\n case field_name\n when \"status\"; return(\"ascending\")\n when \"from\"; return(\"ascending\")\n when \"subject\"; return(\"ascending\")\n when \"date\"; return(\"descending\")\n end \n end",
"def sort_requires_case_norm?(col)\n return false if col.match?(/_at$/) # no timestamps\n return false if col.match?(/^is_/) # no booleans\n return false if col.match?(/_count$/) # no integers\n return false if col.match?(/date$/) # no dates\n\n true\n end",
"def validate_sort(params, default = \"\")\n return default unless valid_sort_param?(params)\n \n params[:sort].blank? ? default : params[:sort]\n end",
"def ascending_terms\n %w(asc ascending <)\n end",
"def parse_direction(direction)\n direction.to_s.match(/^desc/i) ? 'desc' : 'asc'\n end",
"def sort_direction\n params[:direction] || \"asc\"\n end",
"def ordering_by\n order && order.to_s.gsub(/^(ascend|descend)_by_/, '')\n end",
"def sort_with!(field, direction)\n return self if 'usefulness' == field && 'desc' == direction\n return self.reverse! if 'usefulness' == field && 'asc' == direction\n if 'asc' == direction\n self.sort! { |review1, review2| review1[field] <=> review2[field]}\n elsif 'desc' == direction\n self.sort! { |review1, review2| review2[field] <=> review1[field]}\n end\n end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end",
"def ordering_by_case?(order_value)\n order_value.expr.is_a?(Arel::Nodes::Case)\n end",
"def order; end",
"def order; end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"desc\"\n end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"desc\"\n end",
"def asc\n OrderedExpression.new(@expression, false, :nulls=>@nulls)\n end",
"def apply_sort(query, table, column_name, allowed, direction)\n validate_query_table_column(query, table, column_name, allowed)\n validate_sorting(column_name, allowed, direction)\n\n # allow sorting by field mappings\n sort_field = @build.build_custom_calculated_field(column_name)&.fetch(:arel)\n sort_field = table[column_name] if sort_field.blank?\n\n if sort_field.is_a? String\n sort_field\n elsif direction == :desc\n Arel::Nodes::Descending.new(sort_field)\n else\n #direction == :asc\n Arel::Nodes::Ascending.new(sort_field)\n end => sort_field_by\n\n query.order(sort_field_by)\n end",
"def sort_dir\n params[:sort_dir] == 'desc' ? 'desc' : 'asc'\n end",
"def articles_desc\n articles_asc.reverse\n end",
"def asc\n OrderedExpression.new(self, false)\n end",
"def order_statement_regex\n /^(?<table>\\w+)\\.(?<column>\\w+) (?<direction>asc|desc)$/\n end",
"def check_sort_options() #:nodoc:\r\n table_name = @tables.first[1]\r\n old_sort = session[table_name][:sort].to_s\r\n sort, direction = old_sort.split(' ')\r\n# sort is requested\r\n if params['sort']\r\n # reverse sort if same selected\r\n if params['sort'] == sort\r\n direction = (direction == '1') ? '-1' : '1'\r\n end\r\n direction ||= 1\r\n sort = params[:sort]\r\n session[table_name][:sort] = \"#{params['sort']} #{direction}\"\r\n session[table_name][:page] = 1\r\n end\r\n @records.sort( sort => direction.to_i ) if session[table_name][:sort]\r\n params['sort'] = nil # otherwise there is problem with other links\r\nend",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : 'asc'\n end",
"def check_query_def\n # check if filters match possible column names\n cn = columns.collect { |c| c[:id] }\n @query_def.filters.each_pair do |f,v|\n raise Cuca::ApplicationException.new(\"Unknown column in filters: #{f}\") unless cn.include?(f)\n end\n \n return if @query_def.order_by == ''\n # check if order_by is a valid column\n raise Cuca::ApplicationException.new(\"Unknown sort order: #{@query_def.order_by}\") \\\n unless cn.include?(@query_def.order_by)\n end",
"def sort_by\n unless params[:sort].blank?\n params[:sort] if params[:sort] == 'created_at' || 'vote_score' || 'replies'\n else\n 'created_at'\n end\n end",
"def index\n #next 2 lines say if nil equal ....\n params[:sort] ||='name'\n params[:direction] ||='ASC'\n\n @displays=Display.order(params[:sort]+\" \"+ params[:direction] )\n @displays=@displays.paginate(:page=>params[:page])\n\n end",
"def data_order_statement_regex\n /^(?<test_name>.+) (?<term>\\d{4}-\\d{4}) (?<key>.+) (?<direction>asc|desc)$/\n end",
"def search_and_sort(value, direction)\n if value.blank? && direction.blank?\n Servicer.all.order(\"servicers.name ASC\")\n elsif value.blank? && direction=='asc'\n Servicer.all.order(\"servicers.name ASC\")\n elsif value.blank? && direction=='desc'\n Servicer.all.order(\"servicers.name DESC\")\n elsif value && direction=='asc'\n Servicer.full_text_search(value).reorder(\"servicers.name ASC\").with_pg_search_rank\n elsif value && direction=='desc'\n Servicer.full_text_search(value).reorder(\"servicers.name DESC\").with_pg_search_rank\n else\n Servicer.full_text_search(value).with_pg_search_rank\n end\n end",
"def desc(arg, opts=OPTS)\n SQL::OrderedExpression.new(arg, true, opts)\n end",
"def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end",
"def orderable? = super && index.orderable?",
"def condition_sort(input)\n poke_name = input.poke_name\n product_db = SearchRecord::For.klass(Entity::Product)\n case input.sort\n when 'id'\n product_db.find_full_name(poke_name)\n when 'likes_DESC'\n product_db.order_by_desc_likes(poke_name)\n when 'likes_ASC'\n product_db.order_by_asc_likes(poke_name)\n when 'rating_DESC'\n product_db.order_by_desc_rating(poke_name)\n when 'rating_ASC'\n product_db.order_by_asc_rating(poke_name)\n when 'price_DESC'\n product_db.order_by_desc_price(poke_name)\n else\n # priceASC\n product_db.order_by_asc_price(poke_name)\n end\n end",
"def ordering_by_lower?(order_value)\n order_value.expr.is_a?(Arel::Nodes::NamedFunction) && order_value.expr&.name&.downcase == 'lower'\n end",
"def default_sort_option\n\t\t'name'\n\tend",
"def sortable?(attr)\n model_class.column_names.include?(attr.to_s) || \n sort_mappings.include?(attr.to_sym)\n end",
"def check_kaminari_sort(klass, column = nil, dir = nil)\n if (column.nil? && dir.nil?)\n return klass::DEFAULT_ORDER\n end\n begin\n unless klass::SORTABLE_COLUMNS.include? column\n raise ArgumentError, \"Column (#{column.to_s}) is not sortable for model #{klass.to_s}. See #{klass.to_s}::SORTABLE_COLUMNS\"\n end\n rescue ArgumentError => e\n puts e.message\n return klass::DEFAULT_ORDER\n end\n safe_col = column\n safe_dir = (dir == 'asc') ? 'asc' : 'desc'\n return '%s %s' % [safe_col, safe_dir] # sql order by clause\n end",
"def build_order\n\t\t\tp = params.permit(:terms, :order)\n\t\t\tif p['order']\n\t\t\t\tattribute, asc_desc = p['order'].split(\" \")\n\t\t\t\tif ['terms', 'count', 'updated_at'].include?(attribute) && ['asc', 'desc'].include?(asc_desc)\n\t\t\t\t\treturn \"#{attribute} #{asc_desc}\"\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn \"updated_at desc\"\n\t\tend",
"def sort_column\n %w[fullname school].include?(params[:sort]) ? params[:sort]: \"created_at\"\n end",
"def sort_direction\n %w[asc, desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end",
"def extjs_sorting?\n params[:sort] && params[:dir]\n end",
"def genere_sortie( attendu )\n out, err, statut = yield\n out.must_equal attendu\n err.must_be_empty\n statut.must_equal 0\nend",
"def valid_orders\n VALID[:order_by]\n end",
"def sort_options(sort_string)\n sort_string[/['\"]?(\\w+)['\"]? *(asc|desc)?/i]\n [$1, ($2 || 'asc')]\n end",
"def sort_direction\n %w[asc desc].include?(params[:sort]) ? params[:sort] : nil\n end",
"def sort_direction\n %w[asc desc].include?(params[:sort]) ? params[:sort] : nil\n end",
"def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end",
"def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end",
"def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end",
"def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end",
"def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end",
"def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end"
] |
[
"0.6949707",
"0.6460089",
"0.63926715",
"0.6380408",
"0.6289623",
"0.61716545",
"0.61716545",
"0.61716545",
"0.61716545",
"0.61716545",
"0.61716545",
"0.61337364",
"0.6039866",
"0.60315996",
"0.60315996",
"0.60315996",
"0.59485936",
"0.59479296",
"0.5913768",
"0.58829355",
"0.58490336",
"0.58335435",
"0.5826081",
"0.5813683",
"0.5813683",
"0.5813683",
"0.5812709",
"0.5802919",
"0.57837385",
"0.5756064",
"0.5728444",
"0.57261974",
"0.5721684",
"0.5720363",
"0.5712781",
"0.5706513",
"0.5706513",
"0.57024693",
"0.5700057",
"0.5699666",
"0.56787455",
"0.5670302",
"0.566378",
"0.5662028",
"0.5660634",
"0.5657269",
"0.56523913",
"0.56460094",
"0.5626493",
"0.5624874",
"0.5616437",
"0.5616437",
"0.5616437",
"0.5616437",
"0.5616437",
"0.5616437",
"0.5616437",
"0.5613166",
"0.56129926",
"0.56129926",
"0.5579078",
"0.5579078",
"0.55778617",
"0.5570767",
"0.5570684",
"0.55673164",
"0.5557937",
"0.55427295",
"0.5533991",
"0.552471",
"0.5522574",
"0.5500236",
"0.54942894",
"0.5484239",
"0.54781616",
"0.547769",
"0.54763865",
"0.5471469",
"0.5464979",
"0.5455305",
"0.5448475",
"0.54484236",
"0.5439916",
"0.5435576",
"0.5431775",
"0.54175925",
"0.5417474",
"0.54168516",
"0.5415094",
"0.5412725",
"0.54118526",
"0.54118526",
"0.538911",
"0.538911",
"0.538911",
"0.538911",
"0.538911",
"0.538911"
] |
0.5742629
|
32
|
support just UTC or local timezone to avoid DST correct handling issues (as DATE values are converted to TIMESTAMP using current UTC offset)
|
def ocitimestamp_to_time(ary)
year, month, day, hour, minute, sec, fsec, tz_hour, tz_min = ary
if year >= 139
timezone = tz_hour == 0 && tz_min == 0 ? :utc : :local
begin
# Ruby 1.9 Time class's resolution is nanosecond.
# But the last argument type is millisecond.
# 'fsec' is converted to a Float to pass sub-millisecond part.
return ::Time.send(timezone, year, month, day, hour, minute, sec, fsec / 1000.0)
rescue StandardError
end
end
ocitimestamp_to_datetime(ary)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def local_date_time\n # d = [:year, :mon, :day, :hour, :min, :sec].map{|q| @local_date_time.send(q)}\n # d << (utc_offset/24).to_f\n # #puts d\n # DateTime.new(*d) \n tz0 = utc_offset.to_s.split('.')\n tz = (tz0[0][0]=='-' ? '-' : '+')+('00'+tz0[0].to_i.abs.to_s)[-2,2]+':'\n tz += tz0.count>1 ? ('0'+((('.'+tz0[1]).to_f*100).to_i*0.6).to_i.to_s)[-2,2] : '00'\n @local_date_time.to_datetime.change(:offset => tz) ### \"#{utc_offset}:00\")\n end",
"def curr_date_in_timezone\n Time.now.getlocal(address_timezone_offset)\n end",
"def utc() end",
"def convert_datetime_timezone(dt, timezone)\n case timezone\n when :utc, \"utc\"\n dt.new_offset(0)\n when :local, \"local\"\n dt.new_offset(FmRest::V1.local_offset_for_datetime(dt))\n when nil\n dt\n end\n end",
"def supports_timestamp_timezones?\n true\n end",
"def supports_timestamp_timezones?\n true\n end",
"def supports_timestamp_timezones?\n true\n end",
"def before_setup\n @original_time_zone = Time.zone\n super\n end",
"def tz\n ActiveSupport::TimeZone.new timezone\n end",
"def utc_offset() end",
"def to_time\n preserve_timezone ? getlocal(utc_offset) : getlocal\n end",
"def parse_datetime(dt, tz)\n offset = \"+00:00\"\n case tz\n when \"EST\"\n offset = \"−05:00\"\n when \"CST\"\n offset = \"−06:00\"\n when \"MST\"\n offset = \"−07:00\"\n when \"PST\"\n offset = \"−08:00\"\n else\n offset = \"+00:00\"\n end\n\n parsedDate = DateTime.parse(\"#{dt}#{tz}\")\n return parsedDate\nend",
"def utc?() end",
"def time_zone; end",
"def time_zone; end",
"def time_zone; end",
"def time_zone; end",
"def time_zone; end",
"def test_quoted_datetime_local\n with_timezone_config default: :local do\n t = Time.now.change(usec: 0).to_datetime\n assert_equal t.to_fs(:db), @quoter.quoted_date(t)\n end\n end",
"def time_in_zone\n # Time.zone should be UTC\n Time.zone.at((time+utc_offset)/1000)\n end",
"def time_zone=(_arg0); end",
"def time_zone=(_arg0); end",
"def current_timezone_offset\n 0\n end",
"def getutc() end",
"def test_quoted_datetime_local\n with_active_record_default_timezone :local do\n t = DateTime.now\n assert_equal t.to_s(:db), @quoter.quoted_date(t)\n end\n end",
"def created_at\n super.in_time_zone if super\n end",
"def set_timezone\n offset = [Time.now.beginning_of_year.utc_offset, Time.now.beginning_of_year.change(month: 7).utc_offset].min\n offset *= 3600 if offset.abs < 13\n Time.zone = ActiveSupport::TimeZone.all.select { |zone| zone.utc_offset == offset }.first\nend",
"def date_time_et\n DateTime.now.utc.in_time_zone('Eastern Time (US & Canada)')\n end",
"def date_time_et\n DateTime.now.utc.in_time_zone('Eastern Time (US & Canada)')\n end",
"def utc_now()\n tz = TZInfo::Timezone.get('Etc/UTC')\n tz.now.to_datetime\n end",
"def time_zone\n super\n end",
"def set_timezone(timezone); end",
"def set_timezone(timezone); end",
"def set_timezone(timezone); end",
"def set_timezone(timezone); end",
"def set_timezone(timezone); end",
"def PA_to_UTC(t)\n TZ_PA.local_to_utc t\nend",
"def to_datetime\n @to_datetime ||= utc.to_datetime.new_offset(Rational(utc_offset, 86_400))\n end",
"def skip_time_zone_conversion_for_attributes\n []\n end",
"def tz\n time_zone_adjustment.to_r / (24 * 60)\n end",
"def tz\n time_zone_adjustment.to_r / (24 * 60)\n end",
"def tz_timezone ; timezone? ? TZInfo::Timezone.get(@timezone) : nil ; end",
"def to_time\r\n #MES- From activerecord-1.13.2\\lib\\active_record\\connection_adapters\\abstract\\schema_definitions.rb\r\n # Function was called string_to_time\r\n time_array = ParseDate.parsedate(self)[0..5]\r\n # treat 0000-00-00 00:00:00 as nil\r\n #MES- Next line WAS the following, but we don't have access to Base here\r\n #Time.send(Base.default_timezone, *time_array) rescue nil\r\n Time.utc(*time_array) rescue nil\r\n end",
"def set_time_zone\n # Make sure blank is always nil\n self.time_zone = nil if time_zone.blank?\n # If there are coordinates, use them to set the time zone, and reject\n # changes to the time zone if the coordinates have not changed\n if georeferenced?\n if coordinates_changed?\n lat = ( latitude_changed? || private_latitude.blank? ) ? latitude : private_latitude\n lng = ( longitude_changed? || private_longitude.blank? ) ? longitude : private_longitude\n self.time_zone = TimeZoneGeometry.time_zone_from_lat_lng( lat, lng ).try(:name)\n self.zic_time_zone = ActiveSupport::TimeZone::MAPPING[time_zone] unless time_zone.blank?\n elsif time_zone_changed?\n self.time_zone = time_zone_was\n self.zic_time_zone = zic_time_zone_was\n end\n end\n # Try to assign a reasonable default time zone\n if time_zone.blank?\n self.time_zone = nil\n self.time_zone ||= user.time_zone if user && !user.time_zone.blank?\n self.time_zone ||= Time.zone.try(:name) unless time_observed_at.blank?\n self.time_zone ||= 'UTC'\n end\n if !time_zone.blank? && !ActiveSupport::TimeZone::MAPPING[time_zone] && ActiveSupport::TimeZone[time_zone]\n # We've got a zic time zone\n self.zic_time_zone = time_zone\n self.time_zone = if rails_tz = ActiveSupport::TimeZone::MAPPING.invert[time_zone]\n rails_tz\n elsif ActiveSupport::TimeZone::INAT_MAPPING[time_zone]\n # Now we're in trouble, b/c the client specified a valid IANA time\n # zone that TZInfo knows about, but it's one Rails chooses to ignore\n # and doesn't provide any mapping for so... we have to map it\n ActiveSupport::TimeZone::INAT_MAPPING[time_zone]\n elsif time_zone =~ /^Etc\\//\n # If we don't have custom mapping and there's no fancy Rails wrapper\n # and it's one of these weird oceanic Etc zones, use that as the\n # time_zone. Rails can use that to cast times into other zones, even\n # if it doesn't recognize it as its own zone\n time_zone\n else\n ActiveSupport::TimeZone[time_zone].name\n end\n end\n self.time_zone ||= user.time_zone if user && !user.time_zone.blank?\n self.zic_time_zone ||= ActiveSupport::TimeZone::MAPPING[time_zone] unless time_zone.blank?\n if !zic_time_zone.blank? && ActiveSupport::TimeZone::MAPPING[zic_time_zone] && ActiveSupport::TimeZone[zic_time_zone]\n self.zic_time_zone = ActiveSupport::TimeZone::MAPPING[zic_time_zone]\n end\n true\n end",
"def convert(local_time, from_time_zone=nil)\n if from_time_zone\n b = self.class.new(from_time_zone)\n t = b.at(local_time).getutc\n utc(t.year, t.month, t.day, t.hour, t.min, t.sec, t.usec)\n elsif local_time.respond_to?(:getutc)\n t = local_time.getutc\n utc(t.year, t.month, t.day, t.hour, t.min, t.sec, t.usec)\n else\n nil\n end\n end",
"def set_timezone\n tz = current_user ? current_user.time_zone : nil\n Time.zone = tz || ActiveSupport::TimeZone[\"UTC\"]\n end",
"def normalize_date(date)\n if zone = active_workspace_configuration[\"TimeZone\"]\n Time.parse(date).in_time_zone(zone).to_date rescue Date.parse(date)\n else\n Date.parse(date)\n end\n end",
"def date_to_utc(date)\n date.to_datetime.strftime('%Y-%m-%dT%H:%M:%S%z')\n end",
"def convert_with_timezone(direction, datetime = nil)\n if datetime.nil?\n return nil\n end\n\n # Dates have no time information and so timezone conversion\n # doesn't make sense. Just return the date in this case.\n if datetime.instance_of?(Date)\n return datetime\n end\n\n if datetime.instance_of?(String)\n datetime = DateTime.parse(datetime.to_s)\n end\n\n is_datetime = datetime.instance_of?(DateTime)\n\n if direction == :local_to_utc\n if is_datetime\n # DateTime can do UTC conversions reliably, so use that instead of\n # TZInfo\n datetime = datetime.new_offset(0)\n else\n datetime = @tzinfo.local_to_utc(datetime)\n end\n\n if is_datetime\n # Convert to a DateTime with a UTC offset\n datetime = DateTime.parse(\"#{datetime.strftime('%FT%T')}Z\")\n end\n end\n\n if direction == :utc_to_local\n datetime = @tzinfo.utc_to_local(datetime)\n\n if is_datetime\n # Convert to a DateTime with the correct timezone offset\n datetime = DateTime.parse(iso8601_with_offset(datetime))\n end\n end\n\n datetime\n end",
"def timestamp2date(t)\n Time.at(t.to_i).utc\nend",
"def to_time\n if preserve_timezone\n @to_time_with_instance_offset ||= getlocal(utc_offset)\n else\n @to_time_with_system_offset ||= getlocal\n end\n end",
"def observed_utc_offset; end",
"def observed_utc_offset; end",
"def observed_utc_offset; end",
"def observed_utc_offset; end",
"def set_time_zone\n Time.use_zone('Europe/Moscow') { yield }\n end",
"def zoneless\n\t\t(self + self.utc_offset).utc\n\tend",
"def in_time_zone(zone = ::Time.zone)\n if zone\n ::Time.find_zone!(zone).local(year, month, day)\n else\n to_time\n end\n end",
"def set_timezone\n offset = [ Time.now.beginning_of_year.utc_offset, Time.now.beginning_of_year.change(:month => 7).utc_offset ].min\n offset *= 3600 if offset.abs < 13\n Time.zone = ActiveSupport::TimeZone.all.select { |zone| zone.utc_offset == offset }.first\n end",
"def timezone\n @timezone || Sequel.database_timezone\n end",
"def with_floating_timezone\n dup.set_tzid(:floating)\n end",
"def utc\n @utc ||= zone.local_to_utc(@time)\n end",
"def set_timezone\n \tTime.zone = \"Pacific Time (US & Canada)\"\n \tend",
"def with_timezone\n Time.use_zone(current_user_timezone) { yield }\n end",
"def local_to_utc(datetime)\n convert_with_timezone(:local_to_utc, datetime)\n end",
"def in_time_zone(zone = ::Time.zone)\n ActiveSupport::TimeWithZone.new(utc? ? self : getutc, ::Time.send!(:get_zone, zone))\n end",
"def scheduled_for_time_to_utc\n self.scheduled_for = ActiveSupport::TimeZone\n .new(self.user.timezone)\n .local_to_utc(self.scheduled_for)\n end",
"def set_timezone\n loc = Location.find(self.location_id)\n self.time_zone, self.localGMToffset = loc.time_zone, loc.localGMToffset\n end",
"def at_utc(*args)\n extract_and_create_local_time(args, false)\n end",
"def populate_timezones\n if new_record?\n self.created_at_timezone ||= Time.zone.name\n else\n if self.deleted?\n self.deleted_at_timezone ||= Time.zone.name\n end\n end\n end",
"def calculate(timezone); end",
"def in_zone(zone_name, &block)\n\n EtOrbi.class_eval do\n @local_tzone = nil\n @local_tzone_tz = nil\n @local_tzone_loaded_at = nil\n end\n\n prev_tz = ENV['TZ']\n\n if zone_name == :no_env_tz\n ENV.delete('TZ')\n elsif zone_name == nil\n ENV['TZ'] = EtOrbi.os_tz\n else\n zone_name = EtOrbi.to_windows_tz(zone_name) if Gem.win_platform?\n ENV['TZ'] = zone_name\n end\n\n block.call\n\nensure\n\n ENV['TZ'] = prev_tz\nend",
"def has_floating_timezone?\n false\n end",
"def data_timezone(identifier); end",
"def data_timezone(identifier); end",
"def fix_time_zone\n return true if self.time_zone.nil?\n return true if ActiveSupport::TimeZone[self.time_zone]\n try = self.time_zone.gsub('&', '&')\n self.time_zone = try if ActiveSupport::TimeZone[try]\n end",
"def set_time_zone\n old_time_zone = Time.zone\n\n new_time_zone = user_time_zone()\n \n Time.zone = new_time_zone if new_time_zone\n\n yield\n ensure # make sure we restore old time zone\n Time.zone = old_time_zone\n end",
"def with_timezone\n Time.use_zone(current_user.try(:get_time_zone)) { yield }\n end",
"def to_datetime\n ::DateTime.civil(year, month, day, hour, min, sec, Rational(utc_offset, 86400), 0)\n end",
"def convert_happened_at_to_utc\n self[:happened_at] = self.person && self.person.user ? self.person.user.user2utc(self[:happened_at]) : self[:happened_at]\n end",
"def to_local(time_zone = Time.zone.try(:name))\n return if __getobj__.nil? || time_zone.nil?\n converted_timestamp = ActiveSupport::TimeZone.new(time_zone).local_to_utc(__getobj__)\n converted_timestamp.in_time_zone(time_zone) if converted_timestamp.respond_to? :in_time_zone\n end",
"def adjust_timezone(offset)\n if offset\n ActiveSupport::TimeZone[offset]\n adjusted_time = Time.now + offset.seconds\n allow(Time).to receive(:now).and_return(adjusted_time)\n end\nend",
"def start_at\n super.in_time_zone(time_zone) if super && time_zone\n end",
"def to_utc(date)\n date.to_time.utc\n end",
"def set_timezone\n Time.zone = Time.zone_default\n end",
"def my_now\n utc = Time.now.utc\n now = Time.utc(utc.year, utc.month, utc.day, 6 - timezone)\n end",
"def set_time_zone\n Time.use_zone(current_user.time_zone) { yield }\n end",
"def utc?\n zone == \"UTC\" || zone == \"UCT\"\n end",
"def set_zone_from_session\n Time.zone = ActiveSupport::TimeZone[session[:timezone_offset]] if session[:timezone_offset]\n end",
"def create_time_in_utc(datetime, tz = nil)\n create_time_in_tz(datetime, tz).in_time_zone(\"Etc/UTC\") # Return the time in UTC\n end",
"def set_time_in_time_zone\n return true if time_observed_at.blank? || time_zone.blank?\n return true unless time_observed_at_changed? || time_zone_changed?\n \n # Render the time as a string\n time_s = time_observed_at_before_type_cast\n unless time_s.is_a? String\n time_s = time_observed_at_before_type_cast.strftime(\"%Y-%m-%d %H:%M:%S\")\n end\n \n # Get the time zone offset as a string and append it\n offset_s = Time.parse(time_s).in_time_zone(time_zone).formatted_offset(false)\n time_s += \" #{offset_s}\"\n \n self.time_observed_at = Time.parse(time_s)\n true\n end",
"def set_user_time_zone\n if logged_in? && !current_user.time_zone.nil?\n Time.zone = current_user.time_zone\n else\n Time.zone = 'Eastern Time (US & Canada)'\n end\n end",
"def utc?\n zone.name == \"UTC\"\n end",
"def set_user_time_zone\n Time.zone = current_user.time_zone unless current_user.nil?\n end",
"def time_convertion(time, time_zone)\n time.getutc.getlocal(time_zone)\n end",
"def requires_sql_standard_datetimes?\n true\n end",
"def local_to_utc(time, dst = true)\n tzinfo.local_to_utc(time, dst)\n end",
"def set_timezone()\n current_tz = Time.zone\n if logged_in?\n Time.zone = current_user.timezone\n end\n ensure\n Time.zone = current_tz\n end",
"def set_time_zone\n Time.zone = current_user.time_zone\n end",
"def set_user_time_zone\n Time.zone = current_user.time_zone if current_user\n end",
"def set_timezone\n Time.zone = current_user.try(:time_zone) || 'Eastern Time (US & Canada)'\n end"
] |
[
"0.67126626",
"0.64517707",
"0.6406952",
"0.63443404",
"0.6301246",
"0.6301246",
"0.6301246",
"0.6288526",
"0.62506497",
"0.6237231",
"0.6231796",
"0.61841106",
"0.61491674",
"0.6107699",
"0.6107699",
"0.6107699",
"0.6107699",
"0.6107699",
"0.6062283",
"0.60533774",
"0.60505384",
"0.60505384",
"0.6033539",
"0.6029807",
"0.60153353",
"0.6005286",
"0.5999653",
"0.5987306",
"0.5987306",
"0.59862804",
"0.59806186",
"0.5976558",
"0.5976558",
"0.5976558",
"0.5976558",
"0.5976558",
"0.59526527",
"0.59189874",
"0.5913161",
"0.5851008",
"0.5851008",
"0.5810491",
"0.5795205",
"0.57860136",
"0.5743521",
"0.57427514",
"0.57233983",
"0.57141846",
"0.5694367",
"0.5694344",
"0.56936187",
"0.569287",
"0.569287",
"0.569287",
"0.569287",
"0.5688418",
"0.56783444",
"0.5675443",
"0.5670939",
"0.56669116",
"0.5665375",
"0.566087",
"0.5660834",
"0.56450117",
"0.5634134",
"0.5631537",
"0.561619",
"0.56120783",
"0.56057405",
"0.560209",
"0.55804145",
"0.55704933",
"0.5567103",
"0.55604917",
"0.55604917",
"0.5558881",
"0.5556838",
"0.55477893",
"0.55448383",
"0.55413765",
"0.55226564",
"0.55184203",
"0.55091685",
"0.5496598",
"0.54959315",
"0.5488393",
"0.5486606",
"0.54847956",
"0.5472132",
"0.54616684",
"0.5458105",
"0.5456669",
"0.54557604",
"0.54546773",
"0.5452999",
"0.5446331",
"0.5444659",
"0.5427272",
"0.5410255",
"0.5407333",
"0.54057765"
] |
0.0
|
-1
|
The visibility of a post to users user => nil can everyone see this post? user => User can a specific user see this post?
|
def visible?(user=nil)
return true if author == user and not deleted?
return false unless category.allow_viewing? user
return false unless available?
true
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def viewable?(user)\n !deleted && !hidden?\n end",
"def visible?(user=User.current)\n user.allowed_to?(:view_pulls, self.project)\n end",
"def preview_only?(user)\n !listed && !author?(user)\n end",
"def visible?(user=User.current)\n true\n end",
"def viewable?(user=:false)\n (user != :false && is_visible_to_id <= user.user_level.position) || (user == :false && is_visible_to == UserLevel.find_by_name(\"Anonymous\"))\n end",
"def visible(current_user=User.current_user)\n if current_user.is_a?(Admin) || (current_user.is_a?(User) && current_user.is_author_of?(self))\n return self\n elsif current_user == :false || !current_user\n return self unless self.restricted || self.hidden_by_admin\n elsif (!self.hidden_by_admin && !self.posted_works.empty?)\n return self\n end\n end",
"def publishable?(user)\n user.present? && !public?\n end",
"def canManagePost(user)\n\t \t\t\t\n\t \t\t\tif user.nil? \n\t \t\t\t\treturn false\n\t \t\t\tend\n\n\t \t\t\tif user.has_role?(:admin)\n\t \t\t\t\treturn true\n\t \t\t\telse\n\t \t\t\t\treturn false\n\t \t\t\tend\n\t \t\tend",
"def show\n\t\traise CanCan::AccessDenied if !Postulacion.accessible_by(current_ability, :show).include?(@postulacion) \n end",
"def visible?(user=User.current)\n user.allowed_to?(:view_issues, self.project)\n end",
"def can_bill? usr\n !posts.detect { |post| post.can_bill? usr }.nil?\n end",
"def user_can_view?(_check_user)\n true # everyone can view these\n end",
"def view_authorized(current_user)\n return self.goal.public? || self.edit_authorized(current_user)\n end",
"def viewable_by?(user)\n Sugar.public_browsing? || user ? true : false\n end",
"def visible_posts_for(user, args = {})\n search_conditions = {\n where: {\n friends_only: false,\n user_id: self.id\n },\n page: args[:page],\n per_page: 20,\n include: [:user, :attachments, comments: [:attachments]],\n order: {created_at: :desc}\n }\n user = User.find(user) if user.is_a?(String) or user.is_a?(Fixnum)\n if args[:latest_post_id]\n search_conditions[:where].merge!({ record_id: {gt: args[:latest_post_id] }})\n end\n if (user and self.friends_with?(user)) or user == self\n search_conditions[:where].delete(:friends_only)\n end\n Post.search(search_conditions).results\n end",
"def visible_to?(resource)\n if self.visible || self.user_id == resource.id #|| assuming they have an ID\n true\n else\n false\n end\n end",
"def has_post_access(board_id, post_id)\n post = Unsakini::Post.where(id: post_id, board_id: board_id)\n .joins(\"LEFT JOIN #{UserBoard.table_name} ON #{UserBoard.table_name}.board_id = #{Post.table_name}.board_id\")\n .where(\"#{UserBoard.table_name}.user_id = ?\", @user.id)\n .first\n if post.nil?\n return {status: :forbidden}\n else\n return {status: :ok, post: post}\n end\n end",
"def show\n @can_edit = false\n if user_signed_in?\n @my_pre = Preference.find_by user_id: current_user.id\n @my_pro = Profile.find_by user_id: current_user.id\n @similars = find_similar\n\n if current_user.admin?\n @can_edit = true\n elsif current_user.editor? && @post.owner == current_user.id\n @can_edit = true\n end\n end\n end",
"def user_can_see?(user)\n !self.private || self.is_owner?(user)\n end",
"def private_filter\n post = Post.find(params[:id])\n if post.nil?\n flash[:error] = \"Post not found\"\n redirect_to home_url\n end\n\n if !post.has_access(current_user)\n flash[:error] = \"Post is private\"\n redirect_to home_url\n end\n end",
"def user_has_view_permission(img, active_user)\n should_display = true #presume we should show it, until proven otherwise\n \n if (!active_user.nil? && active_user.id == img.user_id)\n return should_display\n end\n \n case img.privacy_level\n when \"anon_public\"\n should_display = true # we should display anon_public if the user uses the direct link to it\n when \"anon_private\"\n should_display = true # we should display anon_private if the user uses the direct link to it\n when \"signed_in_private\"\n if active_user\n # we determine if logged in user has permission to see this pic\n image_poster = User.find(img.user_id)\n should_display = false unless current_user.following? image_poster\n else\n should_display = false # don't let anon users see private pics of signed in users\n end\n when \"signed_in_public\" \n should_display = true # we should display anon_private if the user uses the direct link to it\n else\n # Privacy indeterminable. Just show it.\n end\n \n should_display\n end",
"def get_public_posts(user_id)\n return db.execute(\"SELECT * FROM post WHERE user_id = ? AND public = ?\",user_id, \"on\")\n end",
"def visible?(user=User.current)\n (project.nil? || user.allowed_to?(:view_contacts, project)) && (self.is_public? || self.user_id == user.id)\n end",
"def check_post_owner\n json_response({ error: 'Not authorized' }, :unauthorized) unless @post.user_id == current_user.id\n end",
"def index\n @from_user = User.find(params[:user_id])\n @published = @from_user.discussions.published\n if @user.owns? @from_user\n @unpublished = @from_user.discussions.unpublished\n end\n end",
"def authorized_to_edit?(post)\n post.user == current_user\n end",
"def authorized_to_edit?(post)\n post.user == current_user\n end",
"def show\n if Post.shared_post_exist?(@resource.url)\n @shared_users = Post.shared_post_users(@resource.url, current_user.id)\n end\n end",
"def show\n posts = policy_scope(@user.posts)\n postables = posts.map(&:postable).uniq\n\n @postables = postables.map do |p|\n [p, p.posts.where(user: @user).last, p.posts.where(user: @user).count]\n end\n @postables.sort! do |a, b|\n b[1].created_at <=> a[1].created_at\n end\n\n @postables = Kaminari.paginate_array(@postables)\n .page(params[:page])\n .per(15)\n end",
"def can_view?(user)\n user.nil? ? false : (self.can_edit?(user) || self.user_annotation_shares.can_view.include?(user.email))\n end",
"def is_view_permitted?(given_user = nil)\r\n return false unless self.active?\r\n \r\n given_user ||= self.current_user\r\n \r\n # If item is public, no need for further permission checks\r\n return true if self.public? && self.user && self.user.public? \r\n \r\n # Base case of identity, no need to check relationships\r\n return true if given_user && ((given_user.id == self.author_id) || (given_user.id == self.foruser_id) || given_user.is_self_or_owner?(self.user))\r\n\r\n # Special case -- allow recipient and owners to see private messages\r\n if self.is_a?(Pvtmessage)\r\n return true if given_user.is_self_or_owner?(self.foruser) || given_user.is_self_or_owner?(self.user)\r\n return false\r\n end\r\n\r\n return true if given_user.admin?\r\n \r\n # Otherwise no can do if only my owner can see it (if you got to here, you aren't my owner)\r\n return false if self.restriction_level == Relationshiptype.nobody\r\n\r\n # Content of private or blocked projects cannot be seen\r\n return false if self.user && !self.user.is_view_permitted?\r\n\r\n # Fine, we'll actually run some DB queries...\r\n return Relationship.has_follower?(self.user, given_user, self.levels_can_see)\r\n end",
"def moderation_state_visible_to_user?(user)\n moderation_state_visible_to_all? || (!user.thredded_anonymous? && user_id == user.id)\n end",
"def visible_to?(user)\n return self.user==user || !self.visible_to || self.visible_to.include?(user._id)\n end",
"def view_authorized(current_user)\n return self.public? || self.edit_authorized(current_user)\n end",
"def mayView? ( other_user )\n if ( (not other_user.valid?) or ( other_user.is_a?(User) == false ) )\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"basic check failed\"\n # d other_user.type\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n return false\n end\n user = getUser()\n if ( other_user == user )\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"same user as owner\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n return true\n end\n if ( ( self.public_policy == Dfile::PP_MAYVIEW ) or ( self.public_policy == Dfile::PP_MAYEDIT ) )\n return true\n end\n if self.special_users\n special = self.special_users[other_user.id.to_s]\n if special\n if ( ( special == Dfile::PP_MAYVIEW ) or ( special == Dfile::PP_MAYEDIT ) )\n return true\n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"User has special permission but not right one\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"User has no special permission\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n \n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"no special permissions\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n return false\n end",
"def check_visibility\n raise Helpedia::ItemNotVisible unless @user.visible_for?(current_user)\n end",
"def verify_post_access(cat)\n post_id = params[:id]\n\n if article_for_member_only?(cat)\n\n return user_signed_in?\n else\n # the article is not for member only, so let them see it\n return true\n end\n end",
"def accessible_for?(user)\n user_id == user.id && !user.anonimous?\n end",
"def viewable?\n published? || created? || editing?\n end",
"def permitted_to_read?(user)\n user.is_admin? || (has_groupblog_permission?(user) || self.user == user || self.group.moderator == user || (self.group.can_user_see_eachother && group.participants.include?(user)))\n end",
"def show\n @post = Post.find(params[:id])\n unless @post.user.id == current_user.id\n ahoy.track \"Read Post\", post_id: @post.id\n end\n end",
"def privacy_check(user_check)\n can_view = nil\n\n if self.public == false\n user = User.find_by_id(self.user_id)\n if user.company_id != user_check.company_id\n can_view = false\n else\n can_view = true\n end\n else\n can_view = true\n end\n\n return can_view\n\n end",
"def show\n @my_posts = @good.good_posts.select{|p| p.user == current_user }\n end",
"def show?\n @current_user.permission('Bid', :guest)\n end",
"def get_posts_for_user\n @posts = policy_scope(Post)\n end",
"def is_my_post?(userid)\n #if someone is logged in\n if @current_user\n #if the user id of the post is the user id of the person logged in => it is my post\n if @current_user.id == userid\n return true\n # it isn't my post\n else\n return false\n end\n #It isn't my post because I'm not logged in\n else\n return false\n end\n end",
"def visible_to?(identity)\n return true if !restricted && !deleted && published\n return false if nobody?(identity)\n return true if identity.god and identity.realm == self.realm\n identity.id == created_by\n end",
"def show\n @eg_post = EgPost.find(params[:id])\n authorize @eg_post\n end",
"def show\n enforce_view_permission(@user)\n \n end",
"def check_post_user\n # Fetch post by id\n @post = Post.find(params[:id])\n\n # Redirect to home page if wrong user or not admin\n unless @post.blog.user == logged_in_user || logged_in_user.admin?\n redirect_to root_url\n end\n end",
"def points_granted\n self.user ? POINTS_FOR_POSTING : 0\n end",
"def show\n\t\traise CanCan::AccessDenied if !Presupuesto.accessible_by(current_ability, :show).include?(@presupuesto) \n end",
"def is_view_permitted?(given_user = nil)\n given_user ||= self.current_actor\n\n # Guests can't see circles unless they log in\n return false if given_user.guest?\n \n # Oh look, it's me\n return true if given_user.is_self_or_owner?(self.user)\n \n # Fine, let's check the db\n return Relationship.has_follower?(self.user, given_user, self.levels_can_see)\n end",
"def show\n @user = User.where(id: @post.user_id)[0]\n @likes = UserLike.where(post_id: @post.id)\n end",
"def can_manage_post\n raise ActionController::RoutingError 'Forbidden' if current_user.nil? || cannot?(:manage, @post)\n true\n end",
"def show\n if (!@isLogin || !@isValidUser)\n return\n end\n @posts = @user.posts\n end",
"def show\n \tif(logged_in)\n \t\t@posts = User.find(@user.id).posts\n \telse\n \t\treturn\n \tend\n end",
"def view(user, friend)\n\t\tpost = UserPost.where(user1_id: user, user2_id: friend)\n\tend",
"def show\n @post = Post.find(params[:id])\n @topic = Topic.find(params[:topic_id])\n @comment = Comment.new\n @comments = @post.comments\n authorize @post\n end",
"def visible?(user=User.current)\n (project.nil? || user.allowed_to?(:view_invoices, project))\n end",
"def show\n @eg_post = EgPost.find(params[:id])\n authorize @eg_post\n end",
"def authorized_user? comment\n comment.user_id == current_user.id || comment.post.user_id == current_user.id\n end",
"def check_visibility\n set_problem\n viewable = begin\n unless @problem.hide\n true\n else\n if logged_in? && current_user.is_admin?\n true\n else\n false\n end\n end\n end\n\n unless viewable\n render status: :forbidden, nothing: true\n return\n end\n end",
"def show\n @posts = Post.where(hidden: false).where(:user_id => @profile.user.id).order('created_at DESC').page params[:page]\n \n end",
"def is_groupblog?\n !self.user_id\n end",
"def show\n @user = User.find(@post.user_id)\n end",
"def may_view_user?(user=nil)\n#\t\t\tself.is_user?(user) || self.may_administrate?\n\t\t\tself.is_user?(user) || self.may_administrate?\n\t\tend",
"def get_read_access( u)\n \n return (u == self.user) || (self.public)\n \n \n end",
"def show\n @post = Post.find(params[:id])\n @user = @post.blog.user\n end",
"def visible?(user)\n\n return true if self.for_all?\n\n return false if user.nil?\n\n return true if (user.admin?(User::AUTH_ADDRESSBOOK) or self.owner_id == user.id)\n\n groups = self.get_groups_a\n teams = self.get_teams_a\n\n user.get_groups_a(true).each do |group_id|\n return true if groups.include?(group_id)\n end\n\n user.get_teams_a.each do |team_id|\n return true if teams.include?(team_id)\n end\n\n return false\n end",
"def can_be_accessed_by?(user)\n if visibility == 'public'\n return true\n elsif visibility == 'buddies' && organization.battle_buddy_list.include?(user.organization_id)\n return true\n elsif visibility == 'shared' && buddy_list.split(',').include?(user.organization_id.to_s)\n return true\n elsif visibility == 'executive' && user.is_executive? && organization.users.include?(user)\n return true\n elsif ['private','buddies','shared'].include?(visibility) && organization.users.include?(user)\n return true\n else\n return false\n end\n end",
"def show?\n user.admin? || user.po? || record.user == user\n end",
"def show\n @post = current_user.posts.build\n @user = User.find(params[:id])\n if current_user == @user\n @posts = current_user.feed.paginate(page: params[:page]) \n else\n @posts = @user.posts.paginate(page: params[:page])\n end\n end",
"def sender_can_bill?\n !posts.detect { |post| post.can_bill? user }.nil?\n end",
"def can_be_viewed_by?(user)\n # you can always view your own tlog\n return true if user && user.id == self.id\n\n # skip if current user is blacklisted\n return false if user && self.is_blacklisted_for?(user)\n\n case self.tlog_settings.privacy\n when 'open'\n true\n\n # registration required\n when 'rr'\n user ? true : false\n\n # friend-mode\n when 'fr'\n user && self.all_friend_ids.include?(user.id)\n\n # only me\n when 'me'\n user && user.id == self.id\n end\n end",
"def permitted_to_publish?\n @pcp_subject.user_is_owner_or_deputy?( current_user, @pcp_subject.current_step.acting_group_index )\n end",
"def owner\n if @post.author_id == @current_user.id && @current_user.baned == false\n else\n respond_to do |format|\n format.html { redirect_to posts_url, alert: 'У вас нет прав, зарегестрируйтесь.' }\n end\n end\n end",
"def show\n authorize @user # Can only see your own profile\n end",
"def show?\n @current_user.permission('Fdp', :guest)\n end",
"def mark_all_posts usr\n return false if usr.blank?\n @conv.posts.each do |post|\n post.mark_as_read! for: usr if post\n end\n end",
"def authorize_show\n user = requested_user(:user_id)\n if request.format.ics?\n unauthorized(\"Invalid privacy token.\") unless params[:pt] == user.privacy_token\n else\n unauthorized unless user == current_user\n end\n true\n end",
"def can_access?(user)\n user == self.user\n end",
"def can_publish?\n !user.discourse_username.empty?\n end",
"def authorize_user\n post = Post.find(params[:id])\n\n unless current_user == post.user || current_user.admin?\n flash[:alert] = \"You must be an admin to do that.\"\n redirect_to [post.topic, post]\n end\n end",
"def show\n require \"digest\"\n @post = Post.find(params[:id])\n if(@post.visible != true && (!session[:author] || session[:author].id != @post.author_id))\n flash[:error] = \"El post solicitado es invisible\"\n redirect_to \"/posts\"\n end\n @comments = @post.comments.paginate(:page => params[:page])\n @comment = Comment.new\n end",
"def user_has_content(user)\n return (user.posts.count > 0 || user.comments.count > 0)\nend",
"def visible_plans(viewing_user_id)\r\n #MES- If the viewing user is the owner of this planner, then\r\n # they can see all the plans\r\n return plans if !viewing_user_id.nil? && viewing_user_id == self.user_id\r\n\r\n #MES- Other users can see all plans that are public\r\n return plans.find_all { |pln| pln.security_level == Plan::SECURITY_LEVEL_PUBLIC }\r\n end",
"def claim_public?\n @current_user.nil?\n end",
"def show\n authorize! :read_drafts, @post unless @post.published\n if can? :read, Comment, @post\n @commentable = @post\n @comments = @commentable.comments.recent.page(params[:page]).per(15)\n @comment = Comment.new\n end\n end",
"def show\n in_dumpster = Dumpster.where(post_id:@post.id).where(exit_date: nil).length>0\n if in_dumpster\n if not (user_signed_in? && (not current_user.admin.nil?))\n redirect_to root_path, alert: \"You don't have the privilages to see this post\"\n end\n end\n end",
"def show\n restrict('allow only admins and store users') or begin\n @post = Post.find_by_id(params[:id])\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @post.to_xml }\n end\n end\n end",
"def show\n @post = Post.new\n @posts = @event.posts\n @is_member = @event.try(:members).exists?(:user_id => current_user.id)\n end",
"def display_resource(user)\n user.restricted? ? 'Hidden' : user.name\n end",
"def is_view_permitted?(user_or_project = nil)\n return false\n end",
"def can_view?(u)\n\t\tu and (u.admin? or u.staff? or (u == self.user))\n\t\t# TODO: support users having explicit permission to view a document\n\t\t# TODO: support users belonging to group that has permission to view a document\n\tend",
"def visible_to?(user)\n if method = Garage.configuration.docs.docs_authorization_method\n method.call(document: self, user: user)\n else\n true\n end\n end",
"def discussions?\n !!user && user.admin?\n end",
"def show?\n @current_user.permission('Department', :guest)\n end",
"def show?\n user.try(:admin?) || record.has_member?(user) \n end",
"def show\n\n unless @post.listeners.blank?\n @posts = @post.listeners.first.favourites.where(:hidden => false).where.not(id: @post.id).page params[:page]\n end\n\n \n end"
] |
[
"0.7126053",
"0.69971746",
"0.69805413",
"0.693687",
"0.68877417",
"0.68426013",
"0.6834691",
"0.6696283",
"0.6695636",
"0.66778594",
"0.6672065",
"0.6569134",
"0.6543863",
"0.653839",
"0.65341496",
"0.65249795",
"0.65151787",
"0.64947087",
"0.6493367",
"0.6474173",
"0.6469228",
"0.64678794",
"0.6460031",
"0.64537084",
"0.64391494",
"0.6435162",
"0.6435162",
"0.64279467",
"0.6427648",
"0.6410804",
"0.6403156",
"0.6393249",
"0.6390848",
"0.6375609",
"0.637055",
"0.63618094",
"0.6361119",
"0.6350767",
"0.63393366",
"0.63392246",
"0.633484",
"0.63053775",
"0.6297139",
"0.62779856",
"0.627619",
"0.6245346",
"0.62450594",
"0.6243409",
"0.6243107",
"0.6240593",
"0.6239233",
"0.6227021",
"0.62269884",
"0.6213456",
"0.6207185",
"0.62049586",
"0.620434",
"0.6190519",
"0.6190477",
"0.6189288",
"0.6188831",
"0.6183435",
"0.6180862",
"0.6171753",
"0.61712855",
"0.61685216",
"0.61520916",
"0.6145559",
"0.61403936",
"0.61402553",
"0.61346585",
"0.61191326",
"0.6115272",
"0.61149174",
"0.61111575",
"0.61065114",
"0.6106003",
"0.6105794",
"0.6102785",
"0.6097527",
"0.6092007",
"0.60891646",
"0.60721755",
"0.6068078",
"0.6067998",
"0.60643494",
"0.6044822",
"0.6041149",
"0.60380965",
"0.6032344",
"0.60286695",
"0.602853",
"0.6024011",
"0.6015645",
"0.60142237",
"0.60106933",
"0.6003053",
"0.60020006",
"0.6001521",
"0.59971964"
] |
0.71227986
|
1
|
Is the post still available (not deleted)
|
def available?
return false if deleted?
return false if karma < app_settings(:post_karma_barrier)
true
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def can_request?(post)\n post[:post_id] != posts\n end",
"def posted?\n post.present?\n end",
"def check_for_posts\n if self.posts.any?\n errors[:base] << \"cannot delete Topic tag when posts are using it!\"\n return false\n else\n return true\n end\n end",
"def ready_to_post?\n self.state == 'ready_to_post'\n end",
"def unpublished?\n self.status == \"Unpublished\"\n end",
"def unpublished?\n (status == UNPUBLISHED)\n end",
"def unpublished?\n (status == UNPUBLISHED)\n end",
"def unpublished?\n (status == UNPUBLISHED)\n end",
"def unpublished?\n (status == UNPUBLISHED)\n end",
"def unpublished?\n (status == UNPUBLISHED)\n end",
"def post?\n false\n end",
"def available?\n new_record? || (submissions.none? && !grant.published?)\n end",
"def publishable?\n self.status == STATUS_PENDING\n end",
"def available?\n published? && published_at <= Time.current\n end",
"def check_if_post_was_deleted\n unless resource.present?\n flash[:notice] = t(:'posts.post_deleted')\n redirect_to [current_account, current_organization, current_organization.company_blog, :posts]\n end\n end",
"def modifiable?\n !(self.complete? || self.ready_to_post?)\n end",
"def can_publish?\n !published_at\n end",
"def sender_can_bill?\n !posts.detect { |post| post.can_bill? user }.nil?\n end",
"def is_a_post?\n self.object_type == :post\n end",
"def published?\n !(data.key?(\"published\") && data[\"published\"] == false)\n end",
"def published?\n !(data.key?(\"published\") && data[\"published\"] == false)\n end",
"def is_published? obj\n if obj.respond_to?(\"resource_state\") && obj.respond_to?(\"resource_published?\")\n obj.resource_published?\n else\n # if the object does not contain resource_state, we will assume that it is a published un-queued object\n true \n end\n end",
"def postponed?\n @postponed\n end",
"def isAnnouncementPost\r\n\t\t\t\t\treturn @isAnnouncementPost\r\n\t\t\t\tend",
"def published?\n if self.status == \"live\"\n true\n else\n false\n end\n end",
"def unpublishable?\n [ UP_TO_DATE, OUT_OF_DATE ].include? flickr_status\n end",
"def published?\n self.published\n end",
"def newly_published?\n !!@newly_published\n end",
"def pending_repost?\n self.review_status_id == ReviewStatus.find(:first,\n :conditions => \"name='Pending Repost'\").id\n end",
"def can_bill? usr\n !posts.detect { |post| post.can_bill? usr }.nil?\n end",
"def draft?\n data[\"draft\"] ||= relative_path.index(collection.relative_directory).nil? &&\n collection.label == \"posts\"\n end",
"def draft?\n return !self.published && Template.published(self.family_id).length > 0\n end",
"def prevent_posting?\n prevent_posting_until? && prevent_posting_until > Time.current\n end",
"def is_post_already_posted item\n\n\tpost= Posted.where(:link => item[\"link\"] ).first\n\t\t if !post.nil? \n\t\t return false \n\t\t else \n\n\t\t return true\n\n\t\t end \nend",
"def deletable?\n is_regular_page?\n end",
"def draft?\n !draft.nil? && !draft.published?\n end",
"def is_post_exist?\n @post = current_user.posts.where(:id => params[:id]).first\n unless @post.present?\n redirect_to user_posts_path, notice: 'You dont have access to requested post'\n end\n end",
"def published?\n published.eql?(true)\n end",
"def is_removed?\n self.has_current_status_of?(ArticleSubmission::ADMIN_REMOVED) || self.has_current_status_of?(ArticleSubmission::REMOVED)\n end",
"def check_active\n if (!@post.active? || @post.expired)\n render :inactive\n end\n end",
"def is_pending?\n (self.pending_feeds.count > 0)\n end",
"def published?\n [:public, :private].include?(self.status)\n end",
"def published?\n (status == PUBLISHED)\n end",
"def published?\n (status == PUBLISHED)\n end",
"def published?\n (status == PUBLISHED)\n end",
"def published?\n (status == PUBLISHED)\n end",
"def published?\n (status == PUBLISHED)\n end",
"def can_manage_post\n raise ActionController::RoutingError 'Forbidden' if current_user.nil? || cannot?(:manage, @post)\n true\n end",
"def deletable?\n persisted? && reserved?\n end",
"def revokable?\n\t\tstatus == \"pending\" && created_at >= Donation.revoke_time.ago\n\tend",
"def is_published?\n status === 'published'\n end",
"def live?\n !draft?\n end",
"def recipient_can_bill?\n !posts.detect { |post| post.can_bill? recipient }.nil?\n end",
"def is_published?\n\t !self.is_discontinued? && (Time.now >= Time.parse(self.date_available.to_s))\n\tend",
"def following?(post)\n posts.include?(post)\n end",
"def pending_deletable?\n !pending_delete_prohibited?\n end",
"def published?\n is_public && pcp_step.released?\n end",
"def published?\n !published_at.nil?\n end",
"def publish?\n false\n end",
"def isStickyPost\r\n\t\t\t\t\treturn @isStickyPost\r\n\t\t\t\tend",
"def valid_post?\n @post.blog == @blog\n end",
"def published?\n !self.versions.published.last.nil?\n end",
"def user_may_view_item?\n @pcp_item.pcp_step.released? || @pcp_item.pcp_step.in_commenting_group?\n end",
"def deleted?\n @deleted == true\n end",
"def deleted?\n author == '[deleted]' and body == '[deleted]'\n end",
"def deleted?\n author == '[deleted]' and body == '[deleted]'\n end",
"def deleted?\n deleted == true\n end",
"def deleted?\n deleted == true\n end",
"def published?\n if self.publish_at < Time.now.utc\n true\n else\n false\n end\n end",
"def published?\n status == Status[:published]\n end",
"def is_banned?\n self.publishing_state == PublishingState::BANNED\n end",
"def check_post_owner\n json_response({ error: 'Not authorized' }, :unauthorized) unless @post.user_id == current_user.id\n end",
"def is_published?\n self.publishing_state == PublishingState::PUBLISHED\n end",
"def unpublishable?\n return false if is_a?(StaticPage) || is_a?(SubtleSystemNode)\n return false if is_a?(Meditation) && self_realization?\n\n true\n end",
"def can_publish?\n\t\ttrue\n\tend",
"def deleted?\n !!deleted\n end",
"def has_post_access(board_id, post_id)\n post = Unsakini::Post.where(id: post_id, board_id: board_id)\n .joins(\"LEFT JOIN #{UserBoard.table_name} ON #{UserBoard.table_name}.board_id = #{Post.table_name}.board_id\")\n .where(\"#{UserBoard.table_name}.user_id = ?\", @user.id)\n .first\n if post.nil?\n return {status: :forbidden}\n else\n return {status: :ok, post: post}\n end\n end",
"def released?\n released == true\n end",
"def visible?\n !(self.created? || self.suspended? || self.deleted?)\n end",
"def visible?\n !(self.created? || self.suspended? || self.deleted?)\n end",
"def visible?\n !(self.created? || self.suspended? || self.deleted?)\n end",
"def finishable?\n self.status == STATUS_PUBLISHED\n end",
"def is_published?\n return false if self.published_on.nil?\n return true if self.published_on <= Time.now.beginning_of_day\n return false\n end",
"def seller_post? listing, user, ptype\n !user.is_support? && ptype.blank? && listing.new_record?\n end",
"def deleted?\n false\n end",
"def can_edit?\n !published_at\n end",
"def trackable?\n published?\n end",
"def is_post?\n is_entry? && params[:_entry_type_] == 'post'\n end",
"def upvoted?(post)\n voted_up_on? post\n end",
"def for_post?\n self.checkin_id.blank?\n end",
"def can_publish?\n !user.discourse_username.empty?\n end",
"def published?\n published_at && published_at == edited_at\n end",
"def published?\n published_at && published_at == edited_at\n end",
"def verify_unpublished_access\n unless resource.published || (!resource.published && logged_in? && current_user.send(pluralized_name).exists?(resource.id))\n render json: ErrorSerializer.serialize(resource_name => \"is invalid\"), status: 422 and return false\n end\n true\n end",
"def pending?\n self.subscription == :pending\n end",
"def publishable?\n [ UNPUBLISHED, OUT_OF_DATE ].include? flickr_status\n end",
"def soft_deleted?\n mark_as_deleted\n end",
"def deleted?\n end",
"def deleted?\n end",
"def released?\n released\n end"
] |
[
"0.74019",
"0.7044312",
"0.70027137",
"0.69858414",
"0.6934177",
"0.6896584",
"0.6896584",
"0.6896584",
"0.6896584",
"0.6896584",
"0.6884174",
"0.68457264",
"0.6787995",
"0.67482674",
"0.67015463",
"0.6692337",
"0.6681942",
"0.668012",
"0.6644733",
"0.66373414",
"0.66373414",
"0.66083324",
"0.66012037",
"0.6595502",
"0.6570692",
"0.65498406",
"0.65287626",
"0.65226936",
"0.650463",
"0.6495138",
"0.649267",
"0.64854616",
"0.64810836",
"0.6478729",
"0.64630985",
"0.64565927",
"0.64485615",
"0.64484346",
"0.64343935",
"0.64235646",
"0.6404236",
"0.6399995",
"0.63897735",
"0.63897735",
"0.63897735",
"0.63897735",
"0.63897735",
"0.63817835",
"0.6372266",
"0.6371481",
"0.6366947",
"0.63625383",
"0.63558084",
"0.63495076",
"0.6347893",
"0.6335109",
"0.6333608",
"0.6317028",
"0.62909395",
"0.62856555",
"0.6282286",
"0.6277869",
"0.6271896",
"0.6270259",
"0.6267449",
"0.6267449",
"0.6265865",
"0.6265865",
"0.62653846",
"0.6264731",
"0.62548864",
"0.6249306",
"0.6247912",
"0.62478447",
"0.6230121",
"0.6220429",
"0.6210511",
"0.620416",
"0.620155",
"0.620155",
"0.620155",
"0.6197287",
"0.61939055",
"0.61930054",
"0.6178486",
"0.6177373",
"0.61718214",
"0.61711574",
"0.616971",
"0.61687654",
"0.61621064",
"0.61523694",
"0.61523694",
"0.61517674",
"0.6150413",
"0.6149779",
"0.6147561",
"0.61452687",
"0.61452687",
"0.61414784"
] |
0.62506413
|
71
|
if this is a video and playable?
|
def playable?
video_source
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def video?\n self.type == \"Video\"\n end",
"def video?\n self.type == \"Assetabler::Video\"\n end",
"def has_video?\n false\n end",
"def video?\n !!( content_type =~ Transit.config.video_regexp )\n end",
"def video?\n !!video_stream\n end",
"def is_video_type?\n file_content_type =~ %r(video)\n end",
"def video?\n attributes['_type'].split('::').last == 'Video'\n end",
"def video?\n self.sti_type == VIDEO_TYPE\n end",
"def is_video_type?\n background_media.content_type =~ %r(video)\n end",
"def video?\n codec_type == 'video'\n end",
"def web_video?\n %w(mp4 ogg webm).each do |sub_type|\n return true if Rack::Mime.match?(mime_type, \"video/#{sub_type}\")\n end\n\n false\n end",
"def is_video_type?\n photo_content_type =~ %r(video)\n end",
"def video?\n if mime_type == 'application/mxf'\n ffprobe.codec_type.any? {|type| type == 'video'}\n else\n super\n end\n end",
"def video?\n @streams.any? { |stream| stream.is_a? VideoStream }\n end",
"def playable?\n false\n end",
"def video\n first_stream_of :video\n end",
"def contains_video?\n result = false\n sample_attachments.map{|sa| result = true if sa.is_video?}\n result\n end",
"def video_link\n if video_type? && !body.nil?\n vimeo_video(body) || youtube_video(body)\n end\n end",
"def video?(file)\n ext = File.extname(file)\n ext = ext[1, ext.length] if ext\n return ext == \"avi\" || ext == \"mpg\" || ext == 'mkv' || ext == 'rm' || ext == 'mp4'\nend",
"def check_live(video)\n return true if video.live == \"1\"\nend",
"def decide_interested_video_type\n \n end",
"def valid_videos\n self.videos.select{ |video|\n video.exist? && video.embed? && video.auto_play?\n }\n end",
"def is_video_file?(file)\n regex = /(.mkv|.mp4|.avi)$/i\n file.match?(regex)\n end",
"def movie?\n content_type == \"Movie\"\n end",
"def video\n @streams.select { |stream| stream.is_a? VideoStream }\n end",
"def embed_video\r\n\tvid_host = self.video_url.sub(/^https?\\:\\/\\//, '').sub(/^www./,'').split('/')[0]\r\n\tif vid_host == 'youtube.com' or vid_host == 'youtu.be'\r\n\t\tyoutube_embed(self.video_url)\r\n\telsif vid_host == 'player.vimeo.com' or vid_host == 'vimeo.com'\r\n\t\tvimeo_embed(self.video_url)\r\n\tend\r\n end",
"def valid?\n VideoUrl.valid?(self.url)\n end",
"def has_video?(locale=I18n.locale.to_sym)\n !featured_video(locale).nil?\n end",
"def post_must_contain_video\n if self.type != \"video\" || self.link.blank?\n self.errors.add(:link, 'must contain a video')\n end\n end",
"def exists?( video_content )\n\t\traise NotImplementedError.new\n\tend",
"def allow_streaming_of?(media_object_id)\n allow_streaming? && active? && self.media_object_id == media_object_id\n end",
"def has_flash?\n not web_video.nil?\n end",
"def can_be_repackaged_as_mp4?\n # If there's an mp4 track, assume this can be rewrapped as an mp4\n !!(find_id_of_track_type('V_MPEG4/ISO/AVC') && find_id_of_track_type('A_AAC'))\n end",
"def in_play?\n started? || in_progress?\n end",
"def video?\n marc_leader_06_match = record.leader.byteslice(6) == 'g'\n marc_008_33_match = record.fields('008').find do |field|\n %w[f m v].include?(field.value.byteslice(33))\n end\n\n marc_006_match = record.fields('006').find do |field|\n field.value.byteslice(0) == 'g' &&\n %w[f m v].include?(field.value.byteslice(16))\n end\n\n video_007_types = %w[m v]\n marc_007_match = record.fields('007').find do |field|\n video_007_types.include?(field.value.byteslice(0))\n end\n\n return true if (marc_leader_06_match && marc_008_33_match) ||\n marc_006_match || marc_007_match\n end",
"def detect_source(in_link) #returns true for vimeo, false for youtube\n if in_link.include? \"vimeo\"\n return true\n else\n return false\n end\n end",
"def media_resource?\n true\n end",
"def video_watched?(user, video)\n @watched_video = WatchedVideo.where(user_id: user.id, video_id: video.id).first\n if @watched_video && @watched_video.watched == true\n true\n else\n false\n end\n end",
"def video_stream\n @video_stream ||= streams.find do |stream|\n stream.codec_context.codec_type == :VIDEO\n end\n end",
"def has_videos?\n videos[:list][I18n.locale.to_sym].length > 0 || videos[:mpg][I18n.locale.to_sym].length > 0\n end",
"def show\n def video_exists?(url)\n url = URI.parse(url)\n url.is_a?(URI::HTTP) && !url.host.nil?\n rescue URI::InvalidURIError\n false\n end\n\n @video = Video.find(params[:id])\n\n if video_exists?(@video[:video_url])\n @video_exists = true\n @youtube_id = @video[:video_url].split('=')[1]\n end\n\n @links = [{:name => \"Home\", :path => root_path}, {:name => \"Back to Videos\", :path => videos_path}]\n end",
"def video_game?\n raw_title =~ /\\(VG\\)/\n end",
"def has_advanced_video?\n patron?(tier: 1, before: STRIPE_MIGRATION_DATE) || patron?(tier: 4) || subscriptions.tier1.active.any? || admin? || self.class.stay_insideathon?\n end",
"def episode?\n content_type == \"Episode\"\n end",
"def playing?\n self.play_start != nil\n end",
"def audio?\n if mime_type == 'application/mxf'\n !ffprobe.codec_type.any? {|type| type == 'video'}\n else\n super\n end\n end",
"def is_flv?\n if filename != nil\n filename.ends_with?('.flv')\n else\n false\n end\nend",
"def length?\n video_length > 10.0\n end",
"def queued_video?(video)\n queue_items.map(&:video).include?(video)\n end",
"def is_playable?\n is_playable = false\n x = 0\n while ((x < self.width) && (!is_playable))\n is_playable = (@assignment[x][0] == nil);\n x += 1\n end\n is_playable\n end",
"def videos_test\n end",
"def grab_url_embeddable(url)\n video_info = get_video_info(url)\n video_params = extract_video_parameters(video_info)\n\n unless video_params[:embeddable]\n Youtube.notify(\"VIDEO IS NOT EMBEDDABLE\")\n return false\n end\n\n urls_formats = extract_urls_formats(video_info)\n selected_format = choose_format(urls_formats)\n title = video_params[:title]\n file_name = PluginBase.make_filename_safe(title) + \".\" + VIDEO_FORMATS[selected_format][:extension]\n\n {:url => urls_formats[selected_format], :name => file_name}\n end",
"def video_kind\n @ole.VideoKind\n end",
"def preview_type\n return \"video\" if %w(mp4 m4v mov flv avi asf).include?(format)\n return \"audio\" if !format.blank?\n return nil\n end",
"def splash_displayed?\n displayed? SPLASH_VIDEO\n end",
"def detect_host\n if self.link =~ /(youtube)/\n \"<iframe width='560' height='315' src='https://www.youtube.com/embed/#{youtube_code}' frameborder='0' allow='accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>\"\n else\n \"<iframe src='https://player.vimeo.com/video/#{vimeo_code}?color=ffffff' width='640' height='360' frameborder='0' allow='autoplay; fullscreen' allowfullscreen></iframe>\"\n end\n end",
"def exists?( video_content )\n\t\tftp_open do |ftp|\n\t\t\treturn self.class.ftp_file_exists?( ftp, file_hash_and_extension_to_array( video_content.file_hash, video_content.file_extension ).join('/') )\n\t\tend\n\tend",
"def load_youtube\n Video\n YouTube\n end",
"def load_youtube\n Video\n YouTube\n end",
"def can_view?(movie)\n end",
"def parse_video\n # standard\n unless /\\A\\s*(?<width>\\d+)x(?<height>\\d+)\\s+(?<url>.+)\\z/ =~ content\n env.warn 'can not parse \\video content, should be \"#{WIDTH}x#{HEIGHT} #{URL}\"'\n return\n end\n\n case url\n when /youtu\\.?be/\n # NOTE merging them into one regexp fails (because longest match?)\n unless id = url[/(?<=watch\\?v=)\\w+/] || url[/(?<=embed\\/)\\w+/] || url[/(?<=youtu\\.be\\/)\\w+/]\n env.warn 'can not parse youtube id'\n return\n end\n %Q|<iframe width=\"#{width}\" height=\"#{height}\" src=\"https://www.youtube-nocookie.com/embed/#{id}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>|\n when /vimeo/\n unless id = url[/(?<=vimeo\\.com\\/)\\w+/]\n env.warn 'can not parse vimeo id, should use link like this \"http://vimeo.com/#{DIGITS}\"'\n return\n end\n %Q|<iframe width=\"#{width}\" height=\"#{height}\" src=\"https://player.vimeo.com/video/#{id}\" frameborder=\"0\" allowFullScreen></iframe>|\n when /sm/\n unless id = url[/\\bsm\\d+/]\n env.warn 'can not find \"sm#{DIGITS}\" from link'\n return\n end\n %Q|<script src=\"https://ext.nicovideo.jp/thumb_watch/#{id}?w=#{width}&h=#{height}\"></script>\"|\n else\n env.warn 'failed to parse video link, currently only youtube, vimeo and niconico are supported'\n return\n end\n end",
"def media_video_processed_url\n if self.asset_type == TYPE[:media_video] && read_attribute(:processed).present? && self.processed == true\n self.file.url(:processed,false).gsub(/\\.[0-9a-zA-Z]+$/,\".mp4\")\n end\n end",
"def vidlog?\n vidlog = false\n self.items.each do |item|\n item.enclosures.each do |enclosure|\n vidlog = true if enclosure.video?\n end\n end\n return vidlog\n end",
"def streaming_video_url\n # TODO figure out how to remove the need for this stupid hack\n # paperclip adds the cache buster to the URL automatically, I need\n # it to go away, probably a really easy paperclip option, but not\n # finding it at the moment.\n unless streaming_video.nil?\n streaming_video.data.url.split(\"?\")[0]\n else\n nil\n end\n end",
"def video_source(str)\n if str.include? 'www.youtube.com'\n return youtube_embed(str)\n elsif str.include? 'youtu.be'\n return youtube_embed(str)\n else\n return nil\n end\n end",
"def is_video_active(args = {})\n receive_video_id? args\n args = receive_should_validate? args\n\n get('redtube.Videos.isVideoActive', args,\n [:video_id], args[:should_validate])\n end",
"def modify_media_file_url_if_from_video_site\n if media_file_url.present? && !ImageSrcUrl.new(media_file_url).is_image?\n video_src_url = VideoSrcUrl.new(media_file_url)\n self.media_file_url = video_src_url.value if video_src_url.is_video?\n end\n end",
"def irrelevant?\n video.nil? && manuscript.nil? && external_reference_link.blank?\n end",
"def new_player_allowed?; false end",
"def show; @video.show; end",
"def next_video_or_show\n ep = next_video\n if ep.nil?\n return content.show\n else\n return ep\n end\n end",
"def vimeo?\n website.url.host =~ /vimeo/\n end",
"def acceptable?(media_type)\n !matches(media_type).empty?\n end",
"def isPodcast?\n self.category =~ /(podcast|video|audio)/i\n end",
"def play\n each do |playable|\n if playable.respond_to?(:play)\n playable.play\n end\n end\n end",
"def video_exists?(id)\n find_by_id(id).nil?\n end",
"def human?\n return self.class == Player\n end",
"def check_and_print_video_file_name()\n is_success = true\n video_file_name = @options.video_file_name()\n if !!video_file_name then\n @renderer.print(\"Video: #{video_file_name}\")\n if FileTest.exist?(video_file_name) then\n @renderer.print(\"\\n\")\n else\n @renderer.print(\": does not exist.\\n\")\n is_success = false\n end\n end\n return is_success\n end",
"def autoplay_blocked_by_level?\n # Wrapped since we store our serialized booleans as strings.\n self.never_autoplay_video == 'true'\n end",
"def is_movie?\n self.type_of_show.downcase == \"movie\" ? true : false \n end",
"def allows_title?\n case kind\n when COVER, IMAGE1, AUDIO, VIDEO1, TITLE, TEXT then true\n else false\n end\n end",
"def video_url\n \"http://video.ted.com/#{videoID}\"\n end",
"def current_video\n last_poll = Room.find(id).video_polls.second_to_last\n if last_poll\n if last_poll.played_video\n last_poll.played_video\n else\n last_poll.candidate_videos.first.video\n end\n else\n playlist.videos.first\n end\n end",
"def is_playlist\n return @play_list != nil\n end",
"def video_mime_types\n ['video/mpg', 'video/mpeg', 'video/mp4', 'video/x-m4v', 'video/webm', 'video/x-msvideo', 'video/avi', 'video/quicktime', 'application/mxf']\n end",
"def check_video_codec\n @video_codec = @video_stream[:codec_name]\n @video_codec_check = if VIDEO_CODEC == @video_codec\n true\n else\n false\n end\n end",
"def url_for_video_player\n if VIDEOS_ON_S3\n \"http://wickedstartbucket.s3.amazonaws.com#{self.multimedia.url(:original, false)}\"\n else\n self.multimedia.url(:original, false)\n end\n end",
"def video\n \"#{self.video_file_name}\"\n end",
"def video_ended(ref,event)\n return false unless ref\n return true if ref.video && !event.video\n return true if ref.video && ref.video != event.video\n false\n end",
"def in_play?\n self.round.in_play?\n end",
"def user_can_access_channel\n return @channel.is_accessible_by(current_user) if @channel\n return @video.channel.is_accessible_by(current_user) if @video\n end",
"def parse_video_url(url)\n url_video = case url.downcase\n when /^http:\\/\\/(www\\.)?youtube\\.com/\n parse_youtube(url)\n # when /tudou/\n # parse_tudou(url)\n when /^http:\\/\\/(www\\.)?dailymotion\\.com/\n parse_dailymotion(url)\n # when /metacafe/\n # parse_metacafe(url)\n else\n url\n end\n url_video\n end",
"def next_video\n if episode?\n episode = content.next_ep\n unless episode.nil?\n return episode.video\n end\n end\n end",
"def set_processed_flag\n if read_attribute(:processed).present? && !read_attribute(:processed) && self.asset_type != TYPE[:media_video]\n self.processed = true\n end\n return true\n end",
"def windows_live?\n type == 'WindowsLive'\n end",
"def status\n if @av_player.nil?\n 'stop'\n else\n if @av_player.playing\n 'play'\n elsif @av_player.currentTime > 0.0\n 'pause'\n else\n 'stop'\n end\n end\n end",
"def video\n\t\tVideo.find(self.video_id)\n\tend",
"def from_accepted_site\n uri = URI.parse(self.video_url)\n\n if uri.host.nil? || (%w[youtube.com youtu.be vimeo.com player.vimeo.com].include?(uri.host.sub('www.', '')) == false)\n errors.add(:video_url, \"must be from youtube.com or vimeo.com\")\n end\n end",
"def has_sound?\n @has_sound = if @movie_info[:format][:nb_streams] == 1\n false\n elsif @movie_info[:format][:nb_streams] == 2\n true\n end\n end",
"def is_movie?\n @status\n end"
] |
[
"0.83826864",
"0.82667106",
"0.7903742",
"0.7889886",
"0.78727937",
"0.7813366",
"0.77756286",
"0.7705342",
"0.76434153",
"0.7614785",
"0.7571292",
"0.74946797",
"0.7446947",
"0.7446692",
"0.7424836",
"0.7242139",
"0.7026879",
"0.7007215",
"0.6989685",
"0.69199246",
"0.6918459",
"0.6909539",
"0.6898707",
"0.6887671",
"0.68549037",
"0.66816413",
"0.66344744",
"0.6609385",
"0.65244377",
"0.65137446",
"0.6447315",
"0.6437378",
"0.64093584",
"0.64018655",
"0.63703036",
"0.6347007",
"0.6345293",
"0.6334559",
"0.6331662",
"0.6320485",
"0.62875175",
"0.6247493",
"0.62444085",
"0.6235603",
"0.62211865",
"0.62151426",
"0.62047964",
"0.61772114",
"0.6170764",
"0.6169917",
"0.6155897",
"0.6141225",
"0.61393493",
"0.6120006",
"0.6118556",
"0.61146367",
"0.61005944",
"0.6093217",
"0.6093217",
"0.60895807",
"0.6078564",
"0.6063099",
"0.6044235",
"0.6034815",
"0.6032486",
"0.5988005",
"0.5987262",
"0.59830683",
"0.59792906",
"0.597804",
"0.59751046",
"0.59716487",
"0.59692025",
"0.5968362",
"0.59643376",
"0.59597695",
"0.59435755",
"0.59421766",
"0.5918925",
"0.59042484",
"0.5894124",
"0.58901507",
"0.5882895",
"0.58783835",
"0.58705175",
"0.58652556",
"0.58573514",
"0.58555907",
"0.5850984",
"0.5841151",
"0.58396786",
"0.5830204",
"0.5806178",
"0.58039814",
"0.579548",
"0.57695776",
"0.57669604",
"0.57348853",
"0.5730332",
"0.57277566"
] |
0.87688667
|
0
|
if an id refers to a comment/post in current thread
|
def thread_contains?(cid)
id == cid or cid =~ /\A#{id}_/
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def user_comment?(user_id)\n @current_user.id == user_id\n end",
"def show_comment_on_comment(id)\n if session[:shown_reply_to_comment].nil? ||\n\tsession[:shown_reply_to_comment].empty?\n session[:shown_reply_to_comment] = [ id ]\n else\n session[:shown_reply_to_comment] << id unless session[:shown_reply_to_comment].include? id\n end\n end",
"def comment_moderator? comment\n id == comment.holder_id\n end",
"def authorized_user? comment\n comment.user_id == current_user.id || comment.post.user_id == current_user.id\n end",
"def collapse_comment_on_comment(id)\n unless session[:shown_reply_to_comment].nil? ||\n\tsession[:shown_reply_to_comment].empty?\n session[:shown_reply_to_comment].delete(id) if session[:shown_reply_to_comment].include? id\n end\n end",
"def commented_by?(person)\n !!self.comments.find(:first, :conditions => [\"comments.person_id = ?\", person.id])\n end",
"def is_reply_allowed?(comment)\n if comment.parent_id.nil?\n true\n # redirect_to(post, :alert => \"You are not allowed man to reply a reply! Don't even try boy, it could cost you the life!\")\n end\n end",
"def is_my_post?(userid)\n #if someone is logged in\n if @current_user\n #if the user id of the post is the user id of the person logged in => it is my post\n if @current_user.id == userid\n return true\n # it isn't my post\n else\n return false\n end\n #It isn't my post because I'm not logged in\n else\n return false\n end\n end",
"def find_commentable\n @commentable = Micropost.find_by_id(params[:comment][:micropost_id])\n if params[:comment][:comment_id]\n @commentable = Comment.find_by_id(params[:comment][:comment_id]) if params[:comment][:comment_id]\n end\n end",
"def duplicate?\n c = Comment.find_by_trip_id_and_user_id_and_body(trip, user, body)\n # Give self the id for REST routing purposes.\n self.id = c.id unless c.nil?\n not c.nil?\n end",
"def thread_member?(user)\n user == self.user || (messagable_type == \"User\" && messagable_id == user.id) || self.replies.map(&:user).include?(user)\n end",
"def can_create_comment?(post); true; end",
"def getThreadId(currentComment)\n current_new_id = currentComment.new_id\n while current_new_id.nil?\n currentComment = Comment.find(currentComment.comment_id)\n current_new_id = currentComment.new_id\n end \n return current_new_id\n end",
"def can_request?(post)\n post[:post_id] != posts\n end",
"def set_comment\n @comment = Comment.find(params[:id])\n @entry = Entry.find(params[:entry_id])\n @blog = Blog.find(params[:blog_id])\n if @blog.id != @entry.blog_id or @entry.id != @comment.entry_id\n render plain: \"Not found\", status: 404\n end\n end",
"def set_thread_for_replies\n self.thread = self.commentable.thread if self.reply_comment?\n end",
"def replied_conv? usr\n if @conv.posts.count > 1 && @conv.posts.last.user_id != usr.id\n @conv.posts.each do |post|\n return true if post.user_id == usr.id\n end\n end\n false\n end",
"def already_commented_by_user?(the_user)\n !self.comments.where([\"user_id = ?\", the_user.id]).empty?\n end",
"def comment?\n @params[\"activity_type\"] == \"comment-add\"\n end",
"def can_be_commented?\n hash.key?('comments_url') && hash.key?('comments_count')\n end",
"def commentable_by?(user_id)\n user_id = user_id.id if user_id.is_a?(User)\n has_role(user_id, :commenter)\n end",
"def comments(post_id)\n records \"comment\", \"/msg/comments/#{post_id}\"\n end",
"def isCommentCreator(current_user, comment_id)\n Comment.where(:user_id => current_user, :id => comment_id).exists? \n end",
"def isCommentCreator(current_user, comment_id)\n Comment.where(:user_id => current_user, :id => comment_id).exists? \n end",
"def find_commentable\n @commentable = Comment.find_by_id(params[:comment_id]) if params[:comment_id]\n @commentable = Submission.find_by_id(params[:submission_id]) if params[:submission_id]\n end",
"def comment\n @comment ||= client.issue_comments(repository, pr_id).detect do |comment|\n UrlSectionBuilder.match?(comment[:body])\n end\n end",
"def reply?\n !!in_reply_to_status_id\n end",
"def can_have_comments?\n self.post?\n end",
"def comment(id)\n record \"/msg/comment/#{id}\"\n end",
"def has_cursor_id?\n acknowledged? && replies.last.respond_to?(:cursor_id)\n end",
"def set_post_thread\n @post_thread = PostThread.viewable(current_account).find(params[:id])\n end",
"def find_comment\n\t\t\tif params[:id] && params[:id].length > 0\n\t\t\t\t@comment = Comment.find(:first, :conditions => [\"url_part = ? OR uuid = ?\", params[:id], params[:id]])\n\t\t\tend\n\t\tend",
"def maybe_is_it?\n @comments.detect do |comment|\n comment['works_for_me']\n end\n end",
"def set_post_thread\n @post_thread = PostThread.find(params[:id])\n end",
"def set_post_thread\n @post_thread = PostThread.find(params[:id])\n end",
"def has_post_access(board_id, post_id)\n post = Unsakini::Post.where(id: post_id, board_id: board_id)\n .joins(\"LEFT JOIN #{UserBoard.table_name} ON #{UserBoard.table_name}.board_id = #{Post.table_name}.board_id\")\n .where(\"#{UserBoard.table_name}.user_id = ?\", @user.id)\n .first\n if post.nil?\n return {status: :forbidden}\n else\n return {status: :ok, post: post}\n end\n end",
"def load_commentable\n klass = [Post, Comment].detect { |c| params[\"#{c.name.underscore}_id\"]}\n @commentable = klass.find(params[\"#{klass.name.underscore}_id\"])\n end",
"def comment_reply\n CommentMailer.comment_reply(Comment.where('parent_id is not null').last.id)\n end",
"def pending_repost?\n self.review_status_id == ReviewStatus.find(:first,\n :conditions => \"name='Pending Repost'\").id\n end",
"def comment_finished?\n\t\t\n\tend",
"def load_commentable\n return @commentable if @commentable\n param = params.detect { |name, value| name.to_s =~ /(.+)_id$/ }\n if param\n @commentable = param[0].to_s.gsub(/_id$/,'').classify.constantize.find(param[1])\n else\n nil\n end\n end",
"def lawyer_can_see?(uid, mid, matter_task, cid)\n me = MatterPeople.me(uid,mid,cid)\n if self.title.eql?(\"MatterTask Client\")\n matter_task.assigned_to_matter_people_id == me.id || client_comment_accesible?(matter_task.matter,uid)\n else\n true\n end\n end",
"def comment_liking?(comment)\n comment_liking_comments.include?(comment)\n end",
"def comment?\n @contents[0] == :comment\n end",
"def load_commentable\n \t\tklass = [PhotoShout, Trip].detect {|c| params[\"#{c.name.underscore}_id\"]}\n\t \t@commentable = klass.find(params[\"#{klass.name.underscore}_id\"])\n \tend",
"def update?\n\t\t@comment.user == @user\n\tend",
"def liked_comment?(comment)\n liked_comments.include? comment\n end",
"def check_blog id\n blogs_id = current_user.blogs.map {|blog| blog.id}\n blogs_id.include?(id)\n end",
"def show_post\n @comment = Comment.find(params[:cmt_id])\n end",
"def update_thread\n self.update_attribute(:thread, self.id) unless self.thread\n end",
"def find_reply\n @reply = Comment.find_by_id(params[:comment_id]) if params[:comment_id]\n #@reply = Subject.find_by_id(params[:subject_id]) if params[:subject_id]\n @reply = Person.find_by_id(params[:person_id]) if params[:person_id]\n @reply = Listing.find_by_id(params[:listing_id]) if params[:listing_id]\n end",
"def comment_owner\n unless current_user.id == @comment.user.id\n flash[:notice] = \"You don't have access to that!\"\n redirect_to @post\n end\n \n end",
"def is_the_author_of_the_post(post)\n post.author_id == current_author.id\n end",
"def reply\n is_reputable_to do\n @post = Post.find(params[:id])\n @topic = @post.topic\n @topicable = @topic.topicable\n #\n render_reply_form\n end \n end",
"def is_comment?\n self.object_type.downcase.to_s == \"comment\" || self.object_type.blank?\n end",
"def url\n new? ? '#' : post.url + \"#comment-#{id}\"\n end",
"def do_comment\n\t\t# 发布评论时要知道这个评论属于哪篇文章,所以要在 Article 模型上调用 find 方法查找文章对象。\n\t\t@message = Message.find(params[:message_id])\n\t\tcommenter = session[:username]\n\t comment_message = params[:comment_message]\n\t if comment_message == ''\n\t \tredirect_to \"/show/messages/#{@message.id}\"\n\t else\n\t \t@comment = @message.comments.new\n\t \t@comment.commenter = commenter\n\t \t@comment.comment_message = comment_message\n\t \t@comment.save\n\t \tredirect_to \"/show/messages/#{@message.id}\"\n\t end\n\tend",
"def load_commentable\n klass = [Photo, Story].detect { |c| params[\"#{c.name.underscore}_id\"] }\n @commentable = klass.find(params[\"#{klass.name.underscore}_id\"])\n end",
"def discussion\n Comment.where(\"article_id = ?\", id)\n end",
"def is?(id)\n self.id == id\n end",
"def following?(post)\n posts.include?(post)\n end",
"def top_level?\n !self.reply_comment?\n end",
"def id?\n @id\n end",
"def reposts\n Comment.where(:original_id => self.id).where(['id != ?', self.id])\n end",
"def motivatedByCommenting?\n motivatedByCommenting.length > 0\n end",
"def is_comment_creation?\n request.post? && request.request_parameters['comment'].present?\n end",
"def comment(id, text)\n require_login!\n fnid = get(ITEM_URL % id).match(/<input type=hidden name=\"fnid\" value=\"([^\"]+)\"/)[1]\n post(COMMENT_SUBMIT_URL, 'fnid' => fnid, 'text' => text)\n end",
"def comment(id, text)\n require_login!\n fnid = get(ITEM_URL % id).match(/<input type=hidden name=\"fnid\" value=\"([^\"]+)\"/)[1]\n post(COMMENT_SUBMIT_URL, 'fnid' => fnid, 'text' => text)\n end",
"def spam_check\n CommentSpamCheckWorker.perform_in(5.seconds, id)\n end",
"def is_my_tnote?(id)\n tnote = Tastingnote.find_by_id(id) \n tnote.user_id == current_user ? true : false\n end",
"def sent?\n id.present?\n end",
"def comments\n posts.all :conditions => { :object_type => :comment }\n end",
"def allows_comment?(a_person=nil)\n self.alive?\n end",
"def find_comment\n @comment = @post.comments.find(params[:id])\n end",
"def comment_id\n changes['comment_id']\n end",
"def comment?\n type == COMMENT_NODE\n end",
"def id_found?\n token && decoded_token && decoded_token[:id]\n end",
"def is_a_post?\n self.object_type == :post\n end",
"def can_comment?(person)\n self.reviewer != person && !commented_by?(person)\n end",
"def comment_on_wall_blog_or_event\n # if request.post?\n unless params.nil?\n email = params[:username]\n password = params[:password]\n\n person = Person.authenticate(email,password)\n if person.nil?\n return_failure(error_text_while_authentication)\n else\n poster = Person.find(person.id)\n if wall?\n parent = Person.find(params[:person_id])\n type=\"Person\"\n elsif blog?\n parent = Post.find(params[:blog_id])\n type=\"Post\"\n elsif event?\n parent = Event.find(params[:event_id])\n type=\"Event\"\n end\n body = params[:content]\n\n if parent.nil? or body.nil?\n return_failure(error_text_while_comment_post)\n elsif !parent.nil? and !body.nil?\n comment = Comment.unsafe_build(:commenter_id=>poster.id, :commentable_id=>parent.id, :commentable_type=>type, :body=>body, :created_at=>Time.now, :updated_at=>Time.now)\n end\n\n if comment.save!\n return_success\n end #End of message.save!\n end #End of if person.nil?\n\n end #End of unless params.nil?\n# else\n# return_failure(error_text_for_get_requests)\n# end #End of if requst.post\n end",
"def show\n redirect_to pretty_post_url(@post) + \"#comment_#{params[:id]}\"\n end",
"def notifies_commenter? # ...of direct responses to this comment\n wants_notifications?\n end",
"def check_add_comment_access\r\n return true if logged_in?\r\n return false\r\n end",
"def user_id\n Reddit::Base.user_id\n end",
"def set_comment\n @comment = @post.comments.find(params[:id])\n end",
"def edit_discussion(params, userid)\n db = connect()\n disk = db.execute('SELECT * FROM discussions WHERE Id=? AND UserId=?', params[\"id\"], userid)\n if disk != []\n return disk.first\n else\n return false\n end\n end",
"def show\n @submission = Submission.find(params[:submission_id])\n @comment = Comment.find(params[:id])\n if @submission.id == @comment.submission_id\n render :json => @comment.as_json\n else\n render :json => {\"error\": \"no calza id con noticia\"}\n end\n end",
"def duplicate?\n\t\tpost = Post.find_by_blog_id_and_title_and_body(blog_id, title, body)\n\n\t\t# Give self the id for REST routing purposes.\n\t\tself.id = post.id unless post.nil?\n\t\tnot post.nil?\n\tend",
"def retweeted?\n retweeted_ids = h.current_user.retweeted_replies.pluck(:id)\n retweeted_ids.include?(self.id)\n end",
"def notify_comment(comment_id)\n puts \"comment parent #{comment_id}\"\n comment = Comment.find comment_id\n\n if comment.parent_id\n parent = Comment.find(comment.parent_id, include:[:user,:article])\n puts parent\n if parent and comment.user_id != parent.user_id\n commented_user= parent.user\n commented_article = parent.article\n\n if commented_user && commented_article\n\n key=\"new_comment.#{commented_article.id}.#{comment.user_id}\"\n notification = Notification.find_by_key(key)\n puts key\n\n if !notification\n Notification.create user_id: commented_user.id,\n key: key,\n content: \"#{commented_article.id}.#{comment.id}\"\n else\n Notification.update(notification.id,\n user_id: commented_user.id,\n key: key,\n content: \"#{commented_article.id}.#{comment.id}\",read:false)\n end\n end\n end\n end\n end",
"def comments?\n @comments_on === true\n end",
"def specified_comment(token, action)\n @comment = @graph.get_connections(@post_id, \"comments\",\n :limit=>1,\n :fields => [\"from{name,id,picture}\",\n \"id\",\n \"message\",\n \"created_time\",\n \"like_count\", \n ],\n action => token,\n )\n end",
"def prevent_commenting?\n prevent_commenting_until? && prevent_commenting_until > Time.current\n end",
"def peer_auditor_issue?\n self.auditor_result == 'Comment'\n end",
"def set_comment\n @comment = Comment.where(:id => params[:id]).first\n end",
"def comments?\n comments.present?\n end",
"def liked?\n liked_ids = h.current_user.liked_replies.pluck(:id)\n liked_ids.include?(self.id)\n end",
"def comment?\n [\"text\", \"text_wholepage\"].include?(@type)\n end",
"def toggle_spam_comment(article_id, id)\n put \"articles/#{article_id}/comments/#{id}/toggle_spam\", nil\n end",
"def validate_comment_id\n if Comment.find_by(id: comment_id).nil?\n errors.add(:comment_id, \"must be a valid comment\")\n end\n end"
] |
[
"0.6769683",
"0.6527905",
"0.64404404",
"0.6253728",
"0.6173363",
"0.6137364",
"0.6131735",
"0.60899293",
"0.60822713",
"0.60634106",
"0.60122716",
"0.5983107",
"0.59741807",
"0.59417033",
"0.5923514",
"0.59014297",
"0.58922756",
"0.58908457",
"0.5883245",
"0.5880391",
"0.58730614",
"0.58641404",
"0.5849968",
"0.5849968",
"0.58467585",
"0.584265",
"0.5822523",
"0.58223933",
"0.580125",
"0.57878935",
"0.57552403",
"0.5752007",
"0.57290334",
"0.5718304",
"0.5718304",
"0.57119554",
"0.57076335",
"0.5696348",
"0.568329",
"0.5679986",
"0.5672301",
"0.56669647",
"0.5662714",
"0.5644825",
"0.56235224",
"0.5620285",
"0.5613963",
"0.56073725",
"0.56043184",
"0.55879956",
"0.5566125",
"0.55450684",
"0.5532593",
"0.5529699",
"0.5521125",
"0.5510958",
"0.55048126",
"0.5504007",
"0.5503079",
"0.55006105",
"0.54991907",
"0.5496242",
"0.54960006",
"0.5491797",
"0.5490593",
"0.54707736",
"0.54605645",
"0.54605645",
"0.5458082",
"0.5450645",
"0.54484046",
"0.5439647",
"0.54389673",
"0.5425431",
"0.54254055",
"0.5421752",
"0.541456",
"0.5409151",
"0.5407167",
"0.5397053",
"0.53940535",
"0.53935593",
"0.53858167",
"0.5382792",
"0.5379689",
"0.53777194",
"0.53680146",
"0.5361497",
"0.5360179",
"0.53537256",
"0.5348814",
"0.534374",
"0.53309715",
"0.533028",
"0.5321252",
"0.5319743",
"0.53153217",
"0.53130907",
"0.5309618",
"0.5308991"
] |
0.64547956
|
2
|
Creates information about a diff between two trees.
|
def initialize(files_added, files_removed, files_modified)
@files_added = files_added.to_a.dup.freeze
@files_removed = files_removed.to_a.dup.freeze
@files_modified = files_modified.to_a.dup.freeze
freeze
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def cmd_diff\n print_tree(DiffEditor, nil, true)\n end",
"def diff_tree(a, b=\"^#{a}\")\n sandbox do |git,w,i|\n output = git.run('', :diff_tree, '', {:r => true, :name_status => true}, [a, b])\n \n diff = {'A' => [], 'D' => [], 'M' => []}\n output.split(\"\\n\").each do |line|\n mode, path = line.split(' ', 2)\n array = diff[mode] or raise \"unexpected diff output:\\n#{output}\"\n array << path\n end\n\n diff\n end\n end",
"def diff_subtree(tree1, tree2, path)\n ret = []\n\n # compatible classes\n if tree1.class == tree2.class\n # both subtrees are Hash\n if tree1.is_a? Hash\n keys = (tree1.keys + tree2.keys).uniq\n\n keys.each do |key|\n if tree1.key?(key) && tree2.key?(key)\n ret << diff_subtree(tree1[key],\n tree2[key],\n path + [key])\n\n elsif tree1.key?(key)\n # delete hash key\n ret << {\n 'path' => path,\n 'key' => key,\n 'old' => tree1[key],\n 'state' => 'rm',\n 'extra' => {}\n }\n else\n # insert new hash key\n ret << {\n 'path' => path,\n 'key' => key,\n 'value' => tree2[key],\n 'state' => 'ins',\n 'extra' => {}\n }\n end\n end\n\n # both subtrees are Array\n elsif tree1.is_a? Array\n if @strict\n idx = 0\n idx1 = 0\n idx2 = 0\n\n while (idx1 < tree1.length) || (idx2 < tree2.length)\n val1 = tree1[idx1]\n val2 = tree2[idx2]\n\n # We need to be sure we are comparing values\n # still inside the arrays and not valid nil\n # value with item outside the array range.\n if (idx1 < tree1.length) && (idx2 < tree2.length)\n if OneCfg::Config::Utils.deep_compare(val1,\n val2,\n @strict)\n idx += 1\n idx1 += 1\n idx2 += 1\n else\n # Inserting values:\n # 1 = A, B, C, D, E, F\n # 2 = A, B, X, C, Y, D, E, F\n # INSERT X, idx 2\n # INSERT X, idx 4\n # when on pos 2, forward lookup for 'C'\n # in tree2, find on pos 3, so add new\n # 'X' on pos 2, idx2++\n #\n # Deleting values:\n # 1 = A, B, C, D, E, F\n # 2 = A, B, E, F\n # DELETE C, idx 2\n # DELETE D, idx 2\n # when on pos 2, forward lookup for 'C'\n # in tree, don't find any, so delete\n # 'C' from pos 2, idx1++\n\n # forward lookup for val1\n fwd_found = false\n fwd_idx2 = idx2 + 1\n\n # rubocop:disable Layout/LineLength\n while (fwd_idx2 < tree2.length) && !fwd_found\n if OneCfg::Config::Utils.deep_compare(tree2[fwd_idx2], val1, @strict)\n fwd_found = true\n else\n fwd_idx2 += 1\n end\n end\n # rubocop:enable Layout/LineLength\n\n if fwd_found\n # insert array item\n ret << {\n 'path' => path,\n 'key' => nil,\n 'value' => val2,\n 'old' => val1,\n 'state' => 'ins',\n 'extra' => { 'index' => idx }\n }\n\n idx += 1\n idx2 += 1\n\n else\n # delete array item\n ret << {\n 'path' => path,\n 'key' => nil,\n 'old' => val1,\n 'state' => 'rm',\n 'extra' => { 'index' => idx }\n }\n\n idx1 += 1\n end\n end\n\n # Process remaining array items on tree1\n # by dropping them (not found on tree2)\n elsif idx1 < tree1.length\n # delete array item\n ret << {\n 'path' => path,\n 'key' => nil,\n 'old' => val1,\n 'state' => 'rm',\n 'extra' => { 'index' => idx }\n }\n\n idx1 += 1\n\n # Process remaining new array items on tree2\n # by creating them.\n else\n # insert array item\n ret << {\n 'path' => path,\n 'key' => nil,\n 'value' => val2,\n 'old' => val1,\n 'state' => 'ins',\n 'extra' => { 'index' => idx }\n }\n\n idx += 1\n idx2 += 1\n end\n end\n else\n values = (tree1 + tree2).uniq\n\n values.each do |val|\n di1 = OneCfg::Config::Utils.deep_include?(\n tree1, val, @strict\n )\n\n di2 = OneCfg::Config::Utils.deep_include?(\n tree2, val, @strict\n )\n\n if di1 && di2\n # skip\n nil\n\n elsif di1\n # delete array item\n ret << {\n 'path' => path,\n 'key' => nil,\n 'old' => val,\n 'state' => 'rm',\n 'extra' => {}\n }\n else\n # insert array item\n ret << {\n 'path' => path,\n 'key' => nil,\n 'value' => val,\n 'state' => 'ins',\n 'extra' => {}\n }\n end\n end\n end\n\n # both subtrees are Nil\n elsif tree1.is_a? NilClass\n # skip\n nil\n\n # both subtrees are of some other type\n else\n unless OneCfg::Config::Utils.deep_compare(tree1,\n tree2,\n @strict)\n # set new value\n ret << {\n 'path' => path[0..-2],\n 'key' => path[-1],\n 'value' => tree2,\n 'old' => tree1,\n 'state' => 'set',\n 'extra' => {}\n }\n end\n end\n\n # Tree1 and tree2 are not same classes. We can't compare\n # them so we take tree2 as new value to set as-is.\n else\n # set new value\n ret << {\n 'path' => path[0..-2],\n 'key' => path[-1],\n 'value' => tree2,\n 'old' => tree1,\n 'state' => 'set',\n 'extra' => {}\n }\n end\n\n ret\n end",
"def diff(from, to)\n @repository.diff(from, to, path)\n end",
"def diff(from, to)\n @repo.diff(from, to).path(path)\n end",
"def diff(other,options={},&block)\n return enum_for(__method__,other,options) unless block\n\n if (options[:added] || options[:removed])\n tdiff_unordered(other) do |change,node|\n if (change == '+' && options[:added]) then yield change, node\n elsif (change == '-' && options[:removed]) then yield change, node\n end\n end\n else\n tdiff(other,&block)\n end\n end",
"def diff(other, options={})\n Differences::Entry.compute(self, other, diff_criteria(options), options)\n end",
"def diff2; end",
"def generate_diff wA, wB\n\n # puts \"---------------------------------> generating diff for #{wA} and #{wB}\"\n # sort by magnitude of id\n # returns w1 has earlier id than w2\n wA < wB ? w1id = wA : w1id = wB\n wA < wB ? w2id = wB : w2id = wA\n\n # get refs to whole works\n w1 = Work.find(w1id)\n w2 = Work.find(w2id)\n\n # check they belong to same project\n errors.add(:project, \"projects don't match\") unless w1.project_id == w2.project_id\n\n project = Project.find(w2.project_id) # same as w1\n\n\n # ----------- make diffs ------------ #\n\n # set values to diff from neighbord\n w1_md = w1.file_content_md.force_encoding(\"UTF-8\") if !w1.file_content_md.nil?\n w1_html = w1.file_content_html.force_encoding(\"UTF-8\") if !w1.file_content_html.nil?\n w1_text = w1.file_content_text.force_encoding(\"UTF-8\") if !w1.file_content_text.nil?\n\n # **note** self.file_content_md is coming from ReverseMarkdown now, instead of PandocRuby\n diff_md_val = Diffy::Diff.new(w1_md ,w2.file_content_md).to_s\n diff_html_val = Diffy::Diff.new(w1_md ,w2.file_content_md).to_s(:html)\n diff_text_val = Diffy::Diff.new(w1_text ,w2.file_content_text).to_s\n\n ### ALWAYS DIFF INTO :HTML FORMAT SO WE CAN DISPLAY IT NEATLY.\n ### ALWAYS DIFF !EMPTY RIGHT/LEFT\n diff_left_val = Diffy::SplitDiff.new(w1_md ,w2.file_content_md, :format => :html, :allow_empty_diff => false).left if !w1_md.nil?\n diff_right_val = Diffy::SplitDiff.new(w1_md ,w2.file_content_md, :format => :html, :allow_empty_diff => false).right if !w1_md.nil?\n\n # _text diffs for pdfs and plain text docs\n diff_left_text_val = Diffy::SplitDiff.new(w1_text ,w2.file_content_text, :format => :html, :allow_empty_diff => false).left if !w1_text.nil?\n diff_right_text_val = Diffy::SplitDiff.new(w1_text ,w2.file_content_text, :format => :html, :allow_empty_diff => false).right if !w1_text.nil?\n\n # ** .scrub! ensures we don't get any fucked up character encoding errors from mysql2\n # if !diff_md_val.nil? ensures we're dealing with a diffable doc (ie not a picture)\n diff_md_val.force_encoding(\"UTF-8\").scrub! if !diff_md_val.nil? #.encode!('UTF-8', :invalid => :replace, :undef => :replace, :replace => '')!diff_md_val.nil?\n diff_html_val.force_encoding(\"UTF-8\").scrub! if !diff_html_val.nil?\n diff_text_val.force_encoding(\"UTF-8\").scrub! if !diff_text_val.nil?\n\n diff_left_val.force_encoding(\"UTF-8\").scrub! if !diff_left_val.nil?\n diff_right_val.force_encoding(\"UTF-8\").scrub! if !diff_right_val.nil?\n\n # diff_left_text_val.force_encoding(\"UTF-8\").scrub! if !diff_left_val.nil?\n # diff_right_text_val.force_encoding(\"UTF-8\").scrub! if !diff_right_val.nil?\n # diff_left_val.force_encoding(\"UTF-8\").scrub! if !diff_left_val.nil?\n # diff_right_val.force_encoding(\"UTF-8\").scrub! if !diff_right_val.nil?\n diff_left_text_val.force_encoding(\"UTF-8\").scrub! if !diff_left_text_val.nil?\n diff_right_text_val.force_encoding(\"UTF-8\").scrub! if !diff_right_text_val.nil?\n\n # ----------- update or create diff ------------ #\n\n # update_or_create for, well, updating or creating\n diff = Diff.where(project_id: project.id, work1: w1id, work2: w2id).first_or_create\n diff.update!(\n diff_md: diff_md_val,\n diff_html: diff_html_val,\n diff_text: diff_text_val,\n left: diff_left_val,\n right: diff_right_val,\n left_text: diff_left_text_val,\n right_text: diff_right_text_val\n )\n\n end",
"def generate_diff\n a, b = @previous.lines, @current.lines\n trace = compute_exploring_graph(a, b)\n diff = []\n\n backtrack(trace, a.size, b.size) do |prev_x, prev_y, x, y|\n if x == prev_x # Forward move\n diff.unshift(Fizzy::Diff::Line.new(:ins, nil, b.size, b.pop))\n elsif y == prev_y # Downward move\n diff.unshift(Fizzy::Diff::Line.new(:del, a.size, nil, a.pop))\n else # Diagonal move\n diff.unshift(Fizzy::Diff::Line.new(:eql, a.size, b.size, [a.pop, b.pop].last))\n end\n end\n\n diff\n end",
"def generate_diff\n jsons = version_jsons.map { |j| pretty_json(j) }\n differ = Differ.send(diff_method, *jsons).format_as(:html)\n differ.gsub!('<ins', \"\\n<ins\") if diff_method == :diff_by_line\n @diff = sanitize(differ).html_safe\n end",
"def diff(v1, v2)\n repos.git.diff(v1, v2, path)\n end",
"def diff(other)\n if engine != other.engine && @input_engine\n [:engine, engine, other.engine]\n elsif version != other.version\n [:version, version, other.version]\n elsif engine_version != other.engine_version && @input_engine\n [:engine_version, engine_version, other.engine_version]\n elsif patchlevel != other.patchlevel && @patchlevel\n [:patchlevel, patchlevel, other.patchlevel]\n end\n end",
"def diff1; end",
"def persistable_diff(a, b)\n diff = Diff::LCS.diff a, b\n reify_diff_element(diff).as_json\n end",
"def diff_init(diff, path)\n Smash.new.tap do |di|\n if diff.size > 1\n updated = diff.find_all { |x| x.first == \"+\" }\n original = diff.find_all { |x| x.first == \"-\" }\n di[:original] = Array(original).map(&:last).join(\", \")\n di[:updated] = Array(updated).map(&:last).join(\", \")\n else\n diff_data = diff.first\n di[:path] = path\n if diff_data.size == 3\n di[diff_data.first == \"+\" ? :updated : :original] = diff_data.last\n else\n di[:original] = diff_data[diff_data.size - 2].to_s\n di[:updated] = diff_data.last.to_s\n end\n end\n end\n end",
"def compare(node, node2)\n\n hxlist, hxlist2 = hashedxml(node), hashedxml(node2) \n \n # elements which may have been modified are also \n # added to the added_indexes list \n added_or_changed_indexes = added(hxlist, hxlist2)\n added_indexes, updated_indexes = @fuzzy_match ? \\\n fuzzy_match(added_or_changed_indexes, node, node2) : \\\n [added_or_changed_indexes, []]\n added_indexes.each do |i|\n \n attributes = node2.elements[i+1].attributes\n attributes[:created] ||= Time.now.to_s\n \n node2.elements[i+1].traverse do |e|\n\n e.attributes[:created] ||= Time.now.to_s\n\n end\n end\n\n deleted_indexes = deleted(hxlist, hxlist2)\n \n unchanged_indexes = unchanged(hxlist, hxlist2)\n\n unchanged_indexes.each do |i, i2| \n\n compare(node.elements[i+1], node2.elements[i2+1]) if node\\\n .elements[i+1].has_elements?\n attributes2 = node2.elements[i2+1].attributes\n \n if attributes2[:created].nil? then\n attributes = node.elements[i+1].attributes\n attributes2[:created] = attributes[:created] if attributes[:created]\n end\n end\n\n end",
"def diff(a, b, type='A')\n if a == b || b.nil?\n return []\n end\n \n paths = a.nil? ? git.ls_tree(b) : git.diff_tree(a, b)[type]\n paths.collect! do |path|\n ab, xyz, target = path.split('/', 3)\n assoc_sha(\"#{ab}#{xyz}\", target)\n end\n\n paths.compact!\n paths\n end",
"def diff(other, callbacks = nil, &block)\n Diff::LCS.diff(self, other, callbacks, &block)\n end",
"def review_diff(other)\n diff = {}\n if self.publication_type != other.publication_type\n diff[:publication_type] = {from: I18n.t('publication_types.'+other.publication_type.code+'.label'), to: I18n.t('publication_types.'+self.publication_type.code+'.label')}\n end\n\n unless (self.category_svep_ids & other.category_svep_ids == self.category_svep_ids) && (other.category_svep_ids & self.category_svep_ids == other.category_svep_ids)\n diff[:category_hsv_local] = {from: other.categories, to: self.categories}\n end\n\n if self.ref_value != other.ref_value\n diff[:ref_value] = {from: I18n.t('ref_values.'+other.ref_value.to_s), to: I18n.t('ref_values.'+self.ref_value.to_s)}\n end\n\n return diff\n end",
"def createDiffResult(working_dir, channel_cfg, vimapp, isReleaseOperator,backupRoot)\n\n remotedir = readChannelDir(channel_cfg, vimapp) + \"/\"+ File.basename(working_dir)\n puts remotedir.green\n if File.directory?(remotedir) == false\n FileUtils.mkdir_p remotedir\n end\n\n reportFile1 = \"#{remotedir}/report\"\n reportFile2 = \"#{remotedir}/rdetail\"\n lines = File.open(reportFile1, \"r:UTF-8\").each_line.to_a\n\n hashes = Array.new\n lines.each do |line|\n if line.start_with? \"hash=\"\n hashes.push line.gsub(\"hash=\",\"\").strip.chomp\n end\n end\n\n g = gitOpen(working_dir)\n \n logs = getGitLog(g)\n local_branches = getGitBranches(g)[:local]\n diff = compareHashes g, logs, hashes\n \n def getDiffDetails(diffinfo)\n puts \"diffdetails\"\n data = Array.new \n\n diffinfo[:files].each do |file|\n print \"[\"\n print file[0].cyan\n print \"] \"\n print \"[+] #{file[1][:insertions]}\".green\n print \" \"\n print \"[-] #{file[1][:deletions]}\".red\n puts\n # file, insertions, deletions\n data.push \"file=#{file[0]},#{file[1][:insertions]},#{file[1][:deletions]}\"\n end\n\n return data \n end\n\n diff_details = getDiffDetails diff[1]\n \n puts \"\\n\\n|||||||||||||||||||||||||WRITE|||||||||||||||||||||||||||||||||\\n\\n\"\n\n puts \"hash=\"+diff[2]\n puts \"hash=\"+diff[3]\n diff_details.each do |d| \n puts d\n end\n\n diffReportDir = \"#{working_dir}/.diffreport\"\n FileUtils.mkdir_p diffReportDir \n\n #write diff detail to file \n r_detail = \"#{diffReportDir}/detail\"\n\n puts \">> 222\"\n f = File.open(r_detail, \"w:UTF-8\")\n diff[0].each do |l|\n f.puts l\n end\n f.close\n\n f = File.open(r_detail+\".color\", \"w:UTF-8\")\n diff[0].each do |l|\n if isPlus(l)\n f.puts l.green\n elsif isMinus(l)\n f.puts l.red\n else\n f.puts l\n end\n end\n f.close\n\n puts \">> 111\"\n #write diff to file\n diffReport = \"#{diffReportDir}/report\"\n f = File.open(diffReport, \"w:UTF-8\")\n f.puts \"hash=\"+diff[2]\n f.puts \"hash=\"+diff[3]\n diff_details.each do |d| \n f.puts d\n end\n f.close\n puts \"\\n\\nWRITTEN\\n\\n\".green\n\n if isReleaseOperator == false\n FileUtils.cp \"#{diffReport}\", \"#{reportFile1}\"\n FileUtils.cp \"#{r_detail}\", \"#{reportFile2}\"\n else\n metaOK = FileUtils.identical?(diffReport, reportFile1)\n detailOK = FileUtils.identical?(r_detail, reportFile2)\n \n puts \n print \"[ OVERVIEWS ] \" #metaOK.to_s.red\n puts metaOK ? \"IDENTICAL\".green : \"DIFFERENT\".red\n print \"[CODE DETAILS] \"\n puts detailOK ? \"IDENTICAL\".green : \"DIFFERENT\".red\n puts\n def compare(file1, file2)\n puts \">> compare\"\n lines1 = File.open(file1, \"r:UTF-8\").each_line.to_a\n lines2 = File.open(file2, \"r:UTF-8\").each_line.to_a\n def showInclusion(lines1, lines2, i)\n lines1.each do |line|\n if lines2.include?(line) == false\n if i == true\n puts \"[YOURS] \"+ line.chomp.cyan\n else\n puts \"[REMOTE] \"+ line.chomp.yellow\n end\n end\n end\n end\n showInclusion(lines1, lines2, true)\n showInclusion(lines2, lines1, false)\n end\n compare diffReport, reportFile1\n compare r_detail, reportFile2\n end\n\n files = Array.new\n diff_details.each do |d| \n if d.start_with? \"file=\"\n files.push d.gsub(\"file=\",\"\").strip.chomp\n end\n end\n if hashes.size > 0\n #compareBackupsWithOldVersion(g, working_dir, backupRoot, files, hash) \n #compareBackupsWithOldVersion(g, working_dir,backupRoot,files, hash[1]) \n end\n end",
"def diff(other)\n Distance.diff_total(self, other, true)\n end",
"def diff(other)\n require_cmd! diff_cmd\n out = nil\n\n begin\n this_dir = unpack\n other_dir = other.is_a?(Polisher::Gem) ? other.unpack :\n (other.is_a?(Polisher::Git::Repo) ? other.path : other)\n result = AwesomeSpawn.run(\"#{diff_cmd} -r #{this_dir} #{other_dir}\")\n out = result.output.gsub(\"#{this_dir}\", 'a').gsub(\"#{other_dir}\", 'b')\n rescue\n ensure\n FileUtils.rm_rf this_dir unless this_dir.nil?\n FileUtils.rm_rf other_dir unless other_dir.nil? ||\n !other.is_a?(Polisher::Gem)\n end\n\n out\n end",
"def diff_to_compare; end",
"def diff\n @diff ||= begin\n commit.diffs.collect{|diff| diff.diff}.join(\"\\n\")\n end\n end",
"def diff_unified(text_old, text_new, label=\"--- old\\n+++ new\\n\", context=3)\n tmp_old = \"_tmp.old.#{rand()}\"\n tmp_new = \"_tmp.new.#{rand()}\"\n File.open(tmp_old, 'w') {|f| f.write(text_old) }\n File.open(tmp_new, 'w') {|f| f.write(text_new) }\n begin\n #diff = `diff -u #{tmp_old} #{tmp_new}`\n diff = `diff --unified=#{context} #{tmp_old} #{tmp_new}`\n ensure\n File.unlink(tmp_old)\n File.unlink(tmp_new)\n end\n diff.sub!(/\\A\\-\\-\\-.*\\n\\+\\+\\+.*\\n/, label.to_s)\n return diff\n end",
"def make_diffs\n # get array of all works belonging to project except self\n neighbors = []\n self.project.works.all.each do |work|\n neighbors.push(work.id)\n end\n # remove current work.id so have the *other* neighbors\n neighbors.delete(self.id)\n neighbors.each do |neighbor| # neighbor => work id\n generate_diff(neighbor, self.id)\n end\n end",
"def deep_diff(a, b)\n (a.keys | b.keys).inject({}) do |diff, k|\n if a[k] != b[k]\n if a[k].is_a?(Hash) && b[k].is_a?(Hash)\n diff[k] = deep_diff(a[k], b[k])\n else\n diff[k] = [a[k], b[k]]\n end\n end\n diff\n end\n end",
"def diff\n @diff ||= instance.client.createDiffHTML(padID: pad.id, startRev: start_rev, endRev: end_rev)\n end",
"def test_git_diff_to_a\n work_tree = Dir.mktmpdir\n begin\n Dir.chdir(work_tree) do\n `git init`\n `git commit --allow-empty -m 'init'`\n `git worktree add --quiet child`\n Dir.chdir('child') do\n result = Git.open('.').diff.to_a\n assert_equal([], result)\n end\n end\n ensure\n FileUtils.rm_rf(work_tree)\n end\n end",
"def unified_diff(text_old, text_new, label=\"--- old\\n+++ new\\n\", context=3)\n msg = \"\\\\ No newline at end of string\"\n lines_old = _text2lines(text_old, msg)\n lines_new = _text2lines(text_new, msg)\n #\n buf = \"#{label}\"\n len = 0\n prevhunk = hunk = nil\n diffs = Diff::LCS.diff(lines_old, lines_new)\n diffs.each do |diff|\n hunk = Diff::LCS::Hunk.new(lines_old, lines_new, diff, context, len)\n if hunk.overlaps?(prevhunk)\n hunk.unshift(prevhunk)\n else\n buf << prevhunk.diff(:unified) << \"\\n\"\n end if prevhunk\n len = hunk.file_length_difference\n prevhunk = hunk\n end\n buf << prevhunk.diff(:unified) << \"\\n\" if prevhunk\n return buf\n end",
"def create_difference_file(diffgraph1, diffgraph2, filename)\n log.info \"[*] Adding additions to difference file\"\n FileUtils.touch(filename)\n triple_output_to_file(diffgraph1, filename, \"+\")\n log.info \"[*] Adding removals to difference file\"\n triple_output_to_file(diffgraph2, filename, \"-\")\n log.info \"[*] Difference file created\"\nend",
"def diff(objectish = 'HEAD', obj2 = nil)\n Git::Diff.new(self, objectish, obj2)\n end",
"def changes(start_ref, end_ref)\n check_refs(start_ref, end_ref)\n s = Mixlib::ShellOut.new(\n \"#{@bin} diff -r #{start_ref}:#{end_ref} --summarize #{@repo_path}\")\n s.run_command.error!\n @logger.info(\"Diff between #{start_ref} and #{end_ref}\")\n s.stdout.lines.map do |line|\n m = line.match(/^(\\w)\\w?\\s+(\\S+)$/)\n fail \"Could not parse line: #{line}\" unless m\n\n {\n :status => m[1] == 'D' ? :deleted : :modified,\n :path => m[2].sub(\"#{@repo_path}/\", '')\n }\n end\n end",
"def diff(&block); end",
"def show_diff\n dir = \"/home/deploy/ci_logs_full/\"\n\n result = TestResult.where(:id => params[:id1]).first\n tool_name = Tool.where(:id => result.tool_id).first.name\n target_dir = \"#{dir}#{tool_name}-#{result.date}-#{result.benchmark}/\"\n target = \"#{target_dir}#{result.benchmark}.#{result.date}.#{tool_name}.log\"\n\n target1 = File.read(target).split(\"\\n\")\n @tname_1 = \"#{tool_name}.#{result.benchmark}.#{result.date}\"\n\n result = TestResult.where(:id => params[:id2]).first\n tool_name = Tool.where(:id => result.tool_id).first.name\n target_dir = \"#{dir}#{tool_name}-#{result.date}-#{result.benchmark}/\"\n target = \"#{target_dir}#{result.benchmark}.#{result.date}.#{tool_name}.log\"\n\n target2 = File.read(target).split(\"\\n\")\n @tname_2 = \"#{tool_name}.#{result.benchmark}.#{result.date}\"\n\n\n if target1.length != target2.length\n @error = true\n else\n @error = false\n end\n\n @list = []\n @rlist1 = []\n @rlist2 = []\n\n level = params[:level].to_i\n target1.each_with_index do |value, index|\n if index <= 3\n next\n end\n result1_s = target1[index].split(\", \")\n result2_s = target2[index].split(\", \")\n\n if result1_s[2] != result2_s[2]\n if level == 0\n if result1_s[2].include? \"sat\" and result2_s[2].include? \"sat\" \n @list.append(result1_s[0])\n @rlist1.append(result1_s[2])\n @rlist2.append(result2_s[2])\n end\n elsif level == 1\n if result1_s[2].include? \"timeout\" or result2_s[2].include? \"timeout\" \n @list.append(result1_s[0])\n @rlist1.append(result1_s[2])\n @rlist2.append(result2_s[2])\n end\n else\n @list.append(result1_s[0])\n @rlist1.append(result1_s[2])\n @rlist2.append(result2_s[2])\n end\n end\n end\n\n @display_types = DisplayType.all\n end",
"def display_diff(version1, version2)\n version1_text = render_wiki_content(:content => version1)\n version2_text = render_wiki_content(:content => version2)\n diff(version1_text, version2_text)\n end",
"def diff(opts)\n from, to = opts[:from], opts[:to]\n if from && !(Commit === from)\n raise ArgumentError, \"Invalid sha: #{from}\" if from !~ SHA_PATTERN\n from = Reference.new(:repository => self, :id => from)\n end\n if !(Commit === to)\n raise ArgumentError, \"Invalid sha: #{to}\" if to !~ SHA_PATTERN\n to = Reference.new(:repository => self, :id => to)\n end\n Diff.new(from, to, git_diff_tree('--root', '--full-index', '-u',\n opts[:detect_renames] ? '-M' : nil,\n opts[:detect_copies] ? '-C' : nil,\n from ? from.id : nil, to.id, '--', *opts[:path]))\n end",
"def diff(seq1, seq2, callbacks = nil, &block) # :yields diff changes:\n diff_traversal(:diff, seq1, seq2, callbacks || Diff::LCS::DiffCallbacks,\n &block)\n end",
"def diff_from_parent(options = {})\n @repository.gitaly_commit_client.diff_from_parent(self, options)\n end",
"def diff=(o); end",
"def tree\n h.updated_tree || h.original_tree\n end",
"def get_file_delta(file1, file2)\n diff_filename = calculate_diff_filename(file1, file2)\n\n # if the file already exists we can just return it immediatly\n if File.exist? diff_filename\n log.info 'File already calculated'\n return diff_filename\n end\n\n # load the files in to graphs\n clear_graph GRAPH_A\n clear_graph GRAPH_B\n read_file_into_graph(file1, GRAPH_A)\n read_file_into_graph(file2, GRAPH_B)\n\n # loading the differences\n clear_graph DIFF_GRAPH_A\n clear_graph DIFF_GRAPH_B\n calculate_graph_diffs(GRAPH_A, GRAPH_B, DIFF_GRAPH_A)\n calculate_graph_diffs(GRAPH_B, GRAPH_A, DIFF_GRAPH_B)\n\n create_difference_file(DIFF_GRAPH_A, DIFF_GRAPH_B, diff_filename)\n\n log.info \"[*] written to file: #{diff_filename}\"\n return diff_filename\nend",
"def diff(from, to=nil)\n scm :diff, repository, authentication, \"-r#{from}:#{to || head}\"\n end",
"def tree\n\n h.updated_tree || h.original_tree\n end",
"def diff(root, compared, structure = [])\n root.each_key do |key|\n next_root = root[key]\n next_compared = compared.nil? ? nil : compared[key]\n new_structure = structure.dup << key\n puts \"#{new_structure.join(\".\")}\" if compared.nil? || compared[key].nil?\n diff(next_root, next_compared, new_structure) if next_root.kind_of? Hash\n end\nend",
"def snapshot\n ls_tree(tree).map do |path|\n { \n path: path,\n status: deltas_to_hash[path] ? \n deltas_to_hash[path][:status] :\n :context\n }\n end\n end",
"def difference\n end",
"def diff(other)\n if engine != other.engine && @input_engine\n [:engine, engine, other.engine]\n elsif !version || !matches?(version, other.version)\n [:version, version, other.version]\n elsif @input_engine && !matches?(engine_version, other.engine_version)\n [:engine_version, engine_version, other.engine_version]\n elsif patchlevel && (!patchlevel.is_a?(String) || !other.patchlevel.is_a?(String) || !matches?(patchlevel, other.patchlevel))\n [:patchlevel, patchlevel, other.patchlevel]\n end\n end",
"def initialize(diff)\n @diff = diff\n @curr_changed_file = nil\n @prev_changed_file = nil\n @changed_lines = []\n @files_and_lines = {}\n build\n end",
"def diff\n deprecation_notice!\n downstream = @cisauraus.downstreams(app, 1).first\n verify_downstream! downstream\n\n print_and_flush \"Comparing #{app} to #{downstream}...\"\n\n diff = @cisauraus.diff(app)\n print_and_flush \"done, \"\n\n if diff.size > 0\n display \"#{app} ahead by #{diff.size} #{plural('commit', diff.size)}:\"\n diff.each do |commit|\n commit_detail = `git log -n 1 --pretty=format:\" %h %ad %s (%an)\" --date=short #{commit} 2>/dev/null`\n if $?.exitstatus == 0\n display commit_detail\n else\n display \" #{commit}\"\n end\n end\n else\n display \"everything is up to date\"\n end\n end",
"def diffs \n @diffs ||= begin\n diff = `svn diff`.split(\"\\n\").map {|l| l.chomp}\n _diffs = {}\n in_diff = false\n in_path = false\n path = nil\n diff.each do |line|\n if /Index:/ =~ line \n path = /Index: (.*)/.match(line)[1]\n _diffs[path] = ' '\n in_path = true\n in_diff = false\n next\n end\n\n if in_path and !in_diff and /^@@/ =~ line\n in_diff = true\n next\n end\n\n if in_diff and in_path\n if /^\\+/ =~ line\n _diffs[path] += '+'\n elsif /^-/ =~ line\n _diffs[path] = _diffs[path] + '-'\n end\n end\n end\n _diffs.map do |k, v| \n _diffs[k] = v.split('').map do |chr| \n { '+' => \"#{COLOR_GREEN}+\", \n '-' => \"#{COLOR_RED}-\"}[chr]\n end.join() + \"#{COLOR_NONE}\"\n end\n _diffs\n end\n end",
"def deepDiff(other)\n (keys + other.keys).uniq.each_with_object({}) do |key, diff|\n selfKey = self[key]\n otherKey = other[key]\n next if selfKey == otherKey\n if selfKey.respond_to?(:deepDiff) && otherKey.respond_to?(:deepDiff)\n diff[key] = selfKey.deepDiff(otherKey)\n else\n diff[key] = [selfKey, otherKey]\n end\n diff\n end\n end",
"def diff(from, to=nil)\n scm :diff, repository, authentication, \"-r#{from}:#{to || head}\"\n end",
"def snapshot_diff(left:, right:)\n r = aptly_request('GET', \"api/snapshots/#{left}/diff/#{right}\")\n r.body\n end",
"def do_diff(base_path, path)\n if base_path.nil?\n # If there's no base path, then the file\n # must have been added\n puts(\"Added: #{path}\")\n name = path\n elsif path.nil?\n # If there's no new path, then the file\n # must have been deleted\n puts(\"Removed: #{base_path}\")\n name = base_path\n else\n # Otherwise, the file must have been modified\n puts \"Modified: #{path}\"\n name = path\n end\n\n # Set up labels for the two files\n base_label = \"#{name} (original)\"\n label = \"#{name} (new)\"\n\n # Output a unified diff between the two files\n puts \"=\" * 78\n differ = Svn::Fs::FileDiff.new(@base_root, base_path, @root, path)\n puts differ.unified(base_label, label)\n puts\n end",
"def diff\n element_name = happy_path? ? @processor.kind.output_name : @processor.kind.error_name\n html_diff(\n @ciat_file.element(element_name).as_file,\n @ciat_file.element(element_name, :generated).as_file, \n @ciat_file.element(element_name, :diff).as_file)\n end",
"def diff(other)\n\t\tif other.is_a? Hash\n\t\t\treturn int_diff(other)\n\t\tend\n\t\t\n\t\tif other.is_a? RHash\n\t\t\treturn int_diff(other)\n\t\tend\t\n\tend",
"def diffed(old, new)\n differ = Differ.diff_by_line(new, old)\n differ.to_s[/\\{[^}]+\\}/][1...-1].gsub(/\\s{2,}/, '')\n end",
"def diff(other_sha1)\n git \"diff #{other_sha1} -- #{@path}\"\n end",
"def diff(from, to=nil)\n from << \"..#{to}\" if to\n scm :diff, from\n end",
"def diff_hash\n {\n diff: diff_hunk,\n new_path: file_path,\n old_path: file_path,\n\n # These fields are not displayed for LegacyDiffNote notes, so it\n # doesn't really matter what we set them to.\n a_mode: '100644',\n b_mode: '100644',\n new_file: false\n }\n end",
"def current_diff(a_hash, another_hash)\n\n relevant_diffs = a_hash.diff(another_hash)\n @ignored_files = [\"metadata.json\", \".gitignore\"]\n @ignored_files.each do |file|\n relevant_diffs.delete(file)\n end\n relevant_diffs\n\n end",
"def reload_diffs\n new_attributes = {}\n new_diffs = []\n\n if commits.size.zero?\n new_attributes[:state] = :empty\n else\n diff_collection = unmerged_diffs\n\n if diff_collection.overflow?\n # Set our state to 'overflow' to make the #empty? and #collected?\n # methods (generated by StateMachine) return false.\n new_attributes[:state] = :overflow\n end\n\n new_attributes[:real_size] = diff_collection.real_size\n\n if diff_collection.any?\n new_diffs = dump_diffs(diff_collection)\n new_attributes[:state] = :collected\n end\n end\n\n new_attributes[:st_diffs] = new_diffs\n\n new_attributes[:start_commit_sha] = self.target_branch_sha\n new_attributes[:head_commit_sha] = self.source_branch_sha\n new_attributes[:base_commit_sha] = branch_base_sha\n\n update_columns_serialized(new_attributes)\n\n keep_around_commits\n end",
"def diffyable\n # add appropriate diff column data for diff.right and diff.left and update other attrs to the Diffy way®\n\n w1id = self.work1\n w2id = self.work2\n w1work = Work.find(w1id)\n w2work = Work.find(w2id)\n w1md = w1work.file_content_md\n w2md = w2work.file_content_md\n w1txt = w1work.file_content_text\n w2txt = w2work.file_content_text\n\n html = Diffy::Diff.new(w1md, w2md).to_s(:html)\n md = Diffy::Diff.new(w1md, w2md).to_s\n text = Diffy::Diff.new(w1txt, w2txt).to_s\n \n lucy = Diffy::SplitDiff.new(w1md, w2md, :format => :html).left\n recha = Diffy::SplitDiff.new(w1md, w2md, :format => :html).right\n\n html.force_encoding(\"UTF-8\").scrub!\n md.force_encoding(\"UTF-8\").scrub!\n text.force_encoding(\"UTF-8\").scrub!\n\n lucy.force_encoding(\"UTF-8\").scrub!\n recha.force_encoding(\"UTF-8\").scrub!\n\n self.update_attributes(left: lucy, right: recha, diff_md: md, diff_html: html, diff_text: text)\n self.save\n end",
"def differences\n @attributes[:differences]\n end",
"def diff(other_variable, options={})\n Differences::Entry.compute(self, other_variable, diff_criteria(options), options)\n end",
"def diff\n return if diffs.empty?\n\n minimized_hunk.diff(:unified) + NEWLINE\n end",
"def evaluateDiffResult()\n\n end",
"def diff(other)\n HQMF::Measure::LogicExtractor.get_measure_logic_diff(self,other,true)\n end",
"def status(full=false)\n a = commit_tree.flatten\n b = tree.flatten\n \n diff = {}\n (a.keys | b.keys).collect do |key|\n a_entry = a.has_key?(key) ? a[key] : nil\n b_entry = b.has_key?(key) ? b[key] : nil\n \n change = case\n when a_entry && b_entry\n next unless a_entry != b_entry\n :mod\n when a_entry\n :rm\n when b_entry\n :add\n end\n \n diff[key] = full ? [change, a_entry || [], b_entry || []] : change\n end\n diff\n end",
"def return_resource_diffs(r1, r2)\n only_in_old = []\n (r2 - r1).each do |r|\n only_in_old << r.to_s\n end\n only_in_new = []\n (r1 - r2).each do |r|\n only_in_new << r.to_s\n end\n differences = {\n titles_only_in_old: only_in_old,\n titles_only_in_new: only_in_new\n }\n differences\n end",
"def reconcile_deltas(new_version, new_deltas, old_deltas)\n old_deltas ||= []\n new_version = new_version.to_s\n\n now = DateTime.now.to_s(:db)\n\n new_deltas.map do |delta|\n { \"text\" => delta[\"text\"], \n \"authorId\" => delta[\"attributes\"][\"authorId\"] \n }.tap do |new_delta|\n\n # Try to find new in old.\n found_index = old_deltas.find_index do |old_delta|\n authors_are_same = old_delta[\"authorId\"] == new_delta[\"authorId\"]\n old_text_begins_with_new_text = old_delta[\"text\"].index(new_delta[\"text\"])\n authors_are_same && old_text_begins_with_new_text\n end\n\n if found_index\n found = old_deltas[found_index]\n #old_deltas = old_deltas.drop(found_index + 1)\n\n # Set timestamp/version to old.\n new_delta[\"version\"] = found[\"version\"]\n new_delta[\"updated_at\"] = found[\"updated_at\"]\n else\n # Use current version.\n new_delta[\"version\"] = new_version\n new_delta[\"updated_at\"] = now\n end\n end\n end\n end",
"def print_puppetfile_diff(old, new)\n # Build hashes mapping the module name to the module object. This makes it\n # a little easier to determine which modules have been added, removed, or\n # modified.\n old = (old&.modules || []).each_with_object({}) do |mod, acc|\n next unless mod.type == :forge\n acc[mod.full_name] = mod\n end\n\n new = new.modules.each_with_object({}) do |mod, acc|\n next unless mod.type == :forge\n acc[mod.full_name] = mod\n end\n\n # New modules are those present in new but not in old.\n added = new.reject { |full_name, _mod| old.include?(full_name) }.values\n\n if added.any?\n diff = \"Adding the following modules:\\n\"\n added.each { |mod| diff += \"#{mod.full_name} #{mod.version}\\n\" }\n @outputter.print_action_step(diff)\n end\n\n # Upgraded modules are those that have a newer version in new than old.\n upgraded = new.select do |full_name, mod|\n if old.include?(full_name)\n mod.version > old[full_name].version\n end\n end.keys\n\n if upgraded.any?\n diff = \"Upgrading the following modules:\\n\"\n upgraded.each { |full_name| diff += \"#{full_name} #{old[full_name].version} to #{new[full_name].version}\\n\" }\n @outputter.print_action_step(diff)\n end\n\n # Downgraded modules are those that have an older version in new than old.\n downgraded = new.select do |full_name, mod|\n if old.include?(full_name)\n mod.version < old[full_name].version\n end\n end.keys\n\n if downgraded.any?\n diff = \"Downgrading the following modules: \\n\"\n downgraded.each { |full_name| diff += \"#{full_name} #{old[full_name].version} to #{new[full_name].version}\\n\" }\n @outputter.print_action_step(diff)\n end\n\n # Removed modules are those present in old but not in new.\n removed = old.reject { |full_name, _mod| new.include?(full_name) }.values\n\n if removed.any?\n diff = \"Removing the following modules:\\n\"\n removed.each { |mod| diff += \"#{mod.full_name} #{mod.version}\\n\" }\n @outputter.print_action_step(diff)\n end\n end",
"def diff(nocolor: false)\n xml = Nokogiri::XML(File.open(@path), &:noblanks)\n ideal = xml.to_xml(indent: 2)\n now = File.read(@path)\n differ(ideal, now, nocolor: nocolor)\n end",
"def getDiff(tag1, tag2, timestamps, unique)\n format = timestamps ? \"%ci %s\" : \"%s\"\n uniqpipe = unique ? \"| uniq \" + (timestamps ? \"-s 25\" : \"\") : \"\"\n return Hash[`git log --pretty=\"#{format}\" #{tag1}...#{tag2} #{uniqpipe}`\n .split(\"\\n\")\n .map { |msg|\n ticket = msg.match(/DATA-(\\d+)/)\n if ticket != nil\n if msg.match(/Merge (branch|pull request) .* (into|from)/) == nil\n # Not a merge commit, so include it\n submatch = msg.match(/\\[?(#{PREFIX}-\\d+)\\]?[\\-|_| ]?(.*)/)\n if submatch != nil\n if submatch.captures[1].length > 0\n [submatch.captures[0], submatch.captures[1]]\n end\n else\n [ticket[0], msg]\n end\n end\n end\n }\n .reject { |e| e == nil }\n .group_by(&:first)\n .map { |k, a|\n [k, a.map(&:last).uniq]\n }]\nend",
"def differ\n @differ ||= Differ.new(externals)\n end",
"def assert_nodes_are_equal(a, b)\n assert_equal a.id, b.id, \"node IDs\"\n assert_equal a.latitude, b.latitude, \"latitude on node #{a.id}\"\n assert_equal a.longitude, b.longitude, \"longitude on node #{a.id}\"\n assert_equal a.changeset_id, b.changeset_id, \"changeset ID on node #{a.id}\"\n assert_equal a.visible, b.visible, \"visible on node #{a.id}\"\n assert_equal a.version, b.version, \"version on node #{a.id}\"\n assert_equal a.tags, b.tags, \"tags on node #{a.id}\"\n end",
"def diff\n require \"tempfile\"\n new_file = Tempfile.new([\"new_config.\", \".yml\"])\n new_file.write(sorted_file)\n result = `git diff --no-index -- #{file} #{new_file.path}`.gsub(\n no_slash_beginning(new_file.path),\n no_slash_beginning(file)\n )\n ensure\n new_file.close\n new_file.unlink\n result\n end",
"def assert_nodes_are_equal(a, b)\n assert_equal a.id, b.id, \"node IDs\"\n assert_equal a.latitude, b.latitude, \"latitude on node #{a.id}\"\n assert_equal a.longitude, b.longitude, \"longitude on node #{a.id}\"\n assert_equal a.changeset_id, b.changeset_id, \"changeset ID on node #{a.id}\"\n assert_equal a.visible, b.visible, \"visible on node #{a.id}\"\n assert_equal a.version, b.version, \"version on node #{a.id}\"\n assert_equal a.tags, b.tags, \"tags on node #{a.id}\"\n end",
"def parse_diff\n # If there is a file, do some initialisation\n file_obj = File.new(@diff_filename, \"r\")\n temp_a = temp_r = nil \n \n # Then for each line found on the diff file\n # Do some bucket-ing between added and removed\n file_obj.each do |line|\n \n line = line.chomp!\n if line.match $regexes[:diff_info]\n # We are doing this 'diff' block-by-block \n # As initially it is planned to cross-reference the added/removed right per block \n # as it is easier and cheaper. Well, this structure is retained if we decided to have \n # 'extra' action when we finish with a 'diff' block\n # Pushing the temporary 'lines' back to where it should belong\n @added_lines.concat temp_a unless temp_a == nil\n @removed_lines.concat temp_r unless temp_r == nil\n \n # reset the temporary variable\n temp_a = []\n temp_r = []\n end #End if line.match $regexes[:diff_info]\n \n processed_line = \"\"\n if line.start_with? \">\", \"<\"\n sign = line.slice!(0).chr\n processed_line = line.strip.chomp\n \n # Get me out of here, comment is useless for this.\n next unless !processed_line.start_with? \"#\" \n \n if sign == \">\"\n # Should be put under added temporarily\n temp_a.push processed_line\n elsif sign == \"<\"\n # Should be put under removed temporarily\n temp_r.push processed_line\n end\n end #End if line.start_with? \">\", \"<\"\n end #End for-each\n end",
"def changes\n ViewModel::Changes.new(\n new: new_model?,\n changed_attributes: changed_attributes,\n changed_associations: changed_associations,\n changed_nested_children: changed_nested_children?,\n changed_referenced_children: changed_referenced_children?,\n )\n end",
"def historic_diff\n # get the two versions to diff\n @new_measure = Measure.by_user(current_user).where({:_id => params[:new_id]}).first\n unless @new_measure\n @new_measure = ArchivedMeasure.where({:measure_db_id => params[:new_id]}).first.to_measure\n end\n\n @old_measure = Measure.by_user(current_user).where({:_id => params[:old_id]}).first\n unless @old_measure\n @old_measure = ArchivedMeasure.where({:measure_db_id => params[:old_id]}).first.to_measure\n end\n\n results = {}\n results['diff'] = []\n results['pre_upload'] = { \n 'cms_id' => @old_measure.cms_id,\n 'updateTime' => (@old_measure.updated_at.tv_sec * 1000),\n 'hqmf_id' => @old_measure.hqmf_id,\n 'hqmf_version_number' => @old_measure.hqmf_version_number }\n results['post_upload'] = { \n 'cms_id' => @new_measure.cms_id,\n 'updateTime' => (@new_measure.updated_at.tv_sec * 1000),\n 'hqmf_id' => @new_measure.hqmf_id,\n 'hqmf_version_number' => @new_measure.hqmf_version_number }\n\n measure_logic_names = HQMF::Measure::LogicExtractor::POPULATION_MAP.clone\n measure_logic_names['VARIABLES'] = 'Variables'\n\n # Walk through the population sets and populations for the measure and create a\n # diffy for each populationm.\n @new_measure.populations.each_with_index do |new_population_set, population_set_index|\n old_population_set = @old_measure.populations[population_set_index]\n population_diff = []\n\n # For each population within the population set, get the population logic and\n # perform the diffy\n measure_logic_names.each_pair do |population_code, population_title|\n # if the code is for VARIABLE, leave it. If it's IPP, etc., then access the actual code name from the\n # population set (e.g. IPP_1).\n code = (population_code == 'VARIABLES') ? 'VARIABLES' : new_population_set[population_code]\n new_logic = @new_measure.measure_logic.find { |logic| logic['code'] == code }\n old_logic = @old_measure.measure_logic.find { |logic| logic['code'] == code }\n\n # skip if both are non existent\n next if !new_logic && !old_logic\n \n # Remove the first line of the measure logic, which is the the name of the population.\n old_logic_text = old_logic ? old_logic['lines'][1..-1].join() : \"\"\n new_logic_text = new_logic ? new_logic['lines'][1..-1].join() : \"\"\n\n logic_diff = Diffy::SplitDiff.new(old_logic_text, new_logic_text,\n format: :html, include_plus_and_minus_in_html: true, allow_empty_diff: false)\n\n population_diff << {code: population_code, title: population_title, pre_upload: logic_diff.left, post_upload: logic_diff.right}\n end\n\n results['diff'] << population_diff\n end\n\n render :json => results\n end",
"def local_diff\n `cd #{@local_path} && git diff HEAD`\n end",
"def hash_diff(old_hash, new_hash, path)\n (new_hash.dig(*path).to_a - old_hash.dig(*path).to_a).to_h\nend",
"def difference(rt1, rt2)\n return template_tags(rt1) - template_tags(rt2)\n end",
"def check_tree\n @trees = {}\n @blobs = {}\n \n data = @base.lib.ls_tree(@objectish)\n\n data['tree'].each do |key, tree| \n @trees[key] = Git::Object::Tree.new(@base, tree[:sha], tree[:mode]) \n end\n \n data['blob'].each do |key, blob| \n @blobs[key] = Git::Object::Blob.new(@base, blob[:sha], blob[:mode]) \n end\n\n {\n :trees => @trees,\n :blobs => @blobs\n }\n end",
"def create\n @diff = Diff.new(diff_params)\n\n respond_to do |format|\n if @diff.save\n format.html { redirect_to @diff, notice: 'Diff was successfully created.' }\n format.json { render :show, status: :created, location: @diff }\n else\n format.html { render :new }\n format.json { render json: @diff.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @diff = Diff.new(diff_params)\n\n respond_to do |format|\n if @diff.save\n format.html { redirect_to @diff, notice: 'Diff was successfully created.' }\n format.json { render :show, status: :created, location: @diff }\n else\n format.html { render :new }\n format.json { render json: @diff.errors, status: :unprocessable_entity }\n end\n end\n end",
"def delta\n deltas = self.class.delta_documents(@parsed)\n self.class.friendly_deltas(deltas, @parsed)\n end",
"def make_my_diffs_pretty!; end",
"def getDiff ( x , y )\n\tdiff = x - y\n\treturn diff\nend",
"def delta_structure\n DeltaStructure.new map, @new_creatures, @new_spawners, @new_quests, @knowledge_base, @new_pool, file_key, requests\n end",
"def test_ut_diff_result_02\n original_file = OriginalFile.new(\n :source_name => \"simple 1\",\n :path => \"http\",\n :normal_result_id => 349898,\n :hirisk_result_id => 4564,\n :critical_result_id => 45 )\n assert_equal(\"simple 1\",original_file.source_name)\n assert_equal(349898,original_file.normal_result_id)\n assert_equal(4564,original_file.hirisk_result_id)\n assert_equal(45,original_file.critical_result_id)\n assert_equal(\"http\",original_file.path)\n end",
"def report_with_ast_diff\n strip(<<-MESSAGE)\n #{ast_diff}\n Original-Source:\\n#{original_source}\n Original-AST:\\n#{original_ast.inspect}\n Generated-Source:\\n#{generated.source}\n Generated-AST:\\n#{generated_ast.inspect}\n MESSAGE\n end",
"def == other_tree\n one = []\n two = []\n each { |node| one << node }\n other_tree.each { |node| two << node }\n one == two\n end",
"def diff_lines(seq1, seq2, from_file, to_file, \n from_mtime, to_mtime, context=3)\n sdiff = Diff::LCS.sdiff(seq1, seq2)\n # PP.pp sdiff\n # puts '-' * 40\n started = false\n result = []\n i = 0\n n = -(context+1)\n while true do\n i = find_next(sdiff, i)\n break if i >= sdiff.size\n if n < i-context\n if started\n result << '***************'\n else\n result << \"*** #{from_file}\\t#{from_mtime}\"\n result << \"--- #{to_file}\\t#{to_mtime}\"\n started = true\n end\n result << '*** %d,%d ****' % find_pos(sdiff, i)\n context.downto(1) do |j|\n result << ' ' + sdiff[i-j].new_element.chomp\n end\n end\n i += 1\n while i < sdiff.size && (action = sdiff[i-1].action) != '='\n element = \n if action == '+' \n sdiff[i-1].new_element\n else\n sdiff[i-1].old_element\n end\n result << action + element.chomp\n i += 1\n end\n -1.upto(context-2) do |j|\n n = i+j\n break if sdiff[n].action != '='\n result << ' ' + sdiff[n].new_element.chomp\n end\n end\n return result\n end",
"def diff_index(treeish)\n hsh = {}\n @base.git.diff_index({}, treeish).split(\"\\n\").each do |line|\n (info, file) = line.split(\"\\t\")\n (mode_src, mode_dest, sha_src, sha_dest, status) = info.split\n hsh[file] = {:path => file, :mode_repo => mode_src.to_s[1, 7], :mode_index => mode_dest, \n :sha_repo => sha_src, :sha_index => sha_dest, :status => status}\n end\n hsh\n end",
"def diff_index(treeish)\n hsh = {}\n @base.git.diff_index({}, treeish).split(\"\\n\").each do |line|\n (info, file) = line.split(\"\\t\")\n (mode_src, mode_dest, sha_src, sha_dest, type) = info.split\n hsh[file] = {:path => file, :mode_repo => mode_src.to_s[1, 7], :mode_index => mode_dest,\n :sha_repo => sha_src, :sha_index => sha_dest, :type => type}\n end\n hsh\n end",
"def est_dep_tree(ord_cond_diffs, opts={})\r\n deps_list = []\r\n connected_node_lists = []\r\n deps_edge_list = []\r\n\r\n ord_cond_diffs.each do |diff|\r\n if deps_edge_list.include?(diff[:pair].reverse) || deps_edge_list.include?(diff[:pair])\r\n next\r\n elsif (connected_node_lists.select {|x| (x & diff[:pair]).size == 2}).any?\r\n next\r\n else\r\n deps_edge_list << diff[:pair]\r\n join_lists = []\r\n connected_node_lists.each_with_index do |node_list, index|\r\n if (node_list & diff[:pair]).size > 0\r\n join_lists << index\r\n end\r\n end\r\n if join_lists.size == 2\r\n connected_node_lists[join_lists[0]] = connected_node_lists[join_lists[0]] | connected_node_lists[join_lists[1]]\r\n connected_node_lists.delete_at(join_lists[1])\r\n elsif join_lists.size == 1\r\n connected_node_lists[join_lists[0]] = connected_node_lists[join_lists[0]] | diff[:pair]\r\n elsif join_lists.size == 0\r\n connected_node_lists << diff[:pair]\r\n else\r\n puts \"This should not happen\"\r\n byebug\r\n end\r\n end\r\n end\r\n\r\n # initialize nodes\r\n @feature_list.each do |feature|\r\n deps_list << Node.new(feature, nil)\r\n end\r\n\r\n # set parents\r\n root = if opts[:diff_matrix]\r\n est_dep_root(opts[:diff_matrix])\r\n else\r\n 0\r\n end\r\n connect_tree_rec(deps_list[root], deps_edge_list, deps_list)\r\n\r\n DependenceTree.new(deps_list)\r\n end",
"def diff(x=v1.length - 1, y=v2.length - 1)\n return [] if x < 0 && y < 0\n return diff(x-1, y) << Display.deleted(v1[x]) if y < 0\n return diff(x, y-1) << Display.added(v2[y]) if x < 0\n if v1[x] == v2[y]\n diff(x-1, y-1) << v1[x]\n elsif lcs[[x-1, y]] >= lcs[[x, y-1]]\n diff(x-1, y) << Display.deleted(v1[x])\n else\n diff(x, y-1) << Display.added(v2[y]) \n end\n end"
] |
[
"0.6711389",
"0.6629702",
"0.63976043",
"0.6205352",
"0.6175841",
"0.61481845",
"0.60910344",
"0.59595007",
"0.59220314",
"0.5914852",
"0.5860484",
"0.5846582",
"0.58203024",
"0.5816054",
"0.5815961",
"0.5809467",
"0.57994175",
"0.5772613",
"0.57670355",
"0.57664347",
"0.57486403",
"0.5708598",
"0.5700056",
"0.56978697",
"0.56697136",
"0.56629026",
"0.56464404",
"0.5640073",
"0.56339824",
"0.5628372",
"0.5597396",
"0.559258",
"0.55900854",
"0.5586182",
"0.5578268",
"0.55726236",
"0.5556056",
"0.5548968",
"0.5538459",
"0.5526042",
"0.55180085",
"0.5509883",
"0.54809093",
"0.5479784",
"0.5477323",
"0.5474867",
"0.5467009",
"0.54549646",
"0.54438734",
"0.5432417",
"0.5419936",
"0.5418849",
"0.54030216",
"0.53930795",
"0.53904855",
"0.5383108",
"0.5376791",
"0.53684896",
"0.5340494",
"0.53287756",
"0.5315548",
"0.5313387",
"0.53090173",
"0.5308022",
"0.5286453",
"0.52506655",
"0.5243644",
"0.5235881",
"0.52061844",
"0.5206032",
"0.5198933",
"0.51815933",
"0.5165323",
"0.5158631",
"0.51533663",
"0.51527876",
"0.5147875",
"0.5144177",
"0.51380026",
"0.5118438",
"0.51099443",
"0.51006097",
"0.50957996",
"0.5093994",
"0.5093693",
"0.5091025",
"0.5085938",
"0.5080844",
"0.5080844",
"0.50744027",
"0.50695497",
"0.5067125",
"0.50657594",
"0.5062489",
"0.5058392",
"0.5056656",
"0.5055451",
"0.50504726",
"0.5047807",
"0.5043505",
"0.50427836"
] |
0.0
|
-1
|
Remove the next option and return it. Return nil when there are no more options.
|
def next_argument
if @remaining.empty?
return nil
else
return @remaining.shift
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def last_options!\n last_options.tap { @last_options = nil }\n end",
"def pop_solution\n return nil if @pb_list.empty?\n return nil if not @pb_list[0].complete?\n return @pb_list.shift\n end",
"def pop\n old = @tail\n if @tail == nil\n return nil\n else\n prev = @tail\n @tail = @tail.prev_value\n @length -= 1\n return prev.value\n end\n end",
"def remove_selected_option(option)\n if new_record?\n self.selected_options = build_selected_options\n else\n update_column(:selected_options, build_selected_options(vote_proposal_options - [option]))\n end\n end",
"def pop\n\t\tif (!@head) then return nil end\n\t\ttemp = @head\n\t\t@head = @head.get_next()\n\t\tif (@head) then @head.set_prev(nil)\n\t\telse @tail = nil\n\t\tend\n\t\t@size -= 1\n\t\treturn temp.get_item()\n\tend",
"def pop\n return nil if head.nil?\n\n curr = head\n if curr.next.nil?\n @head = nil\n return curr\n end\n curr = curr.next until curr.next.next.nil?\n last = curr.next\n curr.next = nil\n last.value\n end",
"def rm(key)\n options.values.collect do |option| \n if option.key == key \n unregister(option)\n else\n nil\n end\n end.compact\n end",
"def pop\n last_node = self.tail\n self.at(self.size - 2).next_node = nil\n return last_node\n end",
"def pop\n item = @first.val\n @first = @first.next\n @last = nil if(@first == nil)\n @size -= 1\n item\n end",
"def extract_options!\n if last.is_a?(Hash)\n pop\n else\n {}\n end\n end",
"def pop\n raise IndexError.new if @data.size == 0\n ret = @data[0]\n @data[0] = @data[@data.size - 1]\n @data = @data.take(@data.size - 1)\n percolate_down\n return ret\n end",
"def pop\n\t\treturn nil if @adaptee.empty?\n\t\t@adaptee.remove\n\t\t@auxiliar.first\n\t\t@auxiliar.shift\n\tend",
"def extract_options!\n last.is_a?(Hash) ? pop : {}\n end",
"def pop\n return nil if self.curr == 0\n val = self.arr[self.curr - 1]\n self.curr -= 1\n val\n end",
"def remove\n return @exact.shift unless @exact.empty?\n @list.shift\n end",
"def pop\n return nil if @head.nil?\n\n to_remove = @head\n @head = @head.next\n to_remove.next = nil\n @count -= 1\n\n to_remove.value\n end",
"def pop\n # return nil if @length == 0\n # Tim did a fancy private method.....\n if @tail.nil?\n old_tail = nil\n else\n old_tail = @tail.value\n if @tail.previous.nil?\n @tail = nil\n else\n new_tail = @tail.previous\n @tail = new_tail\n end\n @length -= 1\n end\n # @tail.previous = new_tail.previous \n return old_tail\n\n end",
"def pop\n last = size\n at(last - 2).next_node = nil\n end",
"def get_next\n while next_item = @queue.peek\n if next_item.cancelled?\n @queue.shift\n else\n return next_item\n end\n end\n\n return nil\n end",
"def remove_at(index)\n if index < 0 || index >= @size\n return nil\n end\n\n if index == @size - 1\n return pop\n else\n search_index = @head\n next_to_last = nil\n index.times {|i|\n if i == index - 1\n next_to_last = search_index\n end\n search_index = search_index.next_node\n }\n next_to_last.next_node = search_index.next_node\n end\n @size -= 1\n end",
"def pop()\n head = @head\n if head == nil then\n return nil\n end\n @head = head.prev\n return head.val\n end",
"def pop\n tmp = @data.value rescue nil\n @data = @data.next_node unless @data.nil?\n return tmp\n end",
"def pop\n return nil unless @tail\n value = @tail[:data].pop\n @tail = @tail[:forward] while @tail and @tail[:data].size == 0\n @set.delete(value)\n value\n end",
"def remove_last\n raise 'No such element' if @size == 0\n elt = @tail.value\n if @size == 1\n @head = nil\n @tail = nil\n else\n @tail = @tail.previous\n @tail.next.previous = nil\n @tail.next = nil\n end\n @size -= 1\n return elt\n end",
"def pop\n return nil if @count == 0\n\n # get the index of the las titem\n @store.store.reverse.each_with_index do |ele, i|\n if ele != nil \n @last_ele = capacity() - (i+1) \n break\n end\n end\n #val = @store.store.delete_at(@last_ele)\n val = @store.store[@last_ele]\n @store.store[@last_ele] = nil\n @count -= 1\n return val\n end",
"def pop\n return nil unless self.length > 0\n \n self.head = self.head.next\n self.tail = nil if self.length == 1\n self.length -= 1\n end",
"def remove_next prev_node\n\t\treturn nil unless self.length > 0\n\n unless prev_node\n # remove head.\n self.head = self.head.next\n else\n self.hash.delete(prev_node.next.data)\n if prev_node.next == prev_node\n self.head = nil\n else\n old = prev_node.next\n prev_node.next = prev_node.next&.next\n if (old == self.head)\n self.head = old.next\n end\n end\n end\n\n \tself.length -= 1\n\tend",
"def pop\n if @tail != nil\n ret = @tail\n @tail = @tail.previous\n if @tail != nil\n @tail.next_node = nil\n end\n @length -= 1\n if @head == ret\n @head = nil\n end\n return ret.value\n elsif @head\n ret = @head\n @head = nil\n @length -= 1\n return ret.value\n else\n return nil\n end\n end",
"def pop\n if @tail != nil\n ret = @tail\n @tail = @tail.previous\n if @tail != nil\n @tail.next_node = nil\n end\n @length -= 1\n if @head == ret\n @head = nil\n end\n return ret.value\n elsif @head\n ret = @head\n @head = nil\n @length -= 1\n return ret.value\n else\n return nil\n end\n end",
"def pop\n return nil if empty?\n @anchor.prev_node.delete\n end",
"def next\n\t\t# Use up all of the extras\n\t\treturn @extras.pop if !@extras.empty?\n\t\t# Then track the last freeid used (which should always be the max)\n\t\treturn (@last+=1)-1\n\tend",
"def remove_at(index)\n if index == 0\n @head = cur.next_node\n elsif index >= self.size\n pop\n else\n prev = nil\n cur = head\n i = 0\n until i == index\n prev = cur\n cur = cur.next_node\n i += 1\n end\n prev.next_node = cur.next_node\n end\n end",
"def unregister(option)\n @registry.delete(option)\n @options.delete_if {|key, value| option == value }\n option\n end",
"def remove_last_item_from_items_collected_at_desk\n $items_collected.delete($items_collected.last)\n# returns user to previous task of choosing item from desk\n desk_options\nend",
"def pop()\n @q.shift\n end",
"def delete_option(name)\n @options.delete(name)\n end",
"def extract_option!\n case args[0]\n when /\\A-[^-]./\n bump_key!(args[0].slice!(1))\n when /\\A-[^-]\\z/\n try_add_kv!(args[0][1])\n when /\\A--(.+?)=(.+)/\n add_key!(*Regexp.last_match.values_at(1, 2))\n args.shift\n when /\\A--./\n try_add_kv!(args[0][2..-1])\n when '--'\n args.shift\n self.options += args\n self.args = []\n else\n options << args.shift\n end\n end",
"def process(option)\n delete(option).tap do |value|\n yield value if value and block_given?\n end\n end",
"def pop\n return nil if size.zero?\n\n temp = first\n self.last = nil if first == last\n self.first = first.next\n self.size -= 1\n temp.val\n end",
"def select!\n return enum_for(:select!) if not block_given?\n each { |n| remove(n) if not yield n }\n self\n end",
"def pop_mode\n sub_modes.pop\n return nil\n end",
"def remove_next prev_node\n\t\treturn nil unless self.length > 0\n\n unless prev_node\n # remove head.\n self.head = self.head.next\n else\n if prev_node.next == prev_node\n self.head = nil\n else\n old = prev_node.next\n prev_node.next = prev_node.next&.next\n if (old == self.head)\n self.head = old.next\n end\n end\n end\n\n \tself.length -= 1\n\tend",
"def remove_at_tail\n\t\t\treturn nil if self.empty?\n\t\t\telement = self.head\n\t\t\tprevious_element = @head\n\n\t\t\tuntil element.next.nil?\n\t\t\t\tprevious_element = element\n\t\t\t\telement = element.next\n\t\t\tend\n\n\t\t\tprevious_element.next = nil\n\t\t\telement\n\t\tend",
"def options_plus_current(options, current_value = nil)\n if current_value.present? && options.map { |opt| opt.is_a?(Array) ? opt[-1] : opt }.exclude?(current_value)\n options.push current_value\n end\n\n options.uniq\n end",
"def remove_at_head\n\t\t\treturn nil if self.empty?\n\t\t\telement = self.head\n\t\t\t@head.next = nil || element.next\n\t\t\telement\n\t\tend",
"def ll_pop()\n current = @head\n \n if @num_nodes == 0\n return nil\n elsif @num_nodes == 1\n @head = nil\n @tail = nil\n else\n second = @head.get_Next()\n @head = second\n end\n \n @num_nodes -= 1\n return current.get_Data()\n end",
"def remove(index)\n\t\tdir = index > @length/2? -1: 1\n\t\tcurr = go(dir: dir, index: index)\n\t\tif !curr.nil?\n\t\t\tcurr.previous.next = curr.next if !curr.previous.nil?\n\t\t\tcurr.next.previous = curr.previous if !curr.next.nil?\n\t\t\t@tail = curr.previous if curr == @tail\n\t\t\t@head = curr.next if curr == @head\n\t\t\tcurr.previous, curr.next = nil, nil\n\t\t\t@length -= 1\n\t\tend\n\t\tcurr.info if !curr.nil?\n\tend",
"def remove(index)\n @size -= 1\n if index == 0\n @first_item = @first_item.next_list_item\n else\n previous_item = get_item( index -1)\n next_list_item = previous_item.next_list_item.next_list_item\n previous_item.next_list_item = next_list_item\n #get_item( index - 1).next_list_item = nil\n # return @first_item = @first_item.next_list_item if index == 0\n # item = @first_item\n # (index - 1).times do\n # item = item.next_list_item\n # # puts \"(((((((()))))))))))))((((((((((((((@item))))))))))))))\"\n # # puts @first_item.payload\n # # puts\"((((((((((((((item.next_list_Item)))))))))))))\"\n # # puts item.payload\n # end\n # raise IndexError if item.nil?\n # item.next_list_item = item.next_list_item.next_list_item\n end\nend",
"def pop\n each_with_index do |node, index|\n if index == self.size - 2\n @tail = node\n @tail.next_node = nil\n end\n end\n end",
"def remove(key)\n\t\t\tvalue = @config.shift(key)\n\t\t\treturn value\n\t\tend",
"def pop\r\n removed_item = @data\r\n @data = @data.next_node\r\n removed_item.next_node = nil\r\n removed_item\r\n end",
"def pop\n\t\tlocation = @head.next_node\n\t\twhile location.next_node.next_node != nil\n\t\t\tlocation = location.next_node\n\t\tend\n\t\tlast = location.next_node\n\t\tlocation.next_node = nil\n\t\treturn last\n\t\tlocation = @head\n\tend",
"def remove_at(index)\n return nil if @head.nil? || index > self.size - 1\n if index == 0\n @head = @head.next\n elsif index == self.size - 1\n self.pop(node)\n else\n current_node = @head\n prev_node = nil\n index.times do\n prev_node,current_node = current_node,current_node.next\n end\n end\n prev_node.next = current_node.next\n end",
"def pop\r\n return nil if @head == nil\r\n res = @head\r\n @head = @head.next_node\r\n return res.value\r\n end",
"def pop\n if @length == 0\n return nil\n elsif @length == 1\n node = @head\n @head = nil\n @tail = nil\n @length -= 1\n return node.value\n else\n node = @tail\n @tail = node.previous\n @length -= 1\n return node.value\n end\n end",
"def pop() #delete last element in the LL\n return nil if @head == nil #if list is empty return nil\n return @head = nil if self.list_size == 1 #list has 1 element(head) assign head to nil\n temp_node = @head #if list has more then 1 element, travres till last element\n #stop conditon is when second element from current link to nil, means that first\n #from current is last element in the list\n until temp_node.link.link == nil \n temp_node = temp_node.link\n end\n temp_node.link = nil #cat the link with last element by assigning previous link to nil\n end",
"def pop\n return nil if @data.nil?\n return_value = @data.value\n @data = @data.next_node\n return_value# I RETURN A VALUE\n end",
"def remove_at(index)\n return nil if head.nil?\n\n if index.zero?\n node = head\n @head = head.next\n return node.value\n end\n\n curr = head\n index.downto(2) do |_|\n break if curr.next.nil?\n\n curr = curr.next\n end\n node = curr.next\n node.nil? ? (return nil) : (curr.next = node.next)\n node.value\n end",
"def next_item(item, options = {})\n options ||= {}\n items = filter_items(Items.new, opt: options)\n\n idx = items.index(item)\n\n idx.positive? ? items[idx - 1] : nil\n end",
"def remove_option(form_field_option)\n form_field_option.mark_for_destruction\n end",
"def pop\n node = self.double_link_linked_list.delete_tail\n node ? node.value : nil\n end",
"def remove(idx)\n if idx.zero?\n return remove_first\n end\n\n iterate do |node, count|\n if count == idx - 1\n old_node = node.next_node\n node.next_node = node.next_node.next_node\n node.next_node.prev_node = node unless node.next_node.nil?\n\n return old_node\n end\n end\n end",
"def discard(key = (no_arg = true))\n if no_arg\n @next.clear\n else\n @next.delete(key)\n end\n end",
"def pop\n node = remove_node(head)\n return nil unless node\n self.size -= 1\n node.data\n end",
"def deselect\n select(0, 0)\n end",
"def delete_option\n option = Option.find params[:id]\n\n session[:chosen_options].delete option.id\n\n # skipped_steps has to be emptied, because after deletion other options may become available \n\n session[:skipped_steps] = []\n\n redirect_to workflow_url\n end",
"def remove_at(index)\n self.at(index - 1).next_node = self.at(index + 1)\n self.at(index).next_node = nil\n end",
"def pop\n if @head == nil\n return nil\n elsif @tail == @head\n @tail = nil\n @head = nil\n else\n aux = @tail\n @tail = aux.prev\n @tail.next = nil\n return aux\n end\n\n end",
"def remove_slot\n @limit -= 1\n end",
"def pop(until_term=true)\n tail = @next\n tail = tail.next while until_term && tail && tail.name != \".\"\n prev = tail.previous if tail\n @previous.next = tail\n @previous = nil\n prev.next = nil if tail\n self\n end",
"def pop(*args)\n if args.size > 1\n raise ArgumentError, \"wrong number of arguments (#{args.size})\"\n end\n\n n = 1\n if args.size == 1\n n = args[0].to_int\n end\n shrink(n)\n return nil\n end",
"def delete(val)\n count = self.lrem(0, val)\n if count > 0\n val\n else\n nil\n end\n end",
"def remove_first\n raise 'No such element' if @size == 0\n elt = @head.value\n if @size == 1\n @head = nil\n @tail = nil\n else\n @head = @head.next\n @head.previous.next = nil\n @head.previous = nil\n end\n @size -= 1\n return elt\n end",
"def remove_item(remove_options)\n wait = Selenium::WebDriver::Wait.new(:timeout => 15)\n JQuery.wait_for_events_to_finish(@browser)\n\n regular_options = \"//a[@href='#' and contains(text(),'Options')]\"\n expanded_options = \"//a[@href='#' and @aria-expanded='true' and contains(text(),'Options')]\"\n unexpanded_options = \"//a[@href='#' and @aria-expanded='false' and contains(text(),'Options')]\"\n\n Log.logger.info(\"Waiting for the unexpanded 'Options' tab.\")\n unexpanded_opts = wait.until { @browser.find_element(:xpath => unexpanded_options) }\n Log.logger.info(\"Clicking on the unexpanded 'Options' tab.\")\n unexpanded_opts.click\n JQuery.wait_for_events_to_finish(@browser)\n Log.logger.info(\"Waiting for the expanded 'Options' tab.\")\n expanded_opts = wait.until { @browser.find_element(:xpath => expanded_options) }\n\n JQuery.wait_for_events_to_finish(@browser)\n remove_options.each {|remove_option|\n temp = wait.until { @browser.find_element(:xpath =>\n \"//input[contains(@class, 'form-radio option-default') and @value = '#{remove_option}']/../../td[3]/a[contains(@class, 'remove')]\") }\n puts \"Found element to remove\"\n wait.until {temp.displayed?}\n puts \"Element is visible now, clicking\"\n temp.click\n JQuery.wait_for_events_to_finish(@browser)\n wait.until { @browser.find_elements(:xpath => \"//input[contains(@class, 'form-radio option-default') and @value = '#{remove_option}']\").empty? }\n }\n end",
"def remove(value)\n\t\t\telement = self.head\n\t\t\tprevious_element = @head\n\t\t\twhile element.value != value\n\t\t\t\tif element.next.nil?\n\t\t\t\t\treturn nil\n\t\t\t\telse\n\t\t\t\t\tprevious_element = element\n\t\t\t\t\telement = element.next\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tprevious_element.next = element.next\n\t\t\telement\n\t\tend",
"def get_next_parameter(param_index)\n next_parameter = nil\n if param_index+1 >= ARGV.size\n $errors << \"#{ARGV[param_index]} specified without parameter\"\n else\n next_parameter = ARGV[param_index+1]\n ARGV[param_index+1] = nil\n end\n ARGV[param_index] = nil\n return next_parameter\nend",
"def get_next_parameter(param_index)\n next_parameter = nil\n if param_index+1 >= ARGV.size\n $errors << \"#{ARGV[param_index]} specified without parameter\"\n else\n next_parameter = ARGV[param_index+1]\n ARGV[param_index+1] = nil\n end\n ARGV[param_index] = nil\n return next_parameter\nend",
"def pop\n\t\t\t\tif @length == 0\n\t\t\t\t\traise RuntimeError.new(\"Cannot pop from empty list.\")\n\t\t\t\telse\n\t\t\t\t\tif @tail.prev == nil\n\t\t\t\t\t\t# there is only one element\n\t\t\t\t\t\t@head = nil\n\t\t\t\t\t\t@tail = nil\n\t\t\t\t\telse\n\t\t\t\t\t\t@tail.prev.next = nil\n\t\t\t\t\t\t@tail = @tail.prev\n\t\t\t\t\tend\n\t\t\t\t\t@length -= 1\n\t\t\t\tend\n\t\t\tend",
"def pop\n if empty?\n nil\n else\n @q.remove\n @stack.shift\n end\n end",
"def get_option(opt)\n @optlist.each do |o|\n return o if (opt.is_a?(Symbol) && o.name == opt) || (opt.is_a?(Fixnum) && o.opt == opt)\n end\n nil\n end",
"def consume_option(switches, args)\n # consume from left to right; rightmost will win\n while index = args.find_index { |arg| Array(switches).include?(arg) }\n switch, value = args.slice!(index, 2)\n raise ArgumentError, \"missing option (expected after #{switch})\" unless value\n end\n\n value\n end",
"def delete_at(index)\n delete_idx = @indexes.each_index.find { |i| index == @indexes[i] }\n return nil unless delete_idx\n\n @indexes.delete_at(delete_idx)\n choice = @selected.delete_at(delete_idx)\n @size -= 1\n choice\n end",
"def pop\n if data\n element = data\n @data = data.next_node\n return element.value\n else\n return nil\n end\n end",
"def pop\n # I RETURN A VALUE\n if @data != nil\n value = @data.value\n @data = @data.next_node\n return value\n end\n end",
"def remove_candidate k\n\t\tif !@solved\n\t\t\t@candidates.delete k\n\t\t\tif @candidates.size == 1\n\t\t\t\treturn @candidates.to_a[0]\n\t\t\tend\n\t\tend\n\t\treturn 0\n\tend",
"def get_opt(opt)\n @options[opt] || nil\n end",
"def select_previous_completion\n completer.current_row -= 1\n completer.popup.current_index =\n completer.popup.current_index.sibling(completer.current_row, 0)\n end",
"def for_adoption(animal)\n @pets_list.pop(animal)\n end",
"def pop\n return nil if @head.nil? || self.size == 0\n current_node = @head\n prev_node = nil\n (self.size - 1).times do\n prev_node = current_node\n current_node = current_node.next\n end\n current_node = nil\n @tail = prev_node\n end",
"def pop()\n \n return nil if @head.nil?\n \n result = @head\n \n @head.next_node.nil? ? @head = nil : @head = @head.next_node \n \n result.val\n end",
"def remove()\n return nil if !@store\n\n swap(0, @store.length - 1)\n nope = @store.pop\n\n heap_down(0)\n return nope.value\n end",
"def pop\r\n return nil if self.data == nil\r\n value = self.data.value\r\n @data = self.data.next_node\r\n return value\r\n end",
"def remove_at(index)\n return raise \"Index out of bounds: #{index}\" if index > @size || index.negative?\n\n if @size == 1\n value = @head.value\n clear\n return value\n end\n if index.zero?\n value = @head.value\n @head = @head.next\n @head.prev = nil\n @size -= 1\n return value\n end\n if index == @size - 1\n value = @tail.value\n @tail = @tail.prev\n @tail.next = nil\n @size -= 1\n return value\n end\n\n current = @head\n position = 0\n while position < index\n current = current.next\n position += 1\n end\n value = current.value\n current.prev.next = current.next\n current.next.prev = current.prev\n @size -= 1\n value\n end",
"def pop\n node_count = self.size\n\n @tail = self.at(node_count-2) #-2 because of how size works\n @tail.next_node = nil\n end",
"def pop\r\n # I RETURN A VALUE\r\n data1 = @data\r\n data1.next_node.previous = nil\r\n @data = data1.next_node\r\n return data1\r\n end",
"def remove_highest(var)\n @configs.each do |c|\n if c.key?(var)\n return c.delete(var)\n end\n end\n\n # return nil if we haven't returned a value yet\n nil\n end",
"def drop_while(arr)\n arr.each_with_index do |el, idx|\n if !!yield(el) == true\n next\n else \n return arr[idx..-1]\n end \n end \n\n []\nend",
"def ensure_not_last_option\n return false if good.options.count == 1\n end",
"def pop\n delete_at(0)\n end",
"def pop\n return nil if @head.nil?\n if self.size > 1\n @tail = self.at(self.size-1) \n @tail.next = nil\n else # only 1 node\n @tail = @head = nil\n end\t\n end"
] |
[
"0.5816347",
"0.5725699",
"0.5577512",
"0.55603254",
"0.55255824",
"0.55032474",
"0.5483357",
"0.5470601",
"0.5467944",
"0.54475003",
"0.54406375",
"0.5439845",
"0.5436025",
"0.54314",
"0.54233813",
"0.5420547",
"0.53885144",
"0.53851235",
"0.5382035",
"0.5374562",
"0.53663504",
"0.53527427",
"0.53132546",
"0.52822137",
"0.5268741",
"0.52423126",
"0.5240081",
"0.52341145",
"0.52341145",
"0.5230186",
"0.5228319",
"0.52186155",
"0.52081764",
"0.51942015",
"0.519122",
"0.51868045",
"0.518436",
"0.51803476",
"0.5176656",
"0.5173996",
"0.51718587",
"0.5159303",
"0.5147654",
"0.5147332",
"0.5143607",
"0.5142537",
"0.51424176",
"0.5141738",
"0.514",
"0.5131191",
"0.51210433",
"0.5120467",
"0.51172626",
"0.5095945",
"0.50894654",
"0.50833476",
"0.50799495",
"0.5076193",
"0.5068637",
"0.50651324",
"0.50521743",
"0.50517404",
"0.50495297",
"0.50386125",
"0.5036743",
"0.503364",
"0.50316405",
"0.50277823",
"0.50228566",
"0.5019538",
"0.5011665",
"0.5002234",
"0.5000912",
"0.50004005",
"0.49989644",
"0.49885777",
"0.49885777",
"0.49814978",
"0.4980809",
"0.49794072",
"0.4979064",
"0.49790567",
"0.49785405",
"0.49784154",
"0.49748576",
"0.49726158",
"0.49714854",
"0.4971399",
"0.49713716",
"0.49679023",
"0.4966326",
"0.49573794",
"0.49535254",
"0.4944212",
"0.49431646",
"0.49316308",
"0.49304163",
"0.49296167",
"0.4925443",
"0.492461"
] |
0.5416033
|
16
|
And ... action! Run "svn" puts args_to_svn.inspect puts args_to_less.inspect
|
def quote(*args)
arr = args.map {|x| '"' + x + '"'}
return arr.join(" ")
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def svn command, *args\n run 'svn', command.to_s, *args\nend",
"def svn(*args)\n output = `svn #{args.shift} #{args.map { |arg| arg.inspect }.join(' ')}`\n fail \"SVN command failed with status #{$?.exitstatus}\" unless $?.exitstatus == 0\n return output\n end",
"def use_svn(opts)\n # The Deploy resources assumes you have already created the 'shared' directories\n FileUtils.mkdir_p File.join(opts[:destination], 'shared', 'log')\n\n # setup the optional action and revision\n rev = \"\"\n rev = \"revision \\\"#{opts[:revision]}\\\"\" if opts[:revision]\n action = \"\"\n action = \"action :rollback\" if opts[:rollback]\n action = \"action :force_deploy\" if opts[:force]\n\n # setup optional auth\n suser = \"\"\n suser = \"svn_username #{ENV['OPT_SVN_USERNAME']}\" if ENV['OPT_SVN_USERNAME']\n spass = \"\"\n spass = \"svn_password #{ENV['OPT_SVN_USERNAME']}\" if ENV['OPT_SVN_USERNAME']\n\n @cookbook =<<EOBOOK\n deploy_revision \"#{opts[:destination]}\" do\n repo \"#{opts[:repository]}\"\n #{rev}\n symlinks Hash.new\n symlink_before_migrate Hash.new\n create_dirs_before_symlink Array.new\n purge_before_symlink Array.new\n scm_provider Chef::Provider::Subversion\n #{suser}\n #{spass}\n #{action}\n end\nEOBOOK\n end",
"def build_here\n cp_a File.join(root_dir, \"test\", \"setup\", \"#{name}.svn.gz\"), \".\"\n\n puts `gzip -f -d #{name}.svn.gz`\n raise unless $? == 0\n puts `svnadmin create #{name}`\n raise unless $? == 0\n puts `svnadmin load #{name} < #{name}.svn`\n raise unless $? == 0\n end",
"def svn_log(subsystem, start_date)\n timespan = \"-revision 'HEAD:{#{start_date}}'\"\n root = \"svn://rubyforge.org//var/svn/churn-demo\"\n `svn log #{timespan} #{root}/#{subsystem}`\nend",
"def update_changed_rev(file_safety, repo, fnames = nil)\n fnames = file_safety.keys if fnames.nil?\n # TODO: Use svn info --xml instead\n # TODO: Is it possible to get %x[] syntax to accept variable arguments?\n #all_info = %x[svn info -r HEAD \"#{fnames.join(' ')}\"]\n #repo = %x[svn info].split(\"\\n\").select{|x| x =~ /^URL: /}.collect{|x| x[5..-1]}.first\n # Filename becomes too long, and extra arguments get ignored\n #all_info = Kernel.send(\"`\", \"svn info -r HEAD #{fnames.sort.join(' ')}\").split(\"\\n\\n\")\n # Note: I'd like to be able to use svn -u status -v instead of svn info,\n # but it seems to refer only to the local working copy...\n f2 = fnames.sort # Sorted copy is safe to change\n all_info = []\n while f2 && !f2.empty?\n blocksize = 10\n extra_info = svn_info_entries(f2.first(blocksize), repo)\n #if extra_info.size != [blocksize, f2.size].min\n # puts \"Mismatch (got #{extra_info.size}, expected #{[blocksize, f2.size].min})\"\n #end\n all_info += extra_info\n f2 = f2[blocksize..-1]\n end\n fnames.each{|f|\n #puts \"Checking for URL: #{repo}/#{f}\"\n #puts all_info[0].inspect\n info = all_info.find{|x| x.include?(\"URL: #{repo}/#{f}\")}\n if info\n info = info.split(\"\\n\")\n else\n #puts \"Unknown: #{f}\"\n end\n #info = %x[svn info -r HEAD \"#{f}\"].split(\"\\n\")\n if info.nil? || info.empty?\n # svn writes to stderr: \"svn: '#{f}' has no URL\", or\n # \"#{f}: (Not a versioned resource)\"\n file_safety[f][\"last_changed_rev\"] = -1 # Flag as non-existent\n else\n file_safety[f][\"last_changed_rev\"] = info.\n select{|x| x =~ /^Last Changed Rev: /}.collect{|x| x[18..-1]}[0].to_i\n end\n }\nend",
"def test_changed\n dir = \"changed_dir\"\n dir1 = \"changed_dir1\"\n dir2 = \"changed_dir2\"\n dir_path = File.join(@wc_path, dir)\n dir1_path = File.join(@wc_path, dir1)\n dir2_path = File.join(@wc_path, dir2)\n dir_svn_path = dir\n dir1_svn_path = dir1\n dir2_svn_path = dir2\n\n file1 = \"changed1.txt\"\n file2 = \"changed2.txt\"\n file3 = \"changed3.txt\"\n file4 = \"changed4.txt\"\n file5 = \"changed5.txt\"\n file1_path = File.join(@wc_path, file1)\n file2_path = File.join(dir_path, file2)\n file3_path = File.join(@wc_path, file3)\n file4_path = File.join(dir_path, file4)\n file5_path = File.join(@wc_path, file5)\n file1_svn_path = file1\n file2_svn_path = [dir_svn_path, file2].join(\"/\")\n file3_svn_path = file3\n file4_svn_path = [dir_svn_path, file4].join(\"/\")\n file5_svn_path = file5\n\n first_rev = nil\n\n log = \"added 3 dirs\\nanded 5 files\"\n make_context(log) do |ctx|\n\n ctx.mkdir([dir_path, dir1_path, dir2_path])\n\n FileUtils.touch(file1_path)\n FileUtils.touch(file2_path)\n FileUtils.touch(file3_path)\n FileUtils.touch(file4_path)\n FileUtils.touch(file5_path)\n ctx.add(file1_path)\n ctx.add(file2_path)\n ctx.add(file3_path)\n ctx.add(file4_path)\n ctx.add(file5_path)\n\n commit_info = ctx.commit(@wc_path)\n first_rev = commit_info.revision\n\n editor = traverse(Svn::Delta::ChangedEditor, commit_info.revision, true)\n assert_equal([\n file1_svn_path, file2_svn_path,\n file3_svn_path, file4_svn_path,\n file5_svn_path,\n ].sort,\n editor.added_files)\n assert_equal([], editor.updated_files)\n assert_equal([], editor.deleted_files)\n assert_equal([].sort, editor.updated_dirs)\n assert_equal([].sort, editor.deleted_dirs)\n assert_equal([\n \"#{dir_svn_path}/\",\n \"#{dir1_svn_path}/\",\n \"#{dir2_svn_path}/\"\n ].sort,\n editor.added_dirs)\n end\n\n log = \"deleted 2 dirs\\nchanged 3 files\\ndeleted 2 files\\nadded 3 files\"\n make_context(log) do |ctx|\n\n dir3 = \"changed_dir3\"\n dir4 = \"changed_dir4\"\n dir3_path = File.join(dir_path, dir3)\n dir4_path = File.join(@wc_path, dir4)\n dir3_svn_path = [dir_svn_path, dir3].join(\"/\")\n dir4_svn_path = dir4\n\n file6 = \"changed6.txt\"\n file7 = \"changed7.txt\"\n file8 = \"changed8.txt\"\n file9 = \"changed9.txt\"\n file10 = \"changed10.txt\"\n file6_path = File.join(dir_path, file6)\n file7_path = File.join(@wc_path, file7)\n file8_path = File.join(dir_path, file8)\n file9_path = File.join(dir_path, file9)\n file10_path = File.join(dir_path, file10)\n file6_svn_path = [dir_svn_path, file6].join(\"/\")\n file7_svn_path = file7\n file8_svn_path = [dir_svn_path, file8].join(\"/\")\n file9_svn_path = [dir_svn_path, file9].join(\"/\")\n file10_svn_path = [dir_svn_path, file10].join(\"/\")\n\n File.open(file1_path, \"w\") {|f| f.puts \"changed\"}\n File.open(file2_path, \"w\") {|f| f.puts \"changed\"}\n File.open(file3_path, \"w\") {|f| f.puts \"changed\"}\n ctx.rm_f([file4_path, file5_path])\n FileUtils.touch(file6_path)\n FileUtils.touch(file7_path)\n FileUtils.touch(file8_path)\n ctx.add(file6_path)\n ctx.add(file7_path)\n ctx.add(file8_path)\n ctx.cp(file1_path, file9_path)\n ctx.cp(file2_path, file10_path)\n ctx.mv(dir2_path, dir3_path)\n ctx.cp(dir1_path, dir4_path)\n ctx.rm(dir1_path)\n\n commit_info = ctx.commit(@wc_path)\n second_rev = commit_info.revision\n\n editor = traverse(Svn::Delta::ChangedEditor, commit_info.revision, true)\n assert_equal([file1_svn_path, file2_svn_path, file3_svn_path].sort,\n editor.updated_files)\n assert_equal([file4_svn_path, file5_svn_path].sort,\n editor.deleted_files)\n assert_equal([file6_svn_path, file7_svn_path, file8_svn_path].sort,\n editor.added_files)\n assert_equal([].sort, editor.updated_dirs)\n assert_equal([\n [file9_svn_path, file1_svn_path, first_rev],\n [file10_svn_path, file2_svn_path, first_rev],\n ].sort_by{|x| x[0]},\n editor.copied_files)\n assert_equal([\n [\"#{dir3_svn_path}/\", \"#{dir2_svn_path}/\", first_rev],\n [\"#{dir4_svn_path}/\", \"#{dir1_svn_path}/\", first_rev],\n ].sort_by{|x| x[0]},\n editor.copied_dirs)\n assert_equal([\"#{dir1_svn_path}/\", \"#{dir2_svn_path}/\"].sort,\n editor.deleted_dirs)\n assert_equal([].sort, editor.added_dirs)\n end\n end",
"def checksvn_command(msg)\n msg.speak \"no new commits since I last checked #{@lastlast} ago\" if !check_svn(msg)\n end",
"def print_file_diffs(file_safety, repo, fname, user_name)\n entry = file_safety[fname]\n if entry.nil?\n # File not in audit list\n elsif entry[\"safe_revision\"].nil?\n puts \"No safe revision for #{fname}\"\n rev = %x[svn info -r head \"#{repo}/#{fname}\"].match('Last Changed Rev: ([0-9]*)').to_a[1]\n if rev\n mime_type = %x[svn propget svn:mime-type \"#{repo}/#{fname}\"].chomp\n if ['application/octet-stream'].include?(mime_type)\n puts \"Cannot display: file marked as a binary type.\"\n puts \"svn:mime-type = #{mime_type}\"\n else\n fdata = %x[svn cat -r \"#{rev}\" \"#{repo}/#{fname}\"]\n # TODO: Add header information like svn\n begin\n puts fdata.split(\"\\n\").collect{|line| \"+ #{line}\"}\n rescue ArgumentError # invalid byte sequence in UTF-8\n puts \"+ \" + fdata\n end\n end\n puts \"To flag the changes to this file as safe, run:\"\n else\n puts \"Please code review a recent working copy, note the revision number, and run:\"\n rev = '[revision]'\n end\n puts %( rake audit:safe release=#{rev} file=#{fname} reviewed_by=#{user_name} comments=\"\")\n puts\n else\n if entry[\"last_changed_rev\"].nil?\n update_changed_rev(file_safety, [fname])\n end\n svnlatest = entry[\"last_changed_rev\"] # May have been prepopulated en mass\n if entry[\"last_changed_rev\"] == -1\n # Not in svn repository\n elsif svnlatest > entry['safe_revision']\n cmd = \"svn diff -r #{entry['safe_revision']}:#{svnlatest} -x-b #{repo}/#{fname}\"\n puts cmd\n system(cmd)\n puts %(To flag the changes to this file as safe, run:)\n puts %( rake audit:safe release=#{svnlatest} file=#{fname} reviewed_by=#{user_name} comments=\"\")\n puts\n else\n # Safe\n end\n end\nend",
"def get_svn_diff( *targets )\n\ttargets << BASEDIR if targets.empty?\n\ttrace \"Getting svn diff for targets: %p\" % [targets]\n\tlog = IO.read( '|-' ) or exec 'svn', 'diff', *(targets.flatten)\n\n\treturn log\nend",
"def script(subcommand, *args); end",
"def script(subcommand, *args); end",
"def do_local_checkout_and_send(username, actor)\n temp_file= \"sounzbuild_#{Time.now.to_f}\"\n tmpdir_local= configuration[:tmpdir_local] || \"/tmp\"\n temp_dest_local= File.join(tmpdir_local, temp_file)\n tmpdir_remote= configuration[:tmpdir_remote] || \"/tmp\"\n temp_dest_remote= File.join(tmpdir_remote, temp_file)\n temp_tar_file_local= File.join(tmpdir_local, \"#{temp_file}.tar.gz\")\n temp_tar_file_remote= File.join(tmpdir_remote, \"#{temp_file}.tar.gz\")\n\n configuration.logger.debug \"local executing: #{svn} export #{username} -q -r#{configuration[:revision]} #{rep_path} #{temp_dest_local}\"\n configuration.logger.debug \"local creating tar file: #{temp_tar_file_local}\"\n\n # always use export in this case as update will never be possible\n run_local(\n \"#{svn} export #{username} -q -r#{configuration[:revision]} #{rep_path} #{temp_dest_local} && \" +\n \"./denote_version.sh > #{temp_dest_local}/app/helpers/version_helper.rb && \"+\n \"tar -C #{temp_dest_local} -c -z -f #{temp_tar_file_local} . && \" +\n \"rm -rf #{temp_dest_local}\"\n )\n \n\n\n # send the tar file to the remote machine(s)\n configuration.logger.debug \"sending tar file: #{temp_tar_file_local} to remote #{temp_tar_file_remote}\"\n actor.put(read_local_file(temp_tar_file_local), temp_tar_file_remote)\n\n run_local(\"rm #{temp_tar_file_local}\")\n\n # unpack the tar file on the remote machine as if it has been checked out there\n cmd=\"mkdir -p #{actor.release_path} && \" +\n \"tar -C #{actor.release_path} -x -z -f #{temp_tar_file_remote} && \" +\n \"rm -f #{temp_tar_file_remote} && \"\n run_remote(actor, cmd)\n end",
"def change_checker\n `svnlook changed #{@repo} -r #{@revision}`.split(\"\\n\")\n end",
"def menu_svn_add\n Subversion.add(@last_path)\n menu_refresh\n end",
"def do_checkout\n super\n @logger.operation(:checkout_revision) do\n run_svn_no_chdir(\"checkout\", @repository.url, @repo_dir, get_tag_argument)\n end\n do_update_tag\n end",
"def vest _args\n \"vest _args;\" \n end",
"def shell_commands(cmd, args); end",
"def make_svn_commit_log( dir='.' )\n\tdiff = IO.read( '|-' ) or exec 'svn', 'diff'\n\tfail \"No differences.\" if diff.empty?\n\n\treturn diff\nend",
"def author_check(revision,repo)\n `svnlook author -r #{revision} #{repo}`\n end",
"def get_svn_status( *targets )\n\ttargets << BASEDIR if targets.empty?\n\ttrace \"Getting svn status for targets: %p\" % [targets]\n\tstatus = IO.read( '|-' ) or exec 'svn', 'st', '--ignore-externals', *(targets.flatten)\n\tentries = status.split( /\\n/ ).\n\t\tselect {|line| line !~ /^(\\s*|--- .*)$/ }.\n\t\tcollect do |line|\n\t\t\tflag, path = line.strip.split( /\\s+/, 2 )\n\t\t\t[ flag, Pathname.new(path) ]\n\t\tend\n\n\treturn entries\nend",
"def get_info(options = {})\n args = standard_args(options)\n args.push('--xml')\n args.push(@repo)\n\n info_xml = svn('info', args)\n Svn::Info.parse(info_xml)\n end",
"def shell_commands(cmd, *args); end",
"def check!\n # does not inherit any dependencies (super.check will inherit)\n Dependencies.new(configuration) do |d|\n d.remote.directory(configuration[:deploy_to]).or(\"`#{configuration[:deploy_to]}' does not exist.\")\n d.remote.writable(configuration[:deploy_to], :via => :sudo).or(\"You do not have permissions to write to `#{configuration[:deploy_to]}'.\")\n d.remote.command(\"svn\")\n d.remote.match(\"cd #{repository_dir}; svn info|grep URL\", configuration[:repository])\n end\n end",
"def use_git(opts)\n # The Deploy resources assumes you have already created the 'shared' directories\n FileUtils.mkdir_p File.join(opts[:destination], 'shared', 'log')\n\n # setup the optional action and revision\n rev = \"\"\n rev = \"revision \\\"#{opts[:revision]}\\\"\" if opts[:revision]\n action = \"\"\n action = \"action :rollback\" if opts[:rollback]\n action = \"action :force_deploy\" if opts[:force]\n\n @cookbook =<<EOBOOK\n deploy_revision \"#{opts[:destination]}\" do\n repo \"#{opts[:repository]}\"\n #{rev}\n shallow_clone true\n symlinks Hash.new\n symlink_before_migrate Hash.new\n create_dirs_before_symlink Array.new\n purge_before_symlink Array.new\n #{action}\n end\nEOBOOK\n end",
"def name\n @svn_name\n end",
"def svn_ls( url=nil )\n\turl ||= get_svn_url()\n\tlist = IO.read( '|-' ) or exec 'svn', 'ls', url\n\n\ttrace 'svn ls of %s: %p' % [url, list] if $trace\n\t\n\treturn [] if list.nil? || list.empty?\n\treturn list.split( $INPUT_RECORD_SEPARATOR )\nend",
"def make_xml_svn_log( dir='.', start='PREV', finish='HEAD' )\n\ttrace \"svn log --xml --verbose -r#{start}:#{finish} #{dir}\"\n\tlog = IO.read( '|-' ) or exec 'svn', 'log', '--verbose', '--xml', \"-r#{start}:#{finish}\", dir\n\tfail \"No log between #{start} and #{finish}.\" if log.empty?\n\n\treturn log\nend",
"def changed_paths_check(revision,repo)\n `svnlook changed -r #{revision} #{repo}`.split(\"\\n\")\n end",
"def authentication\n username = config[:svn_username]\n return \"\" unless username\n result = \"--username #{config[:svn_username]} \"\n result << \"--password #{config[:svn_password]} \"\n result\n end",
"def make_svn_changelog( dir='.' )\n\trequire 'xml/libxml'\n\n\tchangelog = ''\n\tpath_prefix = '/' + get_svn_path( dir ) + '/'\n\n\txmllog = make_xml_svn_log( dir, 0 )\n\n\tparser = XML::Parser.string( xmllog )\n\troot = parser.parse.root\n\troot.find( '//log/logentry' ).to_a.reverse.each do |entry|\n\t\ttrace \"Making a changelog entry for r%s\" % [ entry['revision'] ]\n\n\t\tadded = []\n\t\tdeleted = []\n\t\tchanged = []\n\n\t\tentry.find( 'paths/path').each do |path|\n\t\t\tpathname = path.content\n\t\t\tpathname.sub!( path_prefix , '' ) if pathname.count('/') > 1\n\n\t\t\tcase path['action']\n\t\t\twhen 'A', 'R'\n\t\t\t\tif path['copyfrom-path']\n\t\t\t\t\tverb = path['action'] == 'A' ? 'renamed' : 'copied'\n\t\t\t\t\tadded << \"%s\\n#{FILE_INDENT}-> #{verb} from %s@r%s\" % [\n\t\t\t\t\t\tpathname,\n\t\t\t\t\t\tpath['copyfrom-path'],\n\t\t\t\t\t\tpath['copyfrom-rev'],\n\t\t\t\t\t]\n\t\t\t\telse\n\t\t\t\t\tadded << \"%s (new)\" % [ pathname ]\n\t\t\t\tend\n\t\t\t\n\t\t\twhen 'M'\n\t\t\t\tchanged << pathname\n\t\t\t\n\t\t\twhen 'D'\n\t\t\t\tdeleted << pathname\n\t\t\t\n\t\t\telse\n\t\t\t\tlog \"Unknown action %p in rev %d\" % [ path['action'], entry['revision'] ]\n\t\t\tend\n\t\t\n\t\tend\n\n\t\tdate = Time.parse( entry.find_first('date').content )\n\n\t\t# cvs2svn doesn't set 'author'\n\t\tauthor = 'unknown'\n\t\tif entry.find_first( 'author' )\n\t\t\tauthor = entry.find_first( 'author' ).content\n\t\tend\n\t\t \n\t\tmsg = entry.find_first( 'msg' ).content\n\t\trev = entry['revision']\n\n\t\tchangelog << \"-- #{date.rfc2822} by #{author} (r#{rev}) -----\\n\"\n\t\tchangelog << \" Added: \" << humanize_file_list(added) << \"\\n\" unless added.empty?\n\t\tchangelog << \" Changed: \" << humanize_file_list(changed) << \"\\n\" unless changed.empty?\n\t\tchangelog << \" Deleted: \" << humanize_file_list(deleted) << \"\\n\" unless deleted.empty?\n\t\tchangelog << \"\\n\"\n\t\t\n\t\tindent = msg[/^(\\s*)/] + LOG_INDENT\n\t\t\n\t\tchangelog << indent << msg.strip.gsub(/\\n\\s*/m, \"\\n#{indent}\")\n\t\tchangelog << \"\\n\\n\\n\"\n\tend\n\t\n\treturn changelog\nend",
"def make_svn_log( dir='.', start='PREV', finish='HEAD' )\n\ttrace \"svn log -r#{start}:#{finish} #{dir}\"\n\tlog = IO.read( '|-' ) or exec 'svn', 'log', \"-r#{start}:#{finish}\", dir\n\tfail \"No log between #{start} and #{finish}.\" if log.empty?\n\n\treturn log\nend",
"def sync(revision, destination)\n scm :update, config[:arguments], verbose, authentication, \"-r#{revision}\", destination\n end",
"def git command, *args\n run 'git', command.to_s, *args\nend",
"def svn_info_entries(fnames, repo, retries = true, debug = 0)\n puts \"svn info -r HEAD #{fnames.join(' ')}\" if debug >= 2\n return [] if fnames.empty?\n # Silence if retries and debug=1, as we'll get repeats when we retry\n silencer = (debug == 2 || (debug == 1 && !retries)) ? \"\" :\n (RUBY_PLATFORM =~ /mswin32|mingw32/ ? \" 2>nul \" : \" 2>/dev/null \")\n result = Kernel.send(\"`\", \"svn info -r HEAD #{fnames.collect{|fn|\"#{repo}/#{fn}\"}.join(' ')}#{silencer}\").split(\"\\n\\n\")\n if retries && result.size != fnames.size && fnames.size > 1\n # At least one invalid (deleted file --> subsequent arguments ignored)\n # Try each file individually\n # (It would probably be safe to continue from the extra_info.size argument)\n puts \"Retrying (got #{result.size}, expected #{fnames.size})\" if debug >= 2\n result = []\n fnames.each{ |f|\n result += svn_info_entries([f], repo, false, debug)\n }\n end\n result\nend",
"def audit_code_safety(max_print = 20, ignore_new = false, show_diffs = false, show_in_priority = false, user_name = 'usr')\n puts <<EOT\nRunning source code safety audit script.\nThis currently takes about 3 minutes to run.\nWe seem to have issues with Apache on deepthought rate limiting svn requests.\n\nEOT\n max_print = 1000000 if max_print < 0\n safety_cfg = File.exist?(SAFETY_FILE) ? YAML.load_file(SAFETY_FILE) : {}\n file_safety = safety_cfg[\"file safety\"]\n if file_safety.nil?\n puts \"Creating new 'file safety' block in #{SAFETY_FILE}\"\n safety_cfg[\"file safety\"] = file_safety = {}\n end\n orig_count = file_safety.size\n\n repo_info = %x[svn info]\n repo_info = %x[git svn info] unless repo_info =~ /^URL: /\n # trunk_repo is the trunk code\n # safety_repo is the release branch\n safety_repo = trunk_repo = repo_info.split(\"\\n\").select{|x|\n x =~ /^URL: /}.collect{|x| x[5..-1]}.first\n SAFETY_REPOS.each{|suffix, alt|\n # Temporarily override to only audit a different file list\n if safety_repo.end_with?(suffix)\n safety_repo = safety_repo[0...-suffix.length]+alt\n break\n end\n }\n if ignore_new\n puts \"Not checking for new files in #{safety_repo}\"\n else\n puts \"Checking for new files in #{safety_repo}\"\n new_files = %x[svn ls -R \"#{safety_repo}\"].split(\"\\n\")\n # Ignore subdirectories\n new_files.delete_if{|f| f =~ /[\\/\\\\]$/}\n new_files.each{|f|\n unless file_safety.has_key?(f)\n file_safety[f] = {\n \"comments\" => nil,\n \"reviewed_by\" => nil,\n \"safe_revision\" => nil }\n end\n }\n File.open(SAFETY_FILE, 'w') do |file|\n # Consistent file diffs, as ruby preserves Hash insertion order since v1.9\n safety_cfg[\"file safety\"] = Hash[file_safety.sort]\n YAML.dump(safety_cfg, file) # Save changes before checking latest revisions\n end\n end\n puts \"Checking latest revisions\"\n update_changed_rev(file_safety, trunk_repo)\n puts \"\\nSummary:\"\n puts \"Number of files originally in #{SAFETY_FILE}: #{orig_count}\"\n puts \"Number of new files added: #{file_safety.size - orig_count}\"\n\n # Now generate statistics:\n unknown = file_safety.values.select{|x| x[\"safe_revision\"].nil?}\n unsafe = file_safety.values.select{|x|\n !x[\"safe_revision\"].nil? && x[\"safe_revision\"] != -1 &&\n x[\"last_changed_rev\"] > x['safe_revision']\n }\n puts \"Number of files with no safe version: #{unknown.size}\"\n puts \"Number of files which are no longer safe: #{unsafe.size}\"\n puts\n printed = []\n # We also print a third category: ones which are no longer in the repository\n if show_in_priority\n file_list = file_safety.sort_by {|k,v| v.nil? ? -100 : v[\"last_changed_rev\"].to_i}.map(&:first)\n else\n file_list = file_safety.keys.sort\n end\n \n file_list.each{|f|\n if print_file_safety(file_safety, trunk_repo, f, false, printed.size >= max_print)\n printed << f\n end\n }\n puts \"... and #{printed.size - max_print} others\" if printed.size > max_print\n if show_diffs\n puts\n printed.each{|f|\n print_file_diffs(file_safety, trunk_repo, f, user_name)\n }\n end\nend",
"def path\n @svn_name\n end",
"def fetch_svn_urls()\n urls = bot.config['svn_urls']\n commits = []\n urls.each do |url_str|\n begin\n @log.info \"checking #{url_str} for new commits...\"\n\n # https://username:password@svn.host.com:8080/svn/path/in/repo/\n url = Addressable::URI.parse(url_str)\n\n xmldata = `svn log --username #{url.user} --password #{url.password} --xml -v --limit 15 #{url.omit(:user, :password)}`\n doc = REXML::Document.new(xmldata)\n \n doc.elements.inject('log/logentry', commits) do |commits, element|\n commits.push({:url => url}.merge(parse_entry_info(element)))\n end\n\n rescue Exception => e\n @log.error \"error connecting to svn: #{e.message}\"\n end\n end\n return commits\n end",
"def traject_command_line(args = {})\n # Horizon and Solr connection details are looked\n # up by the actual traject config files that we invoke, based on RAILS_ENV.\n # We dont' need to look them up here or include them in command line. \n\n str = \"\"\n if `ruby -v` =~ /jruby/\n puts \"current ruby is jruby, executing with current ruby...\"\n elsif system(\"chruby-exec jruby -- echo\")\n str << \"chruby-exec jruby -- \"\n else\n warn \"No jruby detected, and `chruby-exec jruby` not available either. We need jruby to run traject. Try installing chruby with jruby?\"\n exit 1\n end\n \n str << \" BUNDLE_GEMFILE='./Gemfile' bundle exec \"\n \n str << \"traject -c conf/horizon_source.rb -c conf/horizon_index.rb \"\n\n if args[:mode].to_s == \"solr\"\n str << \" -c conf/solr_connect.rb \"\n else # args[:mode] == marcout\n str << \" -x marcout\"\n\n output_file = args[:output_file] || auto_marcout_filename\n str << \" -o \\\"#{output_file}\\\" \"\n end\n\n # Only it's a normal kind of indexing, do the\n # shelfbrowse side channel index too\n unless ENV['ONLY'] || ENV['FIRST'] || ENV['LAST'] || (args[:mode] != :solr)\n str = \"SHELFBROWSE_TMP_TABLE_SWAP=1 #{str}\"\n str << \" -c conf/shelf_browse_index.rb\"\n end\n\n\n str << \" -s horizon.only_bib=#{ENV['ONLY']} \" if ENV['ONLY']\n str << \" -s horizon.first_bib=#{ENV['FIRST']} \" if ENV['FIRST']\n str << \" -s horizon.last_bib=#{ENV['LAST']} \" if ENV['LAST']\n \n \n return str\nend",
"def cli_checkout_code\n ssh.run(\"sudo git clone --recursive --quiet #{CLI_GIT} #{CLI_PATH}\")\n\n if config.wordpress.cli.nil?\n tags = ssh.capture(\"cd #{CLI_PATH} && git tag\").split(\"\\n\").map(&:strip).reverse\n tag = tags.first\n rev = ssh.capture(\"cd #{CLI_PATH} && git rev-parse #{tag}\").strip\n else\n tag = config.wordpress.cli\n\n if tag =~ /^[\\d\\.]+$/ # version def\n tag = \"v#{tag}\" unless tag =~ /v[\\d]+/\n end\n \n rev = tag\n end\n\n res = ssh.run(\"cd #{CLI_PATH} && sudo git checkout #{rev}\")\n\n if res.failure?\n error \"Unable to checkout revision #{rev}: #{res.output}\"\n end\n\n #rev, tag\n end",
"def execute(*args)\n set_config('gist.api-url', DEFAULT_GITHUB_API_BASE_URL) if !config('gist.api-url')\n set_config('gist.default-url', DEFAULT_GITHUB_API_BASE_URL) if !config('gist.default-url')\n\n begin\n option_parser.parse!(args)\n\n if $stdin.tty? && options.setup_credentials\n api_url # make sure API URL selection happens, if need be\n setup_credentials\n exit 1\n end\n\n if $stdin.tty? && args[0] != '-'\n # Run without stdin.\n usage if args.empty?\n\n files = args.inject([]) { |list, file|\n # Check if arg is a file. If so, grab the content.\n abort \"Can't find #{file}\" unless File.exists?(file)\n\n list.push({\n :input => File.read(file),\n :filename => file,\n :extension => file.include?('.') ? File.extname(file) : options.gist_extension\n })\n }\n else\n # Read from standard input.\n input = $stdin.read\n files = [{:input => input, :extension => options.gist_extension}]\n end\n\n url = write(files, options.private_gist, options.description)\n browse(url) if options.browse_enabled\n $stdout.puts copy(to_embed(url)) if options.embed_enabled\n $stdout.puts copy(url) unless options.embed_enabled\n rescue Interrupt\n $stderr.puts \"\\nQuit.\"\n exit 1\n rescue OptionParser::InvalidOption => e\n warn e; puts\n usage\n exit 1\n rescue StandardError => e\n options.debug ? warn(e) : raise(e)\n end\n end",
"def get_svn_info( dir='.' )\n\treturn {} unless File.directory?( File.join(dir, '.svn') )\n\tinfo = IO.read( '|-' ) or exec 'svn', 'info', dir\n\treturn YAML.load( info ) # 'svn info' outputs valid YAML! Yay!\nrescue NotImplementedError\n\ttrace \"No fork(), proceeding without svn info...\"\n\treturn {}\nend",
"def saveHandin()\n if @modulesUsed.include?(\"Svn\") then\n return svnSaveHandin()\n else\n return super()\n end\n end",
"def git(*args)\n system \"git \" + args.join(\" \")\nend",
"def testNominalShort\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_SingleDummyGem ]\n ]\n executeProcess(\n [\n '-u', 'ReleaseUser',\n '-b', 'BranchName',\n '-c', 'ReleaseComment',\n '-v', '0.0.1.20100317',\n '-t', iTasksFileName,\n '-k', iTicketsFileName,\n '-s', 'MySVNRep',\n '-d', 'deliver %{DeliverablesDir}'\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn co MySVNRep' ],\n [ 'query', /^deliver .*$/ ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal( @@CommonSlaveActions.merge(\n {\n Tools::FilesManager => {\n Actions::File_Upload => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Gem/DummyGem.gem\"), 'All', 'Gem', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end",
"def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={}, &block)\r\n logger.debug \"<cvs> revisions path:'#{path}',identifier_from #{identifier_from}, identifier_to #{identifier_to}\"\r\n \r\n path_with_project=\"#{url}#{with_leading_slash(path)}\"\r\n cmd = \"#{CVS_BIN} -d #{root_url} rlog\"\r\n cmd << \" -d\\\">#{time_to_cvstime(identifier_from)}\\\"\" if identifier_from\r\n cmd << \" #{shell_quote path_with_project}\"\r\n shellout(cmd) do |io|\r\n state=\"entry_start\"\r\n \r\n commit_log=String.new\r\n revision=nil\r\n date=nil\r\n author=nil\r\n entry_path=nil\r\n entry_name=nil\r\n file_state=nil\r\n branch_map=nil\r\n \r\n io.each_line() do |line| \r\n \r\n if state!=\"revision\" && /^#{ENDLOG}/ =~ line\r\n commit_log=String.new\r\n revision=nil\r\n state=\"entry_start\"\r\n end\r\n \r\n if state==\"entry_start\"\r\n branch_map=Hash.new\r\n if /^RCS file: #{Regexp.escape(root_url_path)}\\/#{Regexp.escape(path_with_project)}(.+),v$/ =~ line\r\n entry_path = normalize_cvs_path($1)\r\n entry_name = normalize_path(File.basename($1))\r\n logger.debug(\"Path #{entry_path} <=> Name #{entry_name}\")\r\n elsif /^head: (.+)$/ =~ line\r\n entry_headRev = $1 #unless entry.nil?\r\n elsif /^symbolic names:/ =~ line\r\n state=\"symbolic\" #unless entry.nil?\r\n elsif /^#{STARTLOG}/ =~ line\r\n commit_log=String.new\r\n state=\"revision\"\r\n end \r\n next\r\n elsif state==\"symbolic\"\r\n if /^(.*):\\s(.*)/ =~ (line.strip) \r\n branch_map[$1]=$2\r\n else\r\n state=\"tags\"\r\n next\r\n end \r\n elsif state==\"tags\"\r\n if /^#{STARTLOG}/ =~ line\r\n commit_log = \"\"\r\n state=\"revision\"\r\n elsif /^#{ENDLOG}/ =~ line\r\n state=\"head\"\r\n end\r\n next\r\n elsif state==\"revision\"\r\n if /^#{ENDLOG}/ =~ line || /^#{STARTLOG}/ =~ line \r\n if revision\r\n \r\n revHelper=CvsRevisionHelper.new(revision)\r\n revBranch=\"HEAD\"\r\n \r\n branch_map.each() do |branch_name,branch_point|\r\n if revHelper.is_in_branch_with_symbol(branch_point)\r\n revBranch=branch_name\r\n end\r\n end\r\n \r\n logger.debug(\"********** YIELD Revision #{revision}::#{revBranch}\")\r\n \r\n yield Revision.new({ \r\n :time => date,\r\n :author => author,\r\n :message=>commit_log.chomp,\r\n :paths => [{\r\n :revision => revision,\r\n :branch=> revBranch,\r\n :path=>entry_path,\r\n :name=>entry_name,\r\n :kind=>'file',\r\n :action=>file_state\r\n }]\r\n }) \r\n end\r\n \r\n commit_log=String.new\r\n revision=nil\r\n \r\n if /^#{ENDLOG}/ =~ line\r\n state=\"entry_start\"\r\n end\r\n next\r\n end\r\n \r\n if /^branches: (.+)$/ =~ line\r\n #TODO: version.branch = $1\r\n elsif /^revision (\\d+(?:\\.\\d+)+).*$/ =~ line\r\n revision = $1 \r\n elsif /^date:\\s+(\\d+.\\d+.\\d+\\s+\\d+:\\d+:\\d+)/ =~ line\r\n date = Time.parse($1)\r\n author = /author: ([^;]+)/.match(line)[1]\r\n file_state = /state: ([^;]+)/.match(line)[1]\r\n #TODO: linechanges only available in CVS.... maybe a feature our SVN implementation. i'm sure, they are\r\n # useful for stats or something else\r\n # linechanges =/lines: \\+(\\d+) -(\\d+)/.match(line)\r\n # unless linechanges.nil?\r\n # version.line_plus = linechanges[1]\r\n # version.line_minus = linechanges[2]\r\n # else\r\n # version.line_plus = 0\r\n # version.line_minus = 0 \r\n # end \r\n else \r\n commit_log << line unless line =~ /^\\*\\*\\* empty log message \\*\\*\\*/\r\n end \r\n end \r\n end\r\n end\r\n end",
"def do_update\n @logger.operation(:update) do\n run_svn(\"update\", get_tag_argument)\n end\n do_update_tag\n end",
"def push(downstream, upstream, remote_branch='svn_git_port')\n name=get_dir_name(downstream, upstream)\n upstream_dir=File.join(name, 'upstream')\n Dir.chdir(upstream_dir) do\n puts `git checkout -b push`\n puts `git push upstream HEAD:#{remote_branch}`\n end\nend",
"def run!\n\t\t\topts=OptionParser.new\n\n\t\t\topts.banner = \"Usage: #{$0} [options] action\\n action is one of init, build, install, uninstall, info, status, diff\"\n\n\t\t\topts.separator \"\"\n\t\t\topts.separator \"install options:\"\n\n\t\t\topts.on(\"-o\", \"--[no-]overwrite\", \"Overwrite existing files (a backup will be created)\") { |v| @options[:overwrite] = v }\n\n\t\t\topts.separator \"\"\n\t\t\topts.separator \"build options:\"\n\n\t\t\topts.on(\"-r\", \"--[no-]rebuild\", \"Build even if the built file is current\") { |v| @options[:rebuild] = v }\n\n\t\t\topts.separator \"\"\n\t\t\topts.separator \"Common options:\"\n\n\t\t\topts.on(\"-h\", \"--help\" , \"Show this message\") { puts opts ; exit }\n\t\t\topts.on( \"--version\", \"Show version\" ) { puts VERSION; exit }\n\n\t\t\tbegin\n\t\t\t\topts.parse!\n\t\t\trescue OptionParser::InvalidOption => ex\n\t\t\t\tputs ex.message\n\t\t\t\treturn\n\t\t\tend\n\n\t\t\taction=ARGV[0]||\"\"\n\n\t\t\tcase action.downcase\n\t\t\t\twhen \"init\" then Coffle.init! @repository, @options\n\t\t\t\twhen \"build\" then instance_action=:build\n\t\t\t\twhen \"install\" then instance_action=:install\n\t\t\t\twhen \"uninstall\"then instance_action=:uninstall\n\t\t\t\twhen \"info\" then instance_action=:info\n\t\t\t\twhen \"status\" then instance_action=:status\n\t\t\t\twhen \"diff\" then instance_action=:diff\n\t\t\t\telse puts opts # Output the options help message\n\n\t\t\tend\n\n\t\t\tif instance_action\n\t\t\t\tcoffle=Coffle.new(@repository, @target, @options)\n\n\t\t\t\tcase instance_action\n\t\t\t\twhen :build then coffle.build! @options\n\t\t\t\twhen :install then coffle.install! @options\n\t\t\t\twhen :uninstall then coffle.uninstall! @options\n\t\t\t\twhen :info then coffle.info! @options\n\t\t\t\twhen :status then coffle.status! @options\n\t\t\t\twhen :diff then coffle.diff! @options\n\t\t\t\tend\n\n\t\t\t\tcoffle.write_status\n\t\t\t\tcoffle.write_target_status\n\t\t\tend\n\t\tend",
"def wc(*args) run_command('wc', args) end",
"def updateObjectTree _args\n \"updateObjectTree _args;\" \n end",
"def run\n usage \"[0.1.2 - version, 100/10/1 - bump major/minor/patch, .build - add build] Commit message goes here\" if @argv.empty?\n\n # First Arg may indicate version command if it matches pattern\n version_command = @argv[0] =~ COMMAND_PATTERN ? @argv.shift : nil\n\n # All the other args lumped into message, or default message\n if @argv.empty?\n commit_message = \"Commit #{Time.now.to_s[0..-6]}\"\n history_message = nil\n else\n commit_message = history_message = @argv.join(' ')\n end\n\n # Updating version only if version command set\n if version_command\n puts \"Updating version with #{version_command}\"\n if history_message\n system %Q{rake \"version[#{version_command},#{history_message}]\"}\n else\n system %Q{rake version[#{version_command}]}\n end\n end\n\n puts \"Adding all the changes\"\n system \"git add --all\"\n\n puts \"Committing everything with message: #{commit_message}\"\n system %Q[git commit -a -m \"#{commit_message}\" --author arvicco]\n\n current_branch = `git branch`.strip\n puts \"Pushing to (default) remote for branch: #{current_branch}\"\n system \"git push\"\n end",
"def svn_make_tag()\n result = false\n Dir.chdir(PATH_ROOT) do\n cmd_svn_copy = \"svn copy svn://192.168.1.5/penguin/trunk svn://192.168.1.5/penguin/tags/#{@pkgtag} -m \\\"make tag for release version #{@pkgtag}.\\\"\"\n result = call_system_command(cmd_svn_copy)\n puts \"make tag failed, and return #{result}.\" unless result\n end\n return result\n end",
"def commander _args\n \"commander _args;\" \n end",
"def repo=(_arg0); end",
"def repo=(_arg0); end",
"def repo=(_arg0); end",
"def repo=(_arg0); end",
"def svn(on_remote= false)\n s= nil\n if on_remote\n s= configuration[:remote_svn]\n else\n s= configuration[:local_svn]\n end\n s || configuration[:svn] || \"svn\"\n end",
"def scm_pull(uri,dest=nil)\n if dest\n sh 'svn', 'checkout', uri, dest\n else\n sh 'svn', 'checkout', uri\n end\n end",
"def invoke_independent_command!(args)\n \n ##\n # Flatten Arguments to be able to test if the array is empty\n # and not an empty array in an empty array\n args.flatten!\n \n ##\n # Parses the CLI\n cli = GitPusshuTen::CLI.new(args)\n \n ##\n # Parses the Configuration\n if File.exist?(configuration_file)\n configuration = GitPusshuTen::Configuration.new(cli.environment).parse!(configuration_file)\n else\n configuration = nil\n end\n \n ##\n # Initializes the help command by default if there aren't any arguments\n if args.empty?\n GitPusshuTen::Command.new(cli, configuration, nil, nil)\n exit\n end\n \n ##\n # Append more arguments to the array below to allow more commands\n # to invoke without initializing an environment\n if %w[help version initialize].include? args.flatten.first\n \"GitPusshuTen::Commands::#{args.flatten.first.classify}\".constantize.new(\n cli, configuration, nil, nil\n ).perform!\n exit\n end\n end",
"def checkout(revision, destination)\n scm :checkout, config[:arguments], verbose, authentication, \"-r#{revision}\", repository, destination\n end",
"def get_content(file, rev = 'HEAD', options = {})\n args = standard_args(options)\n args.push('--revision', rev)\n args.push(\"#{@repo}/#{file}\")\n\n svn('cat', args)\n end",
"def do_local_checkout_and_rsync(svn_username, actor)\n configuration.logger.debug(\"++++ LOCAL CHECKOUT AND RSYNC ++++\")\n rsync_username = configuration[:rsync_username] ? \"#{configuration[:rsync_username]}@\" : \"\"\n local_rsync_cache= configuration[:local_rsync_cache]\n remote_rsync_cache= configuration[:remote_rsync_cache]\n if local_rsync_cache.nil? || remote_rsync_cache.nil?\n throw \"to use rsync local_rsync_cache and remote_rsync_cache must be set\"\n end\n\n configuration.logger.debug \"rm -rf #{local_rsync_cache} && #{svn} export #{svn_username} -q -r#{configuration[:revision]} #{rep_path} #{local_rsync_cache}\"\n\n # update the local svn cache\n run_local(\n \n \"rm -rf #{local_rsync_cache}&& #{svn} export #{svn_username} -q -r#{configuration[:revision]} #{rep_path} #{local_rsync_cache}\"\n )\n\n # rsync with the remote machine(s)\n rcmd = 'rsync '\n # add rsync options\n %w{\n archive\n compress\n copy-links\n cvs-exclude\n delete-after\n no-blocking-io\n stats\n }.each { | opt | rcmd << \"--#{opt} \" }\n\n # excluded files and directories\n excludes= configuration[:rsync_excludes] || []\n excludes.each { |e| rcmd << \" --exclude \\\"#{e}\\\" \" }\n\n # for each server in current task\n actor.current_task.servers.each do |server|\n configuration.logger.debug \"RSyncing deployment cache for #{server}\"\n configuration.logger.debug \"#{rcmd} -e ssh #{local_rsync_cache}/ #{rsync_username}#{server}:#{remote_rsync_cache}/\"\n run_local(\"#{rcmd} -e ssh #{local_rsync_cache}/ #{rsync_username}#{server}:#{remote_rsync_cache}/\")\n end\n\n # copy the remote_rsync_cache on the remote machine as if it has been checked out there\n cmd=\"cp -a #{remote_rsync_cache}/ #{actor.release_path} && \"\n run_remote(actor, cmd)\n end",
"def backpackCargo _args\n \"backpackCargo _args;\" \n end",
"def debug(action, args = [])\n logger.debug \"action : #{action}\"\n logger.debug \"args : #{args.join(', ')}\" unless args.empty?\n logger.debug \"command: #{make_command(action, args)}\"\n end",
"def fetch_svn_commit(rev)\n url_str = bot.config['svn_root_url']\n commit = []\n begin\n @log.info \"checking #{url_str} for new commit...\"\n\n # https://username:password@svn.host.com:8080/svn/path/in/repo/\n url = Addressable::URI.parse(url_str)\n\n @log.debug PP.singleline_pp(url.to_hash, '')\n xmldata = `svn log --xml -v -r #{rev} #{url.omit(:user, :password)}`\n doc = REXML::Document.new(xmldata)\n \n doc.elements.inject('log/logentry', commit) do |commit, element|\n commit.push({:url => url}.merge(parse_entry_info(element)))\n end\n @log.debug PP.singleline_pp(commit, '')\n\n rescue Exception => e\n @log.error \"error connecting to svn: #{e.message}\"\n end\n return commit\n end",
"def run(args = [])\n opts = Slop.parse(args, help: true, suppress_errors: true) do |o|\n o.banner = \"Usage: zold merge [ID...] [options]\nAvailable options:\"\n o.bool '--skip-propagate',\n 'Don\\'t propagate after merge',\n default: false\n o.bool '--skip-legacy',\n 'Don\\'t make legacy transactions (older than 24 hours) immutable',\n default: false\n o.bool '--quiet-if-absent',\n 'Don\\'t fail if the wallet is absent',\n default: false\n o.integer '--depth',\n 'How many levels down we try to pull other wallets if their confirmations are required (default: 0)',\n default: 0\n o.bool '--allow-negative-balance',\n 'Don\\'t check for the negative balance of the wallet after the merge',\n default: false\n o.bool '--no-baseline',\n 'Don\\'t treat the highest score master copy as trustable baseline',\n default: false\n o.bool '--edge-baseline',\n 'Use any strongest group of nodes as baseline, even if there are no masters inside (dangerous!)',\n default: false\n o.string '--ledger',\n 'The name of the file where all new negative transactions will be recorded (default: /dev/null)',\n default: '/dev/null'\n o.string '--trusted',\n 'The name of the file with a list of wallet IDs we fully trust and won\\'t pull',\n default: '/dev/null'\n o.integer '--trusted-max',\n 'The maximum amount of trusted wallets we can see in the list',\n default: 128\n o.string '--network',\n 'The name of the network we work in',\n default: 'test'\n o.bool '--help', 'Print instructions'\n end\n mine = Args.new(opts, @log).take || return\n modified = []\n list = mine.empty? ? @wallets.all : mine.map { |i| Id.new(i) }\n list.uniq.each do |id|\n next unless merge(id, Copies.new(File.join(@copies, id)), opts)\n modified << id\n next if opts['skip-propagate']\n require_relative 'propagate'\n modified += Propagate.new(wallets: @wallets, log: @log).run(args)\n end\n modified\n end",
"def repo_url\n svn('info', '--xml')[/<url>(.*?)<\\/url>/, 1].strip\n end",
"def revision(host, scm, target, ref)\n args = []\n case scm\n when 'hg'\n args.push('update', 'clean', '-r', ref)\n when 'git'\n args.push('reset', '--hard', ref)\n else\n fail \"Unfortunately #{scm} is not supported yet\"\n end\n on host, \"cd #{target} && #{scm} #{args.flatten.join ' '}\"\nend",
"def run(args)\n safely_mkdir(MAIN_DIR)\n safely_mkdir(MOD_DIR)\n safely_mkdir(PACK_DIR)\n\n return HELP_TEXT if args.include?('-h') || args.include?('--help')\n return VERSION if args.include?('-v') || args.include?('--version')\n\n case args[0]\n when 'help'\n return HELP_COMMANDS[args[1].to_sym] if HELP_COMMANDS.key?(args[1].to_sym)\n return HELP_TEXT\n when 'fetch'\n return CommandFetch.run(args[1])\n when 'manifest'\n return CommandFetch.install_manifest(args[1])\n when 'installmod'\n return CommandInstall.run_mod(args[1])\n when 'installpack'\n return CommandInstall.run_pack(args[1]).to_s # remove\n else\n end\n end",
"def git\n\tend",
"def GitSimple(*args) # rubocop:disable Naming/MethodName\n GitSimple.new(*args)\nend",
"def vestItems _args\n \"vestItems _args;\" \n end",
"def do_docs_debug( task, args )\n\t\tself.prompt.say( \"Docs are published to:\", color: :bright_green )\n\t\tif ( publish_url = self.publish_to )\n\t\t\tself.prompt.say( self.indent(publish_url, 4) )\n\t\telse\n\t\t\tself.prompt.say( self.indent(\"n/a\"), color: :bright_yellow )\n\t\tend\n\t\tself.prompt.say( \"\\n\" )\n\tend",
"def test_book\n source = <<EOF\n[aliases]\nharry=Harry\nhewlett=Hugh\njoe=Joe\npackard=Packard\nsally=Sally\n[groups]\ncalc-developers = &harry, &sally, &joe\ncalc-owners = &hewlett, &packard\ncalc = @calc-developers, @calc-owners\n[calc:/branches/calc/bug-142]\nharry = rw\nsally = r\n# give sally write access only to the 'testing' subdir\n[calc:/branches/calc/bug-142/testing]\nsally = rw\n# deny harry\n[calc:/branches/calc/bug-142/secret]\nharry =\n[calendar:/projects/calendar]\n$anonymous = r\n$authenticated = rw\n# Any calc participant has read-write access...\n[calc:/projects/calc]\n@calc = rw\n# ...but only allow the owners to make and modify release tags.\n[calc:/projects/calc/tags]\n~@calc-owners = r\nEOF\n io = StringIO.new(source)\n @svnauthz.load(io)\n\n assert_equal(\"rw\",@svnauthz.permissions('harry','calc:/branches/calc/bug-142'))\n assert_equal(\"r\",@svnauthz.permissions('sally','calc:/branches/calc/bug-142'))\n assert_equal(\"rw\",@svnauthz.permissions('harry','calc:/branches/calc/bug-142/testing'))\n assert_equal(\"rw\",@svnauthz.permissions('sally','calc:/branches/calc/bug-142/testing'))\n assert_equal(\"\",@svnauthz.permissions('harry','calc:/branches/calc/bug-142/secret'))\n\n assert_equal(\"rw\",@svnauthz.permissions('anybody','calendar:/projects/calendar'))\n assert_equal(\"r\",@svnauthz.permissions(nil,'calendar:/projects/calendar'))\n devels = ['Harry', 'Sally', 'Joe']\n owners = ['Hugh', 'Packard']\n (devels+owners).each {|u| assert_equal(\"rw\",@svnauthz.permissions(u,'calc:/projects/calc'),\"#{u}\")}\n devels.each {|u| assert_equal(\"r\",@svnauthz.permissions(u,'calc:/projects/calc/tags'),\"#{u}\")}\n owners.each {|u| assert_equal(\"rw\",@svnauthz.permissions(u,'calc:/projects/calc/tags'),\"#{u}\")}\n end",
"def exchange_real_revision(config)\n \n # check if the scm_command exists if it is set\n if config[:scm_command] && !File.file?(config[:source].local.command)\n logger.important(\"Local scm command not found: #{config[:source].local.command}\")\n throw :abort_called_by_capistrano, :capistrano_abort\n end\n \n config.set(:real_revision) do\n config[:source].local.query_revision(config[:revision]) do |cmd| \n config.with_env(\"LC_ALL\", \"C\") do\n \n stdout_output = ''\n stderr_output = ''\n \n status = Open4::popen4(cmd) do |pid, stdin, stdout, stderr|\n stdin.close\n stdout_output = stdout.read.strip\n stderr_output = stderr.read.strip\n #logger.trace(\"LOCAL SCM OUT: #{stdout_output}\") unless stdout_output.blank?\n logger.important(\"LOCAL SCM ERROR: #{stderr_output}\") unless stderr_output.blank?\n end\n\n if status.exitstatus != 0 # Error\n logger.important(\"Local scm command failed\")\n \n # exit deployment in a hard way as no rollback is need (we never read the revision to deploy)\n # an alternative would be to raise Capistrano::Error, this would trigger a rollback\n throw :abort_called_by_capistrano, :capistrano_abort\n else # OK\n stdout_output\n end\n \n end\n end \n end\n\n end",
"def required_args_for_action\n args = []\n\n case action\n when 'deploy'\n args << :comments\n args << :path\n\n when 'version'\n args << :name\n args << :comments\n\n else\n # Noop\n end\n\n args\n end",
"def subcommand() __subcommand__ end",
"def checkout(actor)\n username = authorization\n if configuration[:repository_is_not_reachable_from_remote]\n if configuration[:use_rsync]\n do_local_checkout_and_rsync(username, actor)\n else\n do_local_checkout_and_send(username, actor)\n end\n else\n op = configuration[:checkout] || \"co\"\n command = \"#{svn(true)} #{op} #{username} -q -r#{configuration.revision} #{configuration.repository} #{actor.release_path} &&\"\n run_checkout(actor, command, &svn_stream_handler(actor))\n end\n\n end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def create\n @svn_module = SvnModule.new(params[:svn_module])\n\n respond_to do |format|\n if @svn_module.save\n format.html { redirect_to(@svn_module, :notice => 'Svn module was successfully created.') }\n format.xml { render :xml => @svn_module, :status => :created, :location => @svn_module }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @svn_module.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.80046654",
"0.70792806",
"0.65683395",
"0.6053351",
"0.5842421",
"0.58190924",
"0.5779616",
"0.56481946",
"0.5575322",
"0.55661416",
"0.5555579",
"0.5555579",
"0.55423915",
"0.55001616",
"0.5496722",
"0.5475467",
"0.54720044",
"0.5455578",
"0.54499626",
"0.54152143",
"0.53992337",
"0.5356859",
"0.53520775",
"0.5328337",
"0.52928114",
"0.52688545",
"0.5257233",
"0.5217612",
"0.5204941",
"0.52044344",
"0.5202497",
"0.51985615",
"0.5193871",
"0.51834124",
"0.5173421",
"0.5165295",
"0.51309854",
"0.51309156",
"0.512633",
"0.5092868",
"0.50819933",
"0.5077035",
"0.50664175",
"0.505477",
"0.50525826",
"0.50521183",
"0.50496376",
"0.5030005",
"0.50251186",
"0.5017552",
"0.5014568",
"0.5010372",
"0.49995318",
"0.49862528",
"0.49859035",
"0.49859035",
"0.49859035",
"0.49859035",
"0.498464",
"0.4981583",
"0.4973064",
"0.49659586",
"0.4961683",
"0.49433568",
"0.49375778",
"0.49341914",
"0.49293393",
"0.49241793",
"0.49168757",
"0.49133348",
"0.490426",
"0.48996824",
"0.48807478",
"0.4871954",
"0.48709968",
"0.48649442",
"0.4861946",
"0.48512033",
"0.48474944",
"0.4847448",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48393553",
"0.48356634"
] |
0.0
|
-1
|
GET /bbhks GET /bbhks.json
|
def index
@bbhks = Bbhk.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @kb = Kb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @kb }\n end\n end",
"def index\n @kbs = Kb.search(params[:q]).page(params[:page]).order(\"id desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @kbs }\n end\n end",
"def get_brandings\n request :get, \"/v3/brandings.json\"\n end",
"def index\n @boks = Bok.all\n end",
"def set_bbhk\n @bbhk = Bbhk.find(params[:id])\n end",
"def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend",
"def show\n @bb = Bb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bb }\n end\n end",
"def api_keys; rest_query(:api_key); end",
"def api_keys; rest_query(:api_key); end",
"def get_kyc_business_businesstoken_with_http_info(business_token, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: KycApi.get_kyc_business_businesstoken ...'\n end\n # verify the required parameter 'business_token' is set\n if @api_client.config.client_side_validation && business_token.nil?\n fail ArgumentError, \"Missing the required parameter 'business_token' when calling KycApi.get_kyc_business_businesstoken\"\n end\n # resource path\n local_var_path = '/kyc/business/{business_token}'.sub('{' + 'business_token' + '}', CGI.escape(business_token.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'start_index'] = opts[:'start_index'] if !opts[:'start_index'].nil?\n query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'KYCListResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"KycApi.get_kyc_business_businesstoken\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: KycApi#get_kyc_business_businesstoken\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def secretkey(apikey)\n get 'secretkey', {apikey: apikey} { |x| x['secretkey'] }\n end",
"def new\n @kb = Kb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @kb }\n end\n end",
"def api_keys\n rest_query(:api_key)\n end",
"def index\n @wks = Wk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wks }\n end\n end",
"def banks_get(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: BanksApi#banks_get ...\"\n end\n \n # resource path\n path = \"/banks\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = ['khipu']\n result = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BanksResponse')\n if Configuration.debugging\n Configuration.logger.debug \"API called: BanksApi#banks_get. Result: #{result.inspect}\"\n end\n return result\n end",
"def index\n @bikes = current_user.bikes\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bikes }\n end\n end",
"def get_from_url(conn, key, body)\n res = conn.get do | req |\n # req.headers['x-api-key'] = key\n req.body = body.to_json\n end\n JSON.parse(res.body)\n end",
"def index\n @abuckets = @account.abuckets\n @help = \"Bucket List\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @abuckets }\n end\n end",
"def index\n @khs = Kh.all\n end",
"def create\n @bbhk = Bbhk.new(bbhk_params)\n\n respond_to do |format|\n if @bbhk.save\n format.html { redirect_to @bbhk, notice: 'Bbhk was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bbhk }\n else\n format.html { render action: 'new' }\n format.json { render json: @bbhk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @ref_mkb = Ref::Mkb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ref_mkb }\n end\n end",
"def index\n @hks = Hk.all\n end",
"def index\n @breeding_pairs = current_user.breeding_pairs.all\n\n respond_to do |format|\n format.json { render json: @breeding_pairs }\n end\n end",
"def index\n @apikeys = Apikey.all\n end",
"def index\n @apikeys = Apikey.all\n end",
"def index\n @keyholders = Keyholder.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @keyholders }\n end\n end",
"def index\n @kembois = Kemboi.all\n end",
"def index\n @bucketlist_item = BucketlistItem.all\n # @bucketlist_item = @trip.bucketlist_item\n render json: @bucketlist_item\n end",
"def index\n @used_bikes = UsedBike.all\n\n render json: @used_bikes, each_serializer: Web::V1::UsedBikeSerializer\n end",
"def get_banks\n HTTParty.get(BASE_URI + 'bank?country=ghana',\n headers: HEADERS).parsed_response\n end",
"def show\n render \"api/v1/bounties/show\"\n end",
"def destroy\n @bbhk.destroy\n respond_to do |format|\n format.html { redirect_to bbhks_url }\n format.json { head :no_content }\n end\n end",
"def index\n @brags = Brag.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brags }\n end\n end",
"def list_api_keys(opts = {})\n @transporter.read(:GET, '/1/keys', {}, opts)\n end",
"def index\n @fw_baidu_maps = current_user.baidu_maps\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fw_baidu_maps }\n end\n end",
"def show\n @keyholder = Keyholder.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @keyholder }\n end\n end",
"def index\n @keys = Key.all\n render json: @keys\n end",
"def index\n url = \"https://data.cityofchicago.org/resource/x2n5-8w5q.json\"\n options = { :body => {:status => text}, :basic_auth => @auth }\n @response = HTTParty.get(url, options)\n\n @crime = Hash.new\n\n #@crime['block'] = @response[0]['block']\n @crime = @response\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gittos }\n end\n end",
"def show\n @bloom = Bloom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bloom }\n end\n end",
"def index\n @bemaps = Bemap.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bemaps }\n end\n end",
"def show\n keys = ApiKey.where(user_id: current_user.id)\n @apikeys = []\n keys.each do |key|\n @apikeys << {'access_token' => key.access_token, 'qr' => RQRCode::QRCode.new(key.access_token, :size => 4, :level => :h)}\n end\n end",
"def verify_api_key\n api_key = request.headers['HB-APIKey']\n if (api_key.nil?)\n api_key = params[:api_key]\n if api_key.nil?\n render :status => 403, :json => {:message => \"Api key missing\"}\n return\n end\n end\n \n api_key_object = ApiKey.find_by_key(api_key)\n if api_key_object.nil?\n render :status => 403, :json => {:message => 'Invalid API Key'}\n return\n end\n end",
"def create\n @kb = Kb.new(params[:kb])\n\n respond_to do |format|\n if @kb.save\n format.html { redirect_to @kb, :notice => 'Kb was successfully created.' }\n format.json { render :json => @kb, :status => :created, :location => @kb }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @kb.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def bbhk_params\n params.require(:bbhk).permit(:hall_size, :bed1_size, :bed2_size, :kitchen_size, :floor, :sold_out, :status)\n end",
"def show\n render :json => @secret_key.to_json({})\n end",
"def index\n @keys = ApiKey.where(user_id: current_user.id).order(id: :desc).page params[:page] # kaminari\n end",
"def get_buffer_data\n key = params[:key]\n redis = Redis.new\n if redis.exists(key)\n code = redis.get(key)\n msg = {\n status: 'OK',\n md5: key,\n code: code\n }\n else\n msg = { status: 'ERROR' }\n end\n respond_to do |format|\n format.json {render json: msg}\n end\n end",
"def index\n\t\tboats = Boat.all\n \trender json: boats, status: 200\n\tend",
"def bus_api(stpid, route)\n url_safe_stpid = URI.encode(stpid)\n url_safe_route = URI.encode(route)\n apiKey = \"UPGw2J5PBxNnF967CAMyHygeB\"\n apiLink = \"http://www.ctabustracker.com/bustime/api/v1/getpredictions?key=#{apiKey}&stpid=#{url_safe_stpid}&rt=#{url_safe_route}\"\n apiResults = open(apiLink).read\n return Hash.from_xml(apiResults)\n end",
"def find_bikes\n user_id = params[\"user_id\"]\n bike_ids = get_bike_ids(user_id)\n bikes = []\n bike_ids.each {|bike_id|\n bikes.push(get_bike(bike_id, user_id))\n }\n update_bike_database(bikes, user_id)\n render json: { new_bikes: bikes }\n end",
"def access_api(url)\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n file = File.open('bin/key.rb')\n request = Net::HTTP::Get.new(url)\n request[\"x-rapidapi-host\"] = 'skyscanner-skyscanner-flight-search-v1.p.rapidapi.com'\n request[\"x-rapidapi-key\"] = file.read\n\n response = http.request(request).read_body\n response_hash = JSON.parse(response) \nend",
"def keys\n JSON.parse get('/users/ssh_keys', :accept => 'json').to_s\n end",
"def index\n @swift_api_keys = SwiftApiKey.all\n end",
"def index\n # Retrieve kpis templates from impac api.\n # TODO: improve request params to work for strong parameters\n attrs = params.slice('metadata', 'opts')\n auth = { username: MnoEnterprise.tenant_id, password: MnoEnterprise.tenant_key }\n\n response = begin\n MnoEnterprise::ImpacClient.send_get('/api/v2/kpis', attrs, basic_auth: auth)\n rescue => e\n return render json: { message: \"Unable to retrieve kpis from Impac API | Error #{e}\" }\n end\n\n # customise available kpis\n kpis = (response['kpis'] || []).map do |kpi|\n kpi = kpi.with_indifferent_access\n kpi[:watchables].map do |watchable|\n kpi.merge(\n name: \"#{kpi[:name]} #{watchable.capitalize unless kpi[:name].downcase.index(watchable)}\".strip,\n watchables: [watchable],\n target_placeholders: {watchable => kpi[:target_placeholders][watchable]},\n )\n end\n end\n .flatten\n\n render json: { kpis: kpis }\n end",
"def list_checkout_keys\n CircleCi.request(conf, \"#{base_path}/checkout-key\").get\n end",
"def get(path) # code generated from moviedb website\n url = URI(\"#{HOST_URL}#{path}#{ENV['API_KEY']}\")\n response = Net::HTTP.get_response(url)\n begin\n response_hash = JSON.parse(response.read_body)\n return response_hash\n rescue\n {}\n end\n end",
"def show\n @kv = Kv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kv }\n end\n end",
"def index\n # only list current user's hangouts\n @hangouts = current_user.hangouts.order(\"start_date_time DESC\").page(params[:page]).per(10)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hangouts }\n end\n end",
"def index\n @bookmarks = Bookmark.all\n render json: { bookmarks: @bookmarks }, status: :ok\n end",
"def index\n @biddings = Bidding.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @biddings }\n end\n end",
"def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end",
"def default_bucket\n request(method: :get, path: '/v1/buckets')\n end",
"def index\n render json: current_user.api_keys.api.active, status: 200\n end",
"def fetchServerConfig()\n #Construct the URL for the request\n url = \"http://api.themoviedb.org/3/configuration?api_key=#{$apiKey}\"\n #Preform a restful reqeust for the data\n data = RestClient.get(url)\n #Parse the returned JSON and return it as a hash\n return JSON.parse(data)\nend",
"def show\n render json: @bike #serializer: Web::V1::BikeSerializer\n end",
"def api_key; end",
"def api_key; end",
"def index\n @wks = Wk.all\n end",
"def index\n @api_keys = ApiKey.includes(:user)\n end",
"def get(path)\n request = Net::HTTP::Get.new @uri.path+'/'+path\n request.basic_auth @api_key, ''\n request['User-Agent'] = USER_AGENT\n response = @https.request request\n JSON.parse response.body\n end",
"def show_page_api\n @url = 'https://api.coinmarketcap.com/v1/ticker/'\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n # converts response to a Ruby hash \n @show_crypto = JSON.parse(@response)\n end",
"def show\n render json: @used_bike, serializer: Web::V1::UsedBikeSerializer\n end",
"def show\n @bike = Bike.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bike }\n end\n end",
"def index\n @whiskeys = Whiskey.all\n end",
"def get_requests_by_business_key_with_http_info(key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AsynchronousJobsBPMApi.get_requests_by_business_key ...\"\n end\n # verify the required parameter 'key' is set\n if @api_client.config.client_side_validation && key.nil?\n fail ArgumentError, \"Missing the required parameter 'key' when calling AsynchronousJobsBPMApi.get_requests_by_business_key\"\n end\n if @api_client.config.client_side_validation && opts[:'status'] && !opts[:'status'].all?{|item| ['QUEUED', 'DONE', 'CANCELLED', 'ERROR', 'RETRYING', 'RUNNING'].include?(item)}\n fail ArgumentError, 'invalid value for \"status\", must include one of QUEUED, DONE, CANCELLED, ERROR, RETRYING, RUNNING'\n end\n # resource path\n local_var_path = \"/server/jobs/keys/{key}\".sub('{' + 'key' + '}', key.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'status'] = @api_client.build_collection_param(opts[:'status'], :multi) if !opts[:'status'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'RequestInfoInstanceList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AsynchronousJobsBPMApi#get_requests_by_business_key\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def hms_api_url\n 'https://' + settings.hms_hostname + '/hms/bb/token'\n end",
"def get_json_web_key_with_http_info(key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BlueOceanApi.get_json_web_key ...'\n end\n # verify the required parameter 'key' is set\n if @api_client.config.client_side_validation && key.nil?\n fail ArgumentError, \"Missing the required parameter 'key' when calling BlueOceanApi.get_json_web_key\"\n end\n # resource path\n local_var_path = '/jwt-auth/jwks/{key}'.sub('{' + 'key' + '}', key.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'String')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BlueOceanApi#get_json_web_key\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def getblockchaininfo\n @api.request 'getblockchaininfo'\n end",
"def show\n @apk_bin = ApkBin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apk_bin }\n end\n end",
"def index\n @secret_keys = SecretKey.all\n end",
"def show\n if params[:id].to_i != 0\n @bike = Bike.find_by_id(params[:id].to_i)\n end\n\n if @bike.nil?\n @bike = Bike.find_by(hash_code: params[:id].to_s) \n end\n\n if !@bike.nil?\n if @bike.hash_code.nil? and @bike.user == current_user\n @bike.hash_code = generate_hash\n @bike.save\n end\n\n @api = bike_index_api\n @bike_data = JSON.parse(@api.get(\"bikes/#{@bike.bike_index_uid}\").body)\n else\n redirect_to(:bikes_unverfied, alert: \"The bike you requested could not be found by that link or code.\")\n end\n end",
"def index\n @keys = Key.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @keys }\n end\n end",
"def keys\n doc = JSON.parse get('/api/v1/ssh_keys')\n doc[\"ssh_keys\"]\n end",
"def index # returns all bikes within a certain radius\n ## TODO: use coordinates later, when more campuses and bikes.\n # # defaults radius to half mile, and coordinate to requesting ip address\n # radius = params[:radius] ? params[:radius] : 0.5\n # coordinates = params[:coordinates] ? params[:coordinates] : request.location\n # puts coordinates\n # @bikes = Coordinate.near(coordinates, radius).joins(:bikes)\n @bikes = Bike.available\n render json: @bikes\n end",
"def show\n @whiskey = Whiskey.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @whiskey }\n format.xml { render :xml => @whiskey }\n end\n end",
"def get_keys\n access_key = USER_DATA[0].to_s.strip\n secret_access_key = USER_DATA[1].to_s.strip\n keys = { :access_key_id => access_key,\n :secret_access_key => secret_access_key}\nend",
"def scotch_blended\n puts \"Let's explore blended Scotch whiskies\"\n #call method to list whiskies for this particular type\n list_whiskies('c/304/blended-scotch-whisky?filter=true&rfdata=~size.76#productlist-filter')\n end",
"def show\n @ja_blocked_root = JaBlockedRoot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ja_blocked_root }\n end\n end",
"def index\n @klubs = Klub.all\n end",
"def list_my_buckets(s3)\n resp = s3.list_buckets()\n puts \"My buckets now are:\\n\\n\"\n\n resp.buckets.each do |bucket|\n puts bucket.name\n end\n\nend",
"def index\n @shop_section = ShopSection.find_by_short_url(\"brands\")\n @brands = Brand.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brands }\n end\n end",
"def search\n @google = Rails.application.secrets.google_api_key\n puts query[\"query\"]\n @response = HTTParty.get(\"https://www.googleapis.com/books/v1/volumes?q=#{query[\"query\"]}&key=#{@google}\")\n render json: {data: @response}\n end",
"def get_marketplace_bank_account\n Balanced::BankAccount.find(\"/v1/bank_accounts/BAj6sNNBdMp5WmY6PJ7sAu3\")\n end",
"def list_my_buckets(s3)\n resp = s3.list_buckets\n puts \"My buckets now are:\\n\\n\"\n\n resp.buckets.each do |bucket|\n puts bucket.name\n end\n\nend",
"def index\n @bocs = Boc.all_user(current_user.registry_id)\n end",
"def show\n @service_response = UserManagement::KycDetail::Get.new(params).perform\n format_service_response\n end",
"def get_wallet_key_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: WalletKeyApi.get_wallet_key_all_using_get ...'\n end\n # resource path\n local_var_path = '/wallet_key'\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'ascending'] = opts[:'ascending'] if !opts[:'ascending'].nil?\n query_params[:'get_latest'] = opts[:'get_latest'] if !opts[:'get_latest'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageWalletKeyResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WalletKeyApi#get_wallet_key_all_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def list_keychains(params: {})\n call :get, '/keychain', params\n end",
"def get_list_beshared_libraries\n JSON.parse(curl_get(\"beshared-repos/\").body_str)\n end",
"def keys\n IbmCloudRest.get \"#{@uri}/keys\"\n end"
] |
[
"0.6529878",
"0.6384841",
"0.62493914",
"0.61285436",
"0.60566956",
"0.60449934",
"0.5923724",
"0.5897469",
"0.5897469",
"0.5850435",
"0.5835839",
"0.57870173",
"0.5773025",
"0.57696986",
"0.57627964",
"0.5758721",
"0.57558113",
"0.57492137",
"0.5688765",
"0.56869996",
"0.5678906",
"0.56780505",
"0.566933",
"0.5632342",
"0.5632342",
"0.56299233",
"0.56126654",
"0.5612066",
"0.5601795",
"0.5600699",
"0.55990833",
"0.5570773",
"0.556901",
"0.55644715",
"0.5563151",
"0.55564636",
"0.5556347",
"0.5540515",
"0.5536211",
"0.55342543",
"0.55250514",
"0.5517902",
"0.5517092",
"0.5516555",
"0.5499757",
"0.5496248",
"0.54927707",
"0.5487401",
"0.54728484",
"0.54625106",
"0.54592156",
"0.5457747",
"0.5445317",
"0.54449445",
"0.5442031",
"0.5440574",
"0.5440378",
"0.5432081",
"0.54244703",
"0.5423066",
"0.5416926",
"0.54144764",
"0.5411314",
"0.53987104",
"0.5398167",
"0.5394727",
"0.5394727",
"0.53946733",
"0.5393601",
"0.53851646",
"0.5381176",
"0.5380567",
"0.5377215",
"0.53718626",
"0.5368567",
"0.53655547",
"0.5360991",
"0.53584987",
"0.5357639",
"0.5340403",
"0.5337313",
"0.5335503",
"0.53308564",
"0.53248334",
"0.532433",
"0.5323994",
"0.53233176",
"0.5319325",
"0.53083795",
"0.53024405",
"0.5294739",
"0.528335",
"0.52820253",
"0.52820146",
"0.52770776",
"0.52764344",
"0.52705956",
"0.5268613",
"0.52683955",
"0.5267937"
] |
0.6896141
|
0
|
GET /bbhks/1 GET /bbhks/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @kb = Kb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @kb }\n end\n end",
"def index\n @bbhks = Bbhk.all\n end",
"def index\n @kbs = Kb.search(params[:q]).page(params[:page]).order(\"id desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @kbs }\n end\n end",
"def show\n @bb = Bb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bb }\n end\n end",
"def get_brandings\n request :get, \"/v3/brandings.json\"\n end",
"def set_bbhk\n @bbhk = Bbhk.find(params[:id])\n end",
"def new\n @kb = Kb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @kb }\n end\n end",
"def index\n @boks = Bok.all\n end",
"def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend",
"def show\n render \"api/v1/bounties/show\"\n end",
"def show\n @bloom = Bloom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bloom }\n end\n end",
"def show\n @ref_mkb = Ref::Mkb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ref_mkb }\n end\n end",
"def index\n url = \"https://data.cityofchicago.org/resource/x2n5-8w5q.json\"\n options = { :body => {:status => text}, :basic_auth => @auth }\n @response = HTTParty.get(url, options)\n\n @crime = Hash.new\n\n #@crime['block'] = @response[0]['block']\n @crime = @response\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gittos }\n end\n end",
"def show\n @bike = Bike.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bike }\n end\n end",
"def index\n @bucketlist_item = BucketlistItem.all\n # @bucketlist_item = @trip.bucketlist_item\n render json: @bucketlist_item\n end",
"def show\n @kv = Kv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kv }\n end\n end",
"def index\n @wks = Wk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wks }\n end\n end",
"def show\n @keyholder = Keyholder.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @keyholder }\n end\n end",
"def show\n render json: @bike #serializer: Web::V1::BikeSerializer\n end",
"def index\n @brags = Brag.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brags }\n end\n end",
"def index\n @bikes = current_user.bikes\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bikes }\n end\n end",
"def banks_get(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: BanksApi#banks_get ...\"\n end\n \n # resource path\n path = \"/banks\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = ['khipu']\n result = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BanksResponse')\n if Configuration.debugging\n Configuration.logger.debug \"API called: BanksApi#banks_get. Result: #{result.inspect}\"\n end\n return result\n end",
"def show\n if params[:id].to_i != 0\n @bike = Bike.find_by_id(params[:id].to_i)\n end\n\n if @bike.nil?\n @bike = Bike.find_by(hash_code: params[:id].to_s) \n end\n\n if !@bike.nil?\n if @bike.hash_code.nil? and @bike.user == current_user\n @bike.hash_code = generate_hash\n @bike.save\n end\n\n @api = bike_index_api\n @bike_data = JSON.parse(@api.get(\"bikes/#{@bike.bike_index_uid}\").body)\n else\n redirect_to(:bikes_unverfied, alert: \"The bike you requested could not be found by that link or code.\")\n end\n end",
"def index\n @keyholders = Keyholder.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @keyholders }\n end\n end",
"def show\n @apk_bin = ApkBin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apk_bin }\n end\n end",
"def index\n @used_bikes = UsedBike.all\n\n render json: @used_bikes, each_serializer: Web::V1::UsedBikeSerializer\n end",
"def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end",
"def index\n\t\tboats = Boat.all\n \trender json: boats, status: 200\n\tend",
"def api_keys; rest_query(:api_key); end",
"def api_keys; rest_query(:api_key); end",
"def get_from_url(conn, key, body)\n res = conn.get do | req |\n # req.headers['x-api-key'] = key\n req.body = body.to_json\n end\n JSON.parse(res.body)\n end",
"def getbatteries\n puts params\n buildid = params[\"buildingid\"]\n\n batteries = Battery.where(:building_id => buildid)\n\n puts batteries.inspect\n puts \"#################################################\"\n \n respond_to do |format|\n format.json { render json: batteries }\n end\n end",
"def show\n bike = Bike.find(params[:id]);\n render json: {status: 'SUCCESS', message:'Loaded bike', data:bike}, status: :ok\n end",
"def index\n @bemaps = Bemap.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bemaps }\n end\n end",
"def show\n render json: @used_bike, serializer: Web::V1::UsedBikeSerializer\n end",
"def show\n @beer = BreweryDB.beer(params[:id]) \n render json: @beer\n end",
"def index\n @keys = Key.all\n render json: @keys\n end",
"def show\n @api_haiku = Api::Haiku.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @api_haiku }\n end\n end",
"def show\n @blast = Blast.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blast }\n end\n end",
"def index\n @biddings = Bidding.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @biddings }\n end\n end",
"def show\n @key = Key.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @key }\n end\n end",
"def get_bike(bikeID, userID)\n user = User.find_by(id: userID)\n authorize_time_check(user)\n response = RestClient.get('https://www.strava.com/api/v3/gear/'+bikeID, {Authorization: 'Bearer ' + user.access_token})\n bike = JSON.parse(response)\n end",
"def index\n @khs = Kh.all\n end",
"def show\n @bdatabase = Bdatabase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bdatabase }\n end\n end",
"def get_buffer_data\n key = params[:key]\n redis = Redis.new\n if redis.exists(key)\n code = redis.get(key)\n msg = {\n status: 'OK',\n md5: key,\n code: code\n }\n else\n msg = { status: 'ERROR' }\n end\n respond_to do |format|\n format.json {render json: msg}\n end\n end",
"def show\n @bruger = Bruger.find_by_id(current_user.id)\n @onske = Onske.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @onske }\n end\n end",
"def index\n @hks = Hk.all\n end",
"def show\n @load_balancer_check = LoadBalancerCheck.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @load_balancer_check }\n end\n end",
"def show\n @boat = Boat.find(params[:id])\n\n render json: @boat\n end",
"def index\n @breeding_pairs = current_user.breeding_pairs.all\n\n respond_to do |format|\n format.json { render json: @breeding_pairs }\n end\n end",
"def create\n @bbhk = Bbhk.new(bbhk_params)\n\n respond_to do |format|\n if @bbhk.save\n format.html { redirect_to @bbhk, notice: 'Bbhk was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bbhk }\n else\n format.html { render action: 'new' }\n format.json { render json: @bbhk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @baggage = Baggage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @baggage }\n end\n end",
"def show\n @lbc = Lbc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lbc }\n end\n end",
"def index\n @shop_section = ShopSection.find_by_short_url(\"brands\")\n @brands = Brand.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brands }\n end\n end",
"def show\n @facebook_blast = FacebookBlast.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @facebook_blast }\n end\n end",
"def index\n @abuckets = @account.abuckets\n @help = \"Bucket List\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @abuckets }\n end\n end",
"def index\n @super_bowl_picks = SuperBowlPick.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @super_bowl_picks }\n end\n end",
"def show\n @whiskey = Whiskey.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @whiskey }\n format.xml { render :xml => @whiskey }\n end\n end",
"def show\n @ja_blocked_root = JaBlockedRoot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ja_blocked_root }\n end\n end",
"def show\n @b = B.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @b }\n end\n end",
"def show\n @blocking_client = BlockingClient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blocking_client }\n end\n end",
"def get(path)\n request = Net::HTTP::Get.new @uri.path+'/'+path\n request.basic_auth @api_key, ''\n request['User-Agent'] = USER_AGENT\n response = @https.request request\n JSON.parse response.body\n end",
"def index\n @bookmarks = Bookmark.all\n render json: { bookmarks: @bookmarks }, status: :ok\n end",
"def index\n @fw_baidu_maps = current_user.baidu_maps\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fw_baidu_maps }\n end\n end",
"def show\n @begivenhed = Begivenhed.find(params[:id])\n @bruger = Bruger.find_by_id(current_user.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @begivenhed }\n end\n end",
"def get_kyc_business_businesstoken_with_http_info(business_token, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: KycApi.get_kyc_business_businesstoken ...'\n end\n # verify the required parameter 'business_token' is set\n if @api_client.config.client_side_validation && business_token.nil?\n fail ArgumentError, \"Missing the required parameter 'business_token' when calling KycApi.get_kyc_business_businesstoken\"\n end\n # resource path\n local_var_path = '/kyc/business/{business_token}'.sub('{' + 'business_token' + '}', CGI.escape(business_token.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'start_index'] = opts[:'start_index'] if !opts[:'start_index'].nil?\n query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'KYCListResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"KycApi.get_kyc_business_businesstoken\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: KycApi#get_kyc_business_businesstoken\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @hangout = Hangout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hangout }\n end\n end",
"def show\n @kisalli = Kisalli.find_by_key(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kisalli }\n end\n end",
"def index\n @apikeys = Apikey.all\n end",
"def index\n @apikeys = Apikey.all\n end",
"def index\n @keys = Key.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @keys }\n end\n end",
"def show\n @jobber = Jobber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jobber }\n end\n end",
"def default_bucket\n request(method: :get, path: '/v1/buckets')\n end",
"def get_banks\n HTTParty.get(BASE_URI + 'bank?country=ghana',\n headers: HEADERS).parsed_response\n end",
"def show\n @bowl = Bowl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bowl }\n end\n end",
"def show\n render json: @bike_type\n end",
"def show\n @bp = Bp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bp }\n end\n end",
"def index\n @bikes = Bike.all.order(\"display_order\")\n render json: @bikes.includes(:specifications) #each_serializer: Web::V1::BikeSerializer\n end",
"def index\n @keys = ApiKey.where(user_id: current_user.id).order(id: :desc).page params[:page] # kaminari\n end",
"def index\n # Retrieve kpis templates from impac api.\n # TODO: improve request params to work for strong parameters\n attrs = params.slice('metadata', 'opts')\n auth = { username: MnoEnterprise.tenant_id, password: MnoEnterprise.tenant_key }\n\n response = begin\n MnoEnterprise::ImpacClient.send_get('/api/v2/kpis', attrs, basic_auth: auth)\n rescue => e\n return render json: { message: \"Unable to retrieve kpis from Impac API | Error #{e}\" }\n end\n\n # customise available kpis\n kpis = (response['kpis'] || []).map do |kpi|\n kpi = kpi.with_indifferent_access\n kpi[:watchables].map do |watchable|\n kpi.merge(\n name: \"#{kpi[:name]} #{watchable.capitalize unless kpi[:name].downcase.index(watchable)}\".strip,\n watchables: [watchable],\n target_placeholders: {watchable => kpi[:target_placeholders][watchable]},\n )\n end\n end\n .flatten\n\n render json: { kpis: kpis }\n end",
"def show\n render :json => @secret_key.to_json({})\n end",
"def index\n @lbcs = Lbc.all\n @lbcs = Lbc.where(:section => 'A').order(\"id\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lbcs }\n end\n end",
"def index\n @kembois = Kemboi.all\n end",
"def show\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @loadbalancer }\n end\n end",
"def index\n if current_authkey.authkey.eql?(\"#fl0wk27er\")\n @batons = Baton.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @batons }\n end\n elsif current_authkey.authkey.eql?(\"#daneld2130\")\n redirect_to daniel_batons_path\n elsif current_authkey.authkey.eql?(\"#cassaj0105\")\n redirect_to casa_batons_path\n elsif current_authkey.authkey.eql?(\"#hulkh2051\")\n redirect_to hulk_batons_path\n elsif current_authkey.authkey.eql?(\"#genllt5055\")\n redirect_to think_batons_path\n else\n redirect_to root_path\n end\n end",
"def show\n @brewhouse = Brewhouse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brewhouse }\n end\n end",
"def get(key)\n response = request(:get, uri(key))\n if response.status == 200\n data = MultiJson.load(response.body)\n if data.is_a?(Array)\n data.each_with_object({}) do |e, acc|\n acc[e[S_KEY]] = e[S_VALUE]\n end\n else\n data[S_VALUE]\n end\n else\n nil\n end\n end",
"def show \n render json: @key\n end",
"def find_bikes\n user_id = params[\"user_id\"]\n bike_ids = get_bike_ids(user_id)\n bikes = []\n bike_ids.each {|bike_id|\n bikes.push(get_bike(bike_id, user_id))\n }\n update_bike_database(bikes, user_id)\n render json: { new_bikes: bikes }\n end",
"def destroy\n @bbhk.destroy\n respond_to do |format|\n format.html { redirect_to bbhks_url }\n format.json { head :no_content }\n end\n end",
"def show\n @blacklist = Blacklist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blacklist }\n end\n end",
"def show\n @bl = Bl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bl }\n end\n end",
"def secretkey(apikey)\n get 'secretkey', {apikey: apikey} { |x| x['secretkey'] }\n end",
"def index\n @buisnesses = Buisness.all\n\n render json: @buisnesses \n end",
"def show\n @basin = Basin.find(params[:id])\n\n @client = YahooWeather::Client.new \n @response = @client.fetch_by_location('Massingir, Gaza, Mz','c')\n @reponse2 = @client.fetch_by_location('Louis Trichardt, Limpopo, South Africa','c')\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @basin }\n\n end\n end",
"def show\n @service_response = UserManagement::KycDetail::Get.new(params).perform\n format_service_response\n end",
"def index\n @kids = Kid.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @kids }\n end\n end",
"def index\n @bids = Bid.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bids }\n end\n end",
"def new\n @kokyaku = Kokyaku.new\n @shobyo = Shobyo.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kokyaku }\n end\n end",
"def index\n @budgets = Budget.find_owned_by current_user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budgets }\n end\n end",
"def index\n @bills = @dwelling.bills\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bills }\n end\n end"
] |
[
"0.6844717",
"0.66777617",
"0.64586234",
"0.6373156",
"0.62842",
"0.6134402",
"0.6102686",
"0.6085675",
"0.60681903",
"0.6062093",
"0.6049354",
"0.6040844",
"0.59891576",
"0.5899847",
"0.5887247",
"0.5885147",
"0.5879753",
"0.5864894",
"0.5861494",
"0.58447564",
"0.584181",
"0.5829372",
"0.58025193",
"0.57916266",
"0.5771959",
"0.57641166",
"0.57627577",
"0.5761441",
"0.57554376",
"0.57554376",
"0.573184",
"0.5731627",
"0.5728965",
"0.5725845",
"0.5722606",
"0.57199943",
"0.571749",
"0.5699392",
"0.5697354",
"0.5687932",
"0.56846637",
"0.568313",
"0.56822497",
"0.56628865",
"0.5656713",
"0.5656023",
"0.5648377",
"0.56453276",
"0.564389",
"0.56437355",
"0.56413424",
"0.5640807",
"0.56321454",
"0.5618523",
"0.56183654",
"0.56151223",
"0.56129646",
"0.56094027",
"0.560386",
"0.56024396",
"0.55930054",
"0.5591904",
"0.5587812",
"0.5583591",
"0.5579419",
"0.5579184",
"0.55763614",
"0.557249",
"0.5564623",
"0.5564623",
"0.5562815",
"0.55570924",
"0.5555611",
"0.55548465",
"0.5553031",
"0.55529356",
"0.5551942",
"0.5549543",
"0.55483985",
"0.55480134",
"0.5535128",
"0.5529573",
"0.5521466",
"0.5518408",
"0.55144644",
"0.5513565",
"0.551167",
"0.5504986",
"0.5502798",
"0.5497859",
"0.54956234",
"0.5491349",
"0.549099",
"0.5490773",
"0.5487785",
"0.5484764",
"0.5481897",
"0.5481138",
"0.54779166",
"0.5473432",
"0.5471597"
] |
0.0
|
-1
|
POST /bbhks POST /bbhks.json
|
def create
@bbhk = Bbhk.new(bbhk_params)
respond_to do |format|
if @bbhk.save
format.html { redirect_to @bbhk, notice: 'Bbhk was successfully created.' }
format.json { render action: 'show', status: :created, location: @bbhk }
else
format.html { render action: 'new' }
format.json { render json: @bbhk.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @kb = Kb.new(params[:kb])\n\n respond_to do |format|\n if @kb.save\n format.html { redirect_to @kb, :notice => 'Kb was successfully created.' }\n format.json { render :json => @kb, :status => :created, :location => @kb }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @kb.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @kingsizeb = Kingsizeb.new(kingsizeb_params)\n\n respond_to do |format|\n if @kingsizeb.save\n format.html { redirect_to @kingsizeb, notice: 'Kingsizeb was successfully created.' }\n format.json { render :show, status: :created, location: @kingsizeb }\n else\n format.html { render :new }\n format.json { render json: @kingsizeb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def bbhk_params\n params.require(:bbhk).permit(:hall_size, :bed1_size, :bed2_size, :kitchen_size, :floor, :sold_out, :status)\n end",
"def post_to_url(conn, key, body)\n res = conn.post do | req |\n # req.headers['x-api-key'] = key\n req.body = body.to_json\n end\n JSON.parse(res.body)\n end",
"def create\n @pmkb = Pmkb.new(pmkb_params)\n\n respond_to do |format|\n if @pmkb.save\n format.html { redirect_to @pmkb, notice: 'Pmkb was successfully created.' }\n format.json { render :show, status: :created, location: @pmkb }\n else\n format.html { render :new }\n format.json { render json: @pmkb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bark = current_user.barks.build(bark_params)\n\n respond_to do |format|\n if @bark.save\n format.html { redirect_to root_path, notice: \"Bark was successfully created.\" }\n format.json { render :show, status: :created, location: @bark }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @bark.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_bbhk\n @bbhk = Bbhk.find(params[:id])\n end",
"def create\n @bok = Bok.new(bok_params)\n\n respond_to do |format|\n if @bok.save\n format.html { redirect_to @bok, notice: 'Bok was successfully created.' }\n format.json { render :show, status: :created, location: @bok }\n else\n format.html { render :new }\n format.json { render json: @bok.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @hk = Hk.new(hk_params)\n\n respond_to do |format|\n if @hk.save\n format.html { redirect_to @hk, notice: 'Hk was successfully created.' }\n format.json { render action: 'show', status: :created, location: @hk }\n else\n format.html { render action: 'new' }\n format.json { render json: @hk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bike_rack = BikeRack.new(bike_rack_params)\n\n respond_to do |format|\n if @bike_rack.save\n flash[:success] = 'Bike rack was successfully created.'\n format.html { redirect_to @bike_rack }\n format.json { render :show, status: :created, location: @bike_rack }\n else\n flash[:danger] = 'There was a problem with creating Bike rack.'\n format.html { render :new }\n format.json { render json: @bike_rack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @kb = Kb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @kb }\n end\n end",
"def create\n @bb = Bb.new(bb_params)\n\n respond_to do |format|\n if @bb.save\n format.html { redirect_to @bb, notice: 'Bb was successfully created.' }\n format.json { render :show, status: :created, location: @bb }\n else\n format.html { render :new }\n format.json { render json: @bb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bb = Bb.new(params[:bb])\n\n respond_to do |format|\n if @bb.save\n format.html { redirect_to @bb, notice: 'Bb was successfully created.' }\n format.json { render json: @bb, status: :created, location: @bb }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @spkj_bsb = SpkjBsb.new(params[:spkj_bsb])\n # @spkj_bsb.tname=current_user.name\n @spkj_bsb.user_id = current_user.id\n @spkj_bsb.uid = current_user.uid\n @spkj_bsb.sp_s_52=current_user.user_s_province\n @spkj_bsb.sp_i_state=1\n @spkj_bsb.save\n respond_to do |format|\n format.html { redirect_to(\"/spkj_bsbs\") }\n format.json { render json: @spkj_bsb }\n end\n end",
"def create\n @secret_key = SecretKey.new(secret_key_params)\n\n respond_to do |format|\n if @secret_key.save\n #format.html { redirect_to @secret_key, notice: 'Secret key was successfully created.' }\n format.json { render :json=> @secret_key.to_json({}) }\n else\n format.html { render action: 'new' }\n format.json { render json: @secret_key.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @whiskey = Whiskey.new(whiskey_params)\n\n respond_to do |format|\n if @whiskey.save\n format.html { redirect_to @whiskey, notice: \"Whiskey was successfully created.\" }\n format.json { render :show, status: :created, location: @whiskey }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @whiskey.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @bbhk.destroy\n respond_to do |format|\n format.html { redirect_to bbhks_url }\n format.json { head :no_content }\n end\n end",
"def index\n @bbhks = Bbhk.all\n end",
"def create\n @ref_mkb = Ref::Mkb.new(params[:ref_mkb])\n\n respond_to do |format|\n if @ref_mkb.save\n format.html { redirect_to @ref_mkb, notice: 'Mkb was successfully created.' }\n format.json { render json: @ref_mkb, status: :created, location: @ref_mkb }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ref_mkb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_bucket(bucket_key,access_token)\n response = RestClient.post(\"#{API_URL}/oss/v2/buckets\",\n { bucketKey: bucket_key, policyKey:'transient'}.to_json,\n { Authorization: \"Bearer #{access_token}\", content_type:'application/json' })\n return response\nend",
"def create body = {}\n @connection.request(method: :post, path: \"/secrets/create\", headers: {\"Content-Type\": \"application/json\"}, body: body.to_json)\n end",
"def send(key)\n HTTParty.post(@add_url, {\n :headers => {\n \"Content-Type\" => \"application/json; charset=UTF8\",\n \"X-Accept\" => \"application/json\"\n },\n :body => {\n #:url => formatted[:url],\n :url => \"https://www.engadget.com/2016/10/09/more-galaxy-note-7-replacement-fires/\",\n #:tags => formatted[:tags],\n :consumer_key => ENV['POCKET_CONSUMER_KEY'],\n :access_token => key\n }.to_json\n })\n end",
"def create\n @key = Key.new(key_params)\n\n if @key.save\n render json: @key, status: :created, location: api_key_url(@key)\n else\n render json: @key.errors, status: :unprocessable_entity\n end\n end",
"def create\n whiskeyParams = params[:whiskey]\n\n if !whiskeyParams.has_key?(:distillery) and whiskeyParams.has_key?(:distillery_id)\n distillery = Distillery.find(whiskeyParams[:distillery_id])\n whiskeyParams[:distillery] = distillery\n whiskeyParams.delete(:distillery_id)\n end\n\n if !whiskeyParams.has_key?(:category) and whiskeyParams.has_key?(:category_id)\n category = Category.find(whiskeyParams[:category_id])\n whiskeyParams[:category] = category\n whiskeyParams.delete(:category_id)\n end\n\n @whiskey = Whiskey.new(whiskeyParams)\n\n respond_to do |format|\n if @whiskey.save\n format.html { redirect_to @whiskey, :notice => 'Whiskey was successfully created.' }\n format.json { render :json => @whiskey, :status => :created, :location => @whiskey }\n format.xml { render :xml => @whiskey, :status => :created, :location => @whiskey }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @whiskey.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @whiskey.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @boook = Boook.new(boook_params)\n\n respond_to do |format|\n if @boook.save\n format.html { redirect_to @boook, notice: 'Boook was successfully created.' }\n format.json { render :show, status: :created, location: @boook }\n else\n format.html { render :new }\n format.json { render json: @boook.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bnpb = Bnpb.new(bnpb_params)\n\n respond_to do |format|\n if @bnpb.save\n format.html { redirect_to @bnpb, notice: 'Bnpb was successfully created.' }\n format.json { render :show, status: :created, location: @bnpb }\n else\n format.html { render :new }\n format.json { render json: @bnpb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def bark_params\n params.require(:bark).permit(:bark)\n end",
"def create\n @kemboi = Kemboi.new(kemboi_params)\n\n respond_to do |format|\n if @kemboi.save\n format.html { redirect_to @kemboi, notice: 'Kemboi was successfully created.' }\n format.json { render action: 'show', status: :created, location: @kemboi }\n else\n format.html { render action: 'new' }\n format.json { render json: @kemboi.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @apikey = Apikey.new(apikey_params)\n\n respond_to do |format|\n if @apikey.save\n format.html { redirect_to @apikey, notice: \"Apikey was successfully created.\" }\n format.json { render :show, status: :created, location: @apikey }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @apikey.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @oncokb = Oncokb.new(oncokb_params)\n\n respond_to do |format|\n if @oncokb.save\n format.html { redirect_to @oncokb, notice: 'Oncokb was successfully created.' }\n format.json { render :show, status: :created, location: @oncokb }\n else\n format.html { render :new }\n format.json { render json: @oncokb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @kebab = Kebab.new(params[:kebab])\n\n respond_to do |format|\n if @kebab.save\n flash[:notice] = 'Kebab was successfully created.'\n format.html { redirect_to(kebabs_url) }\n format.xml { render :xml => @kebab, :status => :created, :location => @kebab }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @kebab.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @kh = Kh.new(kh_params)\n\n respond_to do |format|\n if @kh.save\n format.html { redirect_to @kh, notice: 'Kh was successfully created.' }\n format.json { render :show, status: :created, location: @kh }\n else\n format.html { render :new }\n format.json { render json: @kh.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_api_key\n wait_until_bus_section_load\n locator = \"//a[text()='(create)']\"\n find_any = api_key_div.all(:xpath, locator)\n if find_any.size > 0\n api_key_div.find(:xpath, locator).click\n wait_until_bus_section_load\n end\n end",
"def create\n @bike = Bike.new(params.permit(:bike_index_uid, :user_id))\n @bike.hash_code = generate_hash\n\n respond_to do |format|\n if @bike.save\n format.html { redirect_to @bike, notice: 'Your bike is now verified!' }\n format.json { render :show, status: :created, location: @bike }\n else\n format.html { render :new }\n format.json { render json: @bike.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bookkeeping = @group.bookkeepings.new()\n @bookkeeping.attributes = bookkeeping_params\n @bookkeeping.writer_id = current_user.id\n if @bookkeeping.save\n render json: @bookkeeping, status: :created, location: @bookkeeping\n else\n render json: @bookkeeping.errors, status: :unprocessable_entity\n end\n end",
"def bell_params\n params.require(:bell).permit(:name, :trigger, :admin_hash, :logo, :background, :enabled, :request_body, :request_type, :authorization_header)\n end",
"def api_post(action, data, binary_key = nil)\n api_request(action, data, 'POST', binary_key)\n end",
"def create\n megam_rest.post_marketplaceapp(to_hash)\n end",
"def create\n megam_rest.post_marketplaceapp(to_hash)\n end",
"def create\n @swift_api_key = SwiftApiKey.new(swift_api_key_params)\n\n respond_to do |format|\n if @swift_api_key.save\n format.html { redirect_to @swift_api_key, notice: 'Swift api key was successfully created.' }\n format.json { render :show, status: :created, location: @swift_api_key }\n else\n format.html { render :new }\n format.json { render json: @swift_api_key.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @boc = Boc.new(boc_params)\n\n respond_to do |format|\n if @boc.save\n format.html { redirect_to new_boc_path, notice: 'Boc was successfully created.' }\n format.json { render :show, status: :created, location: @boc }\n else\n format.html { render :new }\n format.json { render json: @boc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_branding(params)\n request :post, \"/v3/brandings.json\", params\n end",
"def create\n @kv = Kv.new(params[:kv])\n\n respond_to do |format|\n if @kv.save\n format.html { redirect_to @kv, notice: 'Kv was successfully created.' }\n format.json { render json: @kv, status: :created, location: @kv }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add(params)\n headers = {\n 'Cookie' => @context[:koha_rest_api_cookie],\n 'Content-Type' => 'application/json'\n }\n\n http = Net::HTTP.new(\"xkoha\", 8081)\n uri = URI(intranet(:koha_rest_api) + \"holds\")\n res = http.post(uri, params.to_json, headers)\n expect(res.code).to eq(\"201\"), \"got unexpected #{res.code} when adding hold.\\nResponse body: #{res.body}\"\n res.body\n end",
"def kemboi_params\n params.require(:kemboi).permit(:name, :address)\n end",
"def whiskey_params\n params.require(:whiskey).permit(:brand, :name, :type, :abv)\n end",
"def create(bin_params)\n @rest.post('save', bin_params)\n end",
"def create\n @android_ng_bayan = AndroidNgBayan.new(android_ng_bayan_params)\n\n respond_to do |format|\n if @android_ng_bayan.save\n format.html { redirect_to @android_ng_bayan, notice: 'Android ng bayan was successfully created.' }\n format.json { render :show, status: :created, location: @android_ng_bayan }\n else\n format.html { render :new }\n format.json { render json: @android_ng_bayan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @api_key = ApiKey.new(api_key_params)\n\n respond_to do |format|\n if @api_key.save\n format.html { redirect_to [:admin, @api_key], notice: 'Api key was successfully created.' }\n format.json { render :show, status: :created, location: @api_key }\n else\n format.html { render :new }\n format.json { render json: @api_key.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @kv = Kv.new(kv_params)\n\n respond_to do |format|\n if @kv.save\n format.html { redirect_to @kv, notice: 'Kv was successfully created.' }\n format.json { render :show, status: :created, location: @kv }\n else\n format.html { render :new }\n format.json { render json: @kv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @klub = Klub.new(klub_params)\n\n respond_to do |format|\n if @klub.save\n format.html { redirect_to @klub, notice: 'Klub was successfully created.' }\n format.json { render :show, status: :created, location: @klub }\n else\n format.html { render :new }\n format.json { render json: @klub.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ja_blocked_root = JaBlockedRoot.new(params[:ja_blocked_root])\n\n respond_to do |format|\n if @ja_blocked_root.save\n format.html { redirect_to @ja_blocked_root, notice: 'Ja blocked root was successfully created.' }\n format.json { render json: @ja_blocked_root, status: :created, location: @ja_blocked_root }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ja_blocked_root.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n megam_rest.post_appdefn(to_hash)\n end",
"def create\n megam_rest.post_appreq(to_hash)\n end",
"def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend",
"def create\n @deploy_heroku_api_key = DeployHerokuApiKey.new(params[:deploy_heroku_api_key])\n\n @deploy_heroku_api_key.encrypt_key_content(params[:value])\n\n respond_to do |format|\n if @deploy_heroku_api_key.save\n format.html { redirect_to @deploy_heroku_api_key, notice: 'Heroku key was successfully created.' }\n format.json { render json: @deploy_heroku_api_key, status: :created, location: @deploy_heroku_api_key }\n else\n format.html { render action: \"new\" }\n format.json { render json: @deploy_heroku_api_key.errors, status: :unprocessable_entity }\n end\n end\n end",
"def bb_params\n params.require(:bb).permit(:name, :mem_no)\n end",
"def create\n @baka_account = BakaAccount.new(baka_account_params)\n\n respond_to do |format|\n if @baka_account.save\n format.html { redirect_to @baka_account, notice: 'Baka account was successfully created.' }\n format.json { render :show, status: :created, location: @baka_account }\n else\n format.html { render :new }\n format.json { render json: @baka_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @breeding_pair = current_user.breeding_pair.new(params[:breeding_pair])\n\n respond_to do |format|\n if @breeding_pair.save\n format.json { render json: @breeding_pair, status: :created, location: @breeding_pair }\n else\n format.json { render json: @breeding_pair.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tssk = Tssk.new(tssk_params)\n\n respond_to do |format|\n if @tssk.save\n format.html { redirect_to @tssk, notice: 'Tssk was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tssk }\n else\n format.html { render action: 'new' }\n format.json { render json: @tssk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @kandc = Kandc.new(kandc_params)\n\n respond_to do |format|\n if @kandc.save\n format.html { redirect_to @kandc, notice: 'Kandc was successfully created.' }\n format.json { render :show, status: :created, location: @kandc }\n else\n format.html { render :new }\n format.json { render json: @kandc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cat_blok = CatBlok.new(cat_blok_params)\n\n respond_to do |format|\n if @cat_blok.save\n format.html { redirect_to cat_bloks_url, notice: 'Cat blok was successfully created.' }\n format.json { render :show, status: :created, location: @cat_blok }\n else\n format.html { render :new }\n format.json { render json: @cat_blok.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tboat = Boat.new(boat_params)\n \tif boat.save\n \t\trender json: boat, status: 201\n \tend\n\tend",
"def pmkb_params\n params.require(:pmkb).permit(:gene_symbol, :gene_hgnc_id, :entrez_gene_id, :ref_seq_accession, :tumor_types, :tissue_types, :variants, :tier, :intepretations)\n end",
"def create\n @apikey = Apikey.new(apikey_params)\n\n respond_to do |format|\n if @apikey.save\n format.html { redirect_to @apikey, notice: 'API key was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end",
"def create\n @bookmark = Bookmark.new(params[:bookmark])\n# req = ActiveSupport::JSON.decode(request.body)\n# @bookmark = Bookmark.new(req)\n\n respond_to do |format|\n if @bookmark.save\n format.html { redirect_to @bookmark, notice: 'Bookmark was successfully created.' }\n format.json { render json: @bookmark, status: :created, location: @bookmarks }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @api_haiku = Api::Haiku.new(params[:api_haiku])\n\n respond_to do |format|\n if @api_haiku.save\n format.html { redirect_to @api_haiku, notice: 'Haiku was successfully created.' }\n format.json { render json: @api_haiku, status: :created, location: @api_haiku }\n else\n format.html { render action: \"new\" }\n format.json { render json: @api_haiku.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submit_work_json(block_header:)\n client.make_request('/submit-work-json', 'post', params: {block_header: block_header})\n end",
"def create body = {}\n @connection.request(method: :post, path: \"/configs/create\", headers: {\"Content-Type\": \"application/json\"}, body: body.to_json)\n end",
"def create\n @bokin = Bokin.new(params[:bokin])\n \n @bokin.name = current_user.name\n @bokin.photourl = current_user.screen_name\n \n \n respond_to do |format|\n if @bokin.save\n format.html { redirect_to @bokin, :notice => 'Bokin was successfully created.' }\n format.json { render :json => @bokin, :status => :created, :location => @bokin }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @bokin.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def data_to_api(snack_name, snack_location, snack_optional)\n RestClient.post ENV['NERDERY_API'], { name: snack_name,\n location: snack_location,\n optional: snack_optional\n }.to_json, content_type: :json\n end",
"def create\n @apikey = current_user.apikeys.build(apikey_params)\n if @apikey.save\n flash[:success] = \"Du har registrerat en ny applikation.\"\n else\n flash[:danger] = \"Du måste namnge din applikation.\"\n end\n \n #this redirects user to page that\n #issued create\n redirect_to request.referrer || root_url\n end",
"def create\n @keyholder = Keyholder.new(params[:keyholder])\n\n respond_to do |format|\n if @keyholder.save\n format.html { redirect_to @keyholder, notice: 'Keyholder was successfully created.' }\n format.json { render json: @keyholder, status: :created, location: @keyholder }\n else\n format.html { render action: \"new\" }\n format.json { render json: @keyholder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @boat = Boat.new(boat_params)\n\n if @boat.save\n render json: @boat, status: :created, location: @boat\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end",
"def create\n @sambok = Sambok.new(sambok_params)\n\n respond_to do |format|\n if @sambok.save\n format.html { redirect_to @sambok, notice: 'Sambok was successfully created.' }\n format.json { render :show, status: :created, location: @sambok }\n else\n format.html { render :new }\n format.json { render json: @sambok.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @kazoku = Kazoku.new(params[:kazoku])\n\n respond_to do |format|\n if @kazoku.save\n format.html { redirect_to @kazoku, :notice => 'Kazoku was successfully created.' }\n format.json { render :json => @kazoku, :status => :created, :location => @kazoku }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @kazoku.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @bounty = Bounty.new(bounty_params)\n\n respond_to do |format|\n if @bounty.save\n format.html { redirect_to @bounty, notice: 'Bounty was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bounty }\n else\n format.html { render action: 'new' }\n format.json { render json: @bounty.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if !@karyalay_list.nil?\n @karyalay_attribute = KaryalayAttribute.new(karyalay_attribute_params)\n @karyalay_attribute.karyalay_list = @karyalay_list\n if @karyalay_attribute.save\n render json: @karyalay_attribute\n else\n render json: { id: nil,\n message: 'Karyalay Attributes Not Saved, Try Again' }\n end\n else\n render json: { id: nil, message: 'Karyalay Not Found, Try Again' }\n end\n end",
"def create\n @cetak_blok = CetakBlok.new(cetak_blok_params)\n\n respond_to do |format|\n if @cetak_blok.save\n format.html { redirect_to cetak_bloks_url, notice: 'Cetak blok was successfully created.' }\n format.json { render :show, status: :created, location: @cetak_blok }\n else\n format.html { render :new }\n format.json { render json: @cetak_blok.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @customerbranch = Customerbranch.new(customerbranch_params.map{|k,v| {k.to_sym => v.class == ActionController::Parameters ? [v.to_hash] : v.to_s}}.reduce({}, :merge))\n\n respond_to do |format|\n if @customerbranch.save\n format.html { redirect_to @customerbranch, notice: 'Customerbranch was successfully created.' }\n format.json { render :show, status: :created, location: @customerbranch }\n else\n format.html { render :new }\n format.json { render json: @customerbranch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_request(options, path, post_data)\n\n result = {}\n\n http = Net::HTTP.new(ENV['NESSUS_HOST'], options[:port])\n http.use_ssl = @use_ssl\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n http.start do |http|\n req = Net::HTTP::Post.new(path)\n\n req['X-ApiKeys'] = \"accessKey=#{ENV['NESSUS_ACCESS_KEY']}; secretKey=#{ENV['NESSUS_SECRET_KEY']}\"\n req.body = post_data\n \n resp, data = http.request(req)\n \n if resp.code.eql? '200'\n #print \"Data: \" + JSON.pretty_generate(JSON.parse(resp.body.to_s))\n result = JSON.parse(resp.body.to_s)\n else\n puts \"Error: \" + resp.code.to_s + \"\\n\" + resp.body\n end\n end\n\n return result\n end",
"def create\n @bowl = Bowl.new(params[:bowl])\n \n # set the current user's id and the creation time for this bowl\n @bowl.user_id = session[:user].userid.to_i\n @bowl.created = Time.now\n \n respond_to do |format|\n if @bowl.save\n\n Rails.logger.info \"Adding contents for bowl\"\n \n params.keys.each do |param|\n if param.start_with?(\"input_\") and (params[param] != \"\") \n @bowl.contents.create(:bowl_id => @bowl.id, :dryfruit_id => param[6, 2], :quantity => params[param]) \n end\n end\n \n format.html { redirect_to bowls_path, :notice => 'Bowl was successfully created.' }\n format.json { render :json => @bowl, :status => :created, :location => @bowl }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @bowl.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_recipe_request(version, auth_headers, data = {})\n post \"/api/recipes\", params: data, headers: {'Content-Type' => \"application/json\", 'Accept' => \"application/vnd.ink.#{version}\" }.merge(auth_headers)\nend",
"def create\n @kadai = Kadai.new(kadai_params)\n\n respond_to do |format|\n if @kadai.save\n format.html { redirect_to @kadai, notice: 'Kadai was successfully created.' }\n format.json { render :show, status: :created, location: @kadai }\n else\n format.html { render :new }\n format.json { render json: @kadai.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @beta_sign_up = BetaSignUp.new(params[:beta_sign_up])\n\n respond_to do |format|\n if @beta_sign_up.save\n format.html { redirect_to @beta_sign_up, notice: 'Beta sign up was successfully created.' }\n format.json { render json: @beta_sign_up, status: :created, location: @beta_sign_up }\n else\n format.html { render action: \"new\" }\n format.json { render json: @beta_sign_up.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_check(excon, body)\n excon.request(\n method: :post,\n path: '/check',\n headers: { 'Content-Type' => 'application/json' },\n body: body\n )\nend",
"def create\n @user_push_key = UserPushKey.new(user_push_key_params)\n\n respond_to do |format|\n if @user_push_key.save\n format.html { redirect_to @user_push_key, notice: 'User push key was successfully created.' }\n format.json { render :show, status: :created, location: @user_push_key }\n else\n format.html { render :new }\n format.json { render json: @user_push_key.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @keyholder = Keyholder.new(keyholder_params)\n @user = current_user\n\n respond_to do |format|\n if @keyholder.save\n format.html { redirect_to @keyholder, notice: 'Keyholder was successfully created.' }\n format.json { render action: 'show', status: :created, location: @keyholder }\n else\n format.html { render action: 'new' }\n format.json { render json: @keyholder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bahan = Bahan.new(params[:bahan])\n\n respond_to do |format|\n if @bahan.save\n format.html { redirect_to @bahan, notice: 'Bahan was successfully created.' }\n format.json { render json: @bahan, status: :created, location: @bahan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bahan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def httppost(url, corpNum, postData, action = '', userID = '', contentsType = '')\n\n headers = {\n \"x-lh-version\" => KAKAOCERT_APIVersion,\n \"Accept-Encoding\" => \"gzip,deflate\",\n }\n\n apiServerTime = @linkhub.getTime(@useStaticIP, @useGAIP)\n\n hmacTarget = \"POST\\n\"\n hmacTarget += Base64.strict_encode64(Digest::SHA256.digest(postData)) + \"\\n\"\n hmacTarget += apiServerTime + \"\\n\"\n\n hmacTarget += KAKAOCERT_APIVersion + \"\\n\"\n\n key = Base64.decode64(@linkhub._secretKey)\n\n data = hmacTarget\n digest = OpenSSL::Digest.new(\"sha256\")\n hmac = Base64.strict_encode64(OpenSSL::HMAC.digest(digest, key, data))\n\n headers[\"x-kc-auth\"] = @linkhub._linkID+' '+hmac\n headers[\"x-lh-date\"] = apiServerTime\n\n if contentsType == ''\n headers[\"Content-Type\"] = \"application/json; charset=utf8\"\n else\n headers[\"Content-Type\"] = contentsType\n end\n\n headers[\"Authorization\"] = \"Bearer \" + getSession_Token(corpNum)\n\n\n uri = URI(getServiceURL() + url)\n\n https = Net::HTTP.new(uri.host, 443)\n https.use_ssl = true\n Net::HTTP::Post.new(uri)\n\n res = https.post(uri.request_uri, postData, headers)\n\n if res.code == \"200\"\n if res.header['Content-Encoding'].eql?('gzip')\n JSON.parse(gzip_parse(res.body))\n else\n JSON.parse(res.body)\n end\n else\n raise KakaocertException.new(JSON.parse(res.body)[\"code\"],\n JSON.parse(res.body)[\"message\"])\n end\n end",
"def create\n @epembash = Epembash.new(epembash_params)\n\n respond_to do |format|\n if @epembash.save\n format.html { redirect_to @epembash, notice: 'Epembash was successfully created.' }\n format.json { render action: 'show', status: :created, location: @epembash }\n else\n format.html { render action: 'new' }\n format.json { render json: @epembash.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @key = Key.new(params[:key])\n\n respond_to do |format|\n if @key.save\n format.html { redirect_to @key, notice: 'Key was successfully created.' }\n format.json { render json: @key, status: :created, location: @key }\n else\n format.html { render action: \"new\" }\n format.json { render json: @key.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @api_key = ApiKey.new(:user => current_user)\n respond_to do |format|\n if @api_key.save\n format.html { redirect_to(api_keys_url, :notice => 'Snippet was successfully created.') }\n format.xml { render :xml => @api_key, :status => :created, :location => @api_key }\n format.json { render :json => @api_key, :status => :created, :location => @api_key }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @api_key.errors, :status => :unprocessable_entity }\n format.json { render :json => @api_key.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_group_set(name, self_signup)\n @url = \"http://#{$canvas_host}/api/v1/courses/#{$canvas_course_id}/group_categories\"\n puts \"@url is #{@url}\"\n\n if self_signup == true\n @payload={'name': name, \n 'self_signup': 'enabled'}\n puts(\"@payload is #{@payload}\")\n\n @postResponse = HTTParty.post(@url, :body => @payload.to_json, :headers => $header )\n puts(\" POST to create group set has Response.code #{@postResponse.code} and postResponse is #{@postResponse}\") \n else \n @payload={'name': name}\n puts(\"@payload is #{@payload}\")\n\n @postResponse = HTTParty.post(@url, :body => @payload.to_json, :headers => $header )\n puts(\" POST to create group set has Response.code #{@postResponse.code} and postResponse is #{@postResponse}\")\n end\nend",
"def add_key(key)\n post(\"/users/ssh_keys\", {:key => key}, :accept => 'json').to_s\n end",
"def create\n @kwasny = Kwasny.new(kwasny_params)\n\n respond_to do |format|\n if @kwasny.save\n format.html { redirect_to @kwasny, notice: 'Kwasny was successfully created.' }\n format.json { render action: 'show', status: :created, location: @kwasny }\n else\n format.html { render action: 'new' }\n format.json { render json: @kwasny.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bead_pack = BeadPack.new(bead_pack_params)\n respond_to do |format|\n if @bead_pack.save\n format.html { redirect_to @bead_pack, notice: 'Bead pack was successfully created.' }\n format.json { render :show, status: :created, location: @bead_pack }\n else\n format.html { render :new }\n format.json { render json: @bead_pack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bakusokukun = Bakusokukun.new(bakusokukun_params)\n\n respond_to do |format|\n if @bakusokukun.save\n format.html { redirect_to @bakusokukun, notice: 'Bakusokukun was successfully created.' }\n format.json { render :show, status: :created, location: @bakusokukun }\n else\n format.html { render :new }\n format.json { render json: @bakusokukun.errors, status: :unprocessable_entity }\n end\n end\n end",
"def toKitten(**args)\n bok = {\n \"cloud\" => \"Azure\",\n \"credentials\" => @config['credentials']\n }\n\n bok\n end",
"def create\n if current_user.is_not_staff?\n flash[:error] = \"You do not have permissions to access that feature.\"\n redirect_to root_path and return\n end\n \n @bike_assesment = BikeAssesment.new(params[:bike_assesment])\n\n respond_to do |format|\n if @bike_assesment.save\n format.html { redirect_to @bike_assesment, notice: 'Bike assesment was successfully created.' }\n format.json { render json: @bike_assesment, status: :created, location: @bike_assesment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bike_assesment.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.65196216",
"0.6079189",
"0.60184276",
"0.5886781",
"0.5866635",
"0.5811435",
"0.5782131",
"0.57805413",
"0.5707289",
"0.56398",
"0.5636428",
"0.5621697",
"0.56122386",
"0.5609455",
"0.5607152",
"0.5572045",
"0.5535471",
"0.5514561",
"0.5513518",
"0.5503112",
"0.5487763",
"0.5485352",
"0.547812",
"0.54605937",
"0.54470915",
"0.5408392",
"0.5405331",
"0.5393387",
"0.53931457",
"0.53911847",
"0.53870595",
"0.5380701",
"0.5373842",
"0.53556633",
"0.5349719",
"0.53420156",
"0.53418",
"0.5340567",
"0.5340567",
"0.5335103",
"0.5324444",
"0.5311074",
"0.5295132",
"0.52924585",
"0.52852947",
"0.52640426",
"0.5263542",
"0.5256741",
"0.52536315",
"0.5250648",
"0.5240633",
"0.52377105",
"0.5231656",
"0.52305394",
"0.52266943",
"0.5221469",
"0.5213897",
"0.52071506",
"0.5204902",
"0.52039224",
"0.5193957",
"0.5192891",
"0.5190995",
"0.51629287",
"0.51628584",
"0.5154605",
"0.5144135",
"0.5142918",
"0.51423377",
"0.51401544",
"0.513345",
"0.5130747",
"0.5129617",
"0.5127344",
"0.51211095",
"0.5112491",
"0.5110871",
"0.5106336",
"0.50940007",
"0.50939655",
"0.5092301",
"0.5092084",
"0.50896955",
"0.5086397",
"0.5085043",
"0.5084896",
"0.50803244",
"0.50771713",
"0.5076526",
"0.50758344",
"0.50743586",
"0.50740373",
"0.5072713",
"0.50722593",
"0.5067661",
"0.5062572",
"0.5059597",
"0.5058415",
"0.5058081",
"0.5054007"
] |
0.6793989
|
0
|
PATCH/PUT /bbhks/1 PATCH/PUT /bbhks/1.json
|
def update
respond_to do |format|
if @bbhk.update(bbhk_params)
format.html { redirect_to @bbhk, notice: 'Bbhk was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @bbhk.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @kb = Kb.find(params[:id])\n\n respond_to do |format|\n if @kb.update_attributes(params[:kb])\n format.html { redirect_to @kb, :notice => 'Kb was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @kb.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def put!\n request! :put\n end",
"def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update\n @spkj_bsb=SpkjBsb.find(params[:id])\n @spkj_bsb.update_attributes(params[:spkj_bsb])\n\n respond_to do |format|\n format.html { redirect_to(\"/spkj_bsbs\") }\n format.json { render json: @spkj_bsb }\n end\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def update\n @bb = Bb.find(params[:id])\n\n respond_to do |format|\n if @bb.update_attributes(params[:bb])\n format.html { redirect_to @bb, notice: 'Bb was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", {\"passed\" => success}.to_json, :content_type => :json\nend",
"def update\n respond_to do |format|\n if @bounty.update(bounty_params)\n format.html { redirect_to @bounty, notice: 'Bounty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bounty.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @boc.update(boc_params)\n format.html { redirect_to @boc, notice: 'Boc was successfully updated.' }\n format.json { render :show, status: :ok, location: @boc }\n else\n format.html { render :edit }\n format.json { render json: @boc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @boat.update(boat_params)\n head :no_content\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @boook.update(boook_params)\n format.html { redirect_to @boook, notice: 'Boook was successfully updated.' }\n format.json { render :show, status: :ok, location: @boook }\n else\n format.html { render :edit }\n format.json { render json: @boook.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"def update\n @bowl = Bowl.find(params[:id])\n \n # set bowl modify time\n @bowl.modified = Time.now\n \n respond_to do |format|\n if @bowl.update_attributes(params[:bowl])\n \n Rails.logger.info \"Updating Bowl Contents\"\n \n # remove all contents for this bowl and add new\n @bowl.contents.delete_all(\"bowl_id=\" + @bowl.id)\n \n params.keys.each do |param|\n if param.start_with?(\"input_\") and (params[param] != \"\") \n @bowl.contents.create(:bowl_id => @bowl.id, :dryfruit_id => param[6, 2], :quantity => params[param]) \n end\n end\n\n format.html { redirect_to bowls_path, :notice => 'Bowl was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bowl.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def patch(path, body_params = {})\n debug_log \"PATCH #{@host}#{path} body:#{body_params}\"\n headers = { 'Content-Type' => 'application/json' }\n res = connection.run_request :put, path, body_params.to_json, headers\n debug_log \"Response status:#{res.status}, body:#{res.body}\"\n res\n end",
"def update\n respond_to do |format|\n if @bb.update(bb_params)\n format.html { redirect_to @bb, notice: 'Bb was successfully updated.' }\n format.json { render :show, status: :ok, location: @bb }\n else\n format.html { render :edit }\n format.json { render json: @bb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ref_mkb = Ref::Mkb.find(params[:id])\n\n respond_to do |format|\n if @ref_mkb.update_attributes(params[:ref_mkb])\n format.html { redirect_to @ref_mkb, notice: 'Mkb was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ref_mkb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n puts \"update #{@need.as_json} #{updated_params.as_json}\"\n respond_to do |format|\n if @need.update(updated_params)\n puts \"brucep update success\"\n format.html { redirect_to new_need_path }\n format.json { render :show, status: :ok, location: @need }\n else\n format.html { render :edit }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @hk.update(hk_params)\n format.html { redirect_to @hk, notice: 'Hk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @hk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_current_logged_in_users_password(args = {}) \n id = args['id']\n temp_path = \"/users.json/current/password\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"userId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def patch(path, **args); end",
"def update_user_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/users/{userId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n respond_to do |format|\n if @kemboi.update(kemboi_params)\n format.html { redirect_to @kemboi, notice: 'Kemboi was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kemboi.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bike_rack.update(bike_rack_params)\n flash[:success] = 'Bike rack was successfully updated.'\n format.html { redirect_to @bike_rack }\n format.json { render :show, status: :ok, location: @bike_rack }\n else\n flash[:danger] = 'There was a problem editing Bike rack.'\n format.html { render :edit }\n format.json { render json: @bike_rack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @key.update(key_params)\n render json: @key\n else\n render json: @key.errors, status: :unprocessable_entity\n end\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def patch\n end",
"def rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend",
"def update\n @b = B.find(params[:id])\n\n respond_to do |format|\n if @b.update_attributes(params[:b])\n format.html { redirect_to @b, notice: 'B was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @b.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\n end\n end",
"def restobooking\n @buchung = Buchung.find(params[:id])\n @buchung.status='B' \n \n respond_to do |format|\n if @buchung.update_attributes(params[:buchung])\n format.html { redirect_to @buchung, notice: 'Buchung wurde erfolgreich geaendert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @buchung.errors, status: :unprocessable_entity }\n end\n end \n end",
"def update_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance/{tenantId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n respond_to do |format|\n if @oncokb.update(oncokb_params)\n format.html { redirect_to @oncokb, notice: 'Oncokb was successfully updated.' }\n format.json { render :show, status: :ok, location: @oncokb }\n else\n format.html { render :edit }\n format.json { render json: @oncokb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bucket_bloc.update(bucket_bloc_params)\n format.html { redirect_to @bucket_bloc, notice: 'Bucket bloc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bucket_bloc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @kingsizeb.update(kingsizeb_params)\n format.html { redirect_to @kingsizeb, notice: 'Kingsizeb was successfully updated.' }\n format.json { render :show, status: :ok, location: @kingsizeb }\n else\n format.html { render :edit }\n format.json { render json: @kingsizeb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, params = {})\n request(:patch, path, params)\n end",
"def patch(path, params = {})\n request(:patch, path, params)\n end",
"def update\n respond_to do |format|\n if @bnpb.update(bnpb_params)\n format.html { redirect_to @bnpb, notice: 'Bnpb was successfully updated.' }\n format.json { render :show, status: :ok, location: @bnpb }\n else\n format.html { render :edit }\n format.json { render json: @bnpb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @apikey.update(apikey_params)\n format.html { redirect_to @apikey, notice: \"Apikey was successfully updated.\" }\n format.json { render :show, status: :ok, location: @apikey }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @apikey.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(path, body = nil, ctype = 'application/json')\n make_call(mk_conn(path, 'Content-Type': ctype,\n 'Accept': 'application/json'),\n :put, nil, body.to_json)\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"def update!(**args)\n @http_body = args[:http_body] if args.key?(:http_body)\n end",
"def update\n put :update\n end",
"def update_by_body\n @person = Person.find(person_update_params[:id])\n\n if @person.update_attributes(person_update_params)\n render json: { status: 'PUT Success' }, status: :ok\n else\n render json: { status: 'Error', message:'Error updating person', person: @person.errors }, status: :unprocessable_entity\n end\n end",
"def update\n @kv = Kv.find(params[:id])\n\n respond_to do |format|\n if @kv.update_attributes(params[:kv])\n format.html { redirect_to @kv, notice: 'Kv was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end",
"def update\n @bla = Bla.find(params[:id])\n\n respond_to do |format|\n if @bla.update_attributes(params[:bla])\n format.html { redirect_to @bla, :notice => 'Bla was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bla.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @bike = Bike.find(params[:id])\n\n respond_to do |format|\n if @bike.update_attributes(params[:bike])\n format.html { redirect_to @bike, notice: 'Bike was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bike.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @kebab = Kebab.find(params[:id])\n\n respond_to do |format|\n if @kebab.update_attributes(params[:kebab])\n flash[:notice] = 'Kebab was successfully updated.'\n format.html { redirect_to(kebabs_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @kebab.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bark.update(bark_params)\n format.html { redirect_to @bark, notice: \"Bark was successfully updated.\" }\n format.json { render :show, status: :ok, location: @bark }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @bark.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_current_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n respond_to do |format|\n if @setbreak.update(setbreak_params)\n format.json { respond_with_bip @setbreak }\n else\n format.json { respond_with_bip @setbreak }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bow.update(bow_params)\n format.html { redirect_to @bow, notice: 'Bow was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bow.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n req = ActiveSupport::JSON.decode(request.body)\n @bookmark = Bookmark.find(req)\n\n respond_to do |format|\n if @bookmark.update_attributes(params[:id])\n format.html { redirect_to @bookmark, notice: 'Bookmark was successfully updated.' }\n format.json { render json: @bookmark, status: :created, location: @bookmarks }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_update_successful\n data = {\n firstname: \"Anh\",\n lastname: \"Hoang\",\n avatar: \"avatar.png\",\n address: \"111D Ly Chinh Thang\",\n city: \"Ho Chi Minh\",\n email: \"anh@gmallds.sl\",\n mobile: \"0309433343545\",\n gender: 1,\n birthday: \"1991/10/10\"\n }\n\n user_id = 28\n expected = 200\n uri = URI.parse('http://localhost:3000/v1/users/'+user_id.to_s)\n\n http = Net::HTTP.new(uri.host,uri.port)\n request = Net::HTTP::Put.new(uri.path)\n request.set_form_data(data)\n response = http.request(request)\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end",
"def update\n respond_to do |format|\n if @api_key.update(api_key_params)\n format.html { redirect_to [:admin, @api_key], notice: 'Api key was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_key }\n else\n format.html { render :edit }\n format.json { render json: @api_key.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bath.update(bath_params)\n format.html { redirect_to @bath, notice: 'Bath was successfully updated.' }\n format.json { render :show, status: :ok, location: @bath }\n else\n format.html { render :edit }\n format.json { render json: @bath.errors, status: :unprocessable_entity }\n end\n end\n end",
"def api_put(path, data = {})\n api_request(:put, path, :data => data)\n end",
"def update\n @bemap = Bemap.find(params[:id])\n\n respond_to do |format|\n if @bemap.update_attributes(params[:bemap])\n format.html { redirect_to @bemap, notice: 'Bemap was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bemap.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @api_signatures = args[:api_signatures] if args.key?(:api_signatures)\n @unique_apis = args[:unique_apis] if args.key?(:unique_apis)\n end",
"def update\n respond_to do |format|\n if @keyholder.update(keyholder_params)\n format.html { redirect_to @keyholder, notice: 'Keyholder was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @keyholder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n head :ok\n end",
"def update2\n if params.has_key?(\"chef_value\")\n @chef_value.update(chef_value_params(params[\"chef_value\"]))\n else\n params[\"chef_values\"].each do |chef_value|\n if chef_value[\"value\"] != \"\"\n @chef_value.update(chef_value_params(chef_value))\n end\n end\n end\n respond_to do |format|\n if @chef_value.update(chef_value_params)\n format.html { redirect_to @chef_value, notice: 'Chef value was successfully updated.' }\n format.json { render :show, status: :ok, location: @chef_value }\n else\n format.html { render :edit }\n format.json { render json: @chef_value.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cat_blok.update(cat_blok_params)\n format.html { redirect_to cat_bloks_url, notice: 'Cat blok was successfully updated.' }\n format.json { render :show, status: :ok, location: @cat_blok }\n else\n format.html { render :edit }\n format.json { render json: @cat_blok.errors, status: :unprocessable_entity }\n end\n end\n end",
"def http_put(path, data, content_type = 'application/json')\n http_methods(path, :put, data, content_type)\n end",
"def update\n request_body_Data= '{ \"widget\":\n {\n \"name\" : \"'+params[:name]+'\",\n \"description\" : \"'+params[:description]+'\"\n }}'\n response = RestClient::Request.new({\n method: :put,\n url: ENV['API_URL'] + '/widgets/' + params[:id],\n payload: request_body_Data,\n headers: { Authorization: session[:access_token], content_type: 'application/json'}\n }).execute do |response, request, result|\n case response.code\n when 400\n [ :error, JSON.parse(response) ]\n when 200\n [ :success, JSON.parse(response) ]\n json=JSON.parse(response)\n @widget= Widget.new do |widget|\n widget.id=json[\"data\"][\"widget\"][\"id\"]\n widget.name=json[\"data\"][\"widget\"][\"name\"]\n widget.description=json[\"data\"][\"widget\"][\"description\"]\n widget.kind=json[\"data\"][\"widget\"][\"kind\"]\n widget.userid=json[\"data\"][\"widget\"][\"user\"][\"id\"]\n widget.username=json[\"data\"][\"widget\"][\"user\"][\"name\"]\n widget.owner=json[\"data\"][\"widget\"][\"owner\"]\n end\n else\n fail \"Invalid response #{response.to_str} received.\"\n end\n end\n respond_to do |format|\n if @widget\n format.html { redirect_to @widget, notice: 'Widget was successfully updated.' }\n format.json { render :show, status: :ok, location: @widget }\n else\n format.html { render :edit }\n format.json { render json: @widget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bread.update(bread_params)\n format.html { redirect_to @bread, notice: 'パン情報を編集した.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bread.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_job(job:)\n response = HTTParty.put(\"#{@host}/api/jobs/#{job[:id]}\", body: {job: job, api_key: @api_key})\n \n return response.success?\n end",
"def put(*args)\n request :put, *args\n end",
"def update\n @bl = Bl.find(params[:id])\n\n respond_to do |format|\n if @bl.update_attributes(params[:bl])\n format.html { redirect_to @bl, notice: 'Bl was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bl.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @abucket.update_attributes(params[:abucket])\n flash[:notice] = 'Bucket was successfully updated.'\n format.html { redirect_to(account_abuckets_path(@account)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @abucket.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bok.update(bok_params)\n format.html { redirect_to @bok, notice: 'Bok was successfully updated.' }\n format.json { render :show, status: :ok, location: @bok }\n else\n format.html { render :edit }\n format.json { render json: @bok.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bike.update(bike_params)\n format.html { redirect_to @bike, notice: 'Bike was successfully updated.' }\n format.json { render :show, status: :ok, location: @bike }\n else\n format.html { render :edit }\n format.json { render json: @bike.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @api_haiku = Api::Haiku.find(params[:id])\n\n respond_to do |format|\n if @api_haiku.update_attributes(params[:api_haiku])\n format.html { redirect_to @api_haiku, notice: 'Haiku was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_haiku.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n job = Job.find(params[:id])\n job.update_attributes(job_params)\n render json: job\n end",
"def update\n @bowler.update(bowler_params)\n respond_with(@bowler)\n end",
"def update\n respond_to do |format|\n if @klub.update(klub_params)\n format.html { redirect_to @klub, notice: 'Klub was successfully updated.' }\n format.json { render :show, status: :ok, location: @klub }\n else\n format.html { render :edit }\n format.json { render json: @klub.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @barrack = Barrack.find(params[:id])\n\n respond_to do |format|\n if @barrack.update_attributes(params[:barrack])\n format.html { redirect_to @barrack, notice: 'Barrack was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @barrack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @breet.update(breet_params)\n format.html { redirect_to @breet, notice: 'Breet was successfully updated.' }\n format.json { render :show, status: :ok, location: @breet }\n else\n format.html { render :edit }\n format.json { render json: @breet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, params)\n time(\"PATCH #{path}\") { Cloudflarer.new.patch(path, params) }\n end",
"def patch(path, opts = {})\n request(:patch, path, opts).body\n end",
"def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end",
"def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end",
"def update\n respond_to do |format|\n if @group_key.update(group_key_params)\n format.html { redirect_to @group_key, notice: 'Group key was successfully updated.' }\n format.json { head :no_content }\n else\n format.html do\n\t @edit_mode = true\n\t @action = \"update\"\n\t @submit_text = \"Update Group Key\"\n\t render action: 'edit'\n\tend\n format.json { render json: @group_key.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bingo.update(bingo_params)\n format.html { redirect_to @bingo, notice: \"Bingo was successfully updated.\" }\n format.json { render :show, status: :ok, location: @bingo }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @bingo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ja_blocked_root = JaBlockedRoot.find(params[:id])\n\n respond_to do |format|\n if @ja_blocked_root.update_attributes(params[:ja_blocked_root])\n format.html { redirect_to @ja_blocked_root, notice: 'Ja blocked root was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ja_blocked_root.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @branch.update(branch_params.map{|k,v| {k.to_sym => v.to_s}.except!(:contact_attributes,:address_attributes) }.reduce({}, :merge)) && @branch.address.update(branch_params[:address_attributes]) && @branch.contact.update(branch_params[:contact_attributes])\n format.html { redirect_to @branch, notice: 'Branch was successfully updated.' }\n format.json { render :show, status: :ok, location: @branch }\n else\n format.html { render :edit }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @zf_bjietu.update(zf_bjietu_params)\n format.html { redirect_to @zf_bjietu, notice: 'Zf bjietu was successfully updated.' }\n format.json { render :show, status: :ok, location: @zf_bjietu }\n else\n format.html { render :edit }\n format.json { render json: @zf_bjietu.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.64221394",
"0.6211864",
"0.62026685",
"0.6200728",
"0.6144037",
"0.61410624",
"0.6128951",
"0.6025062",
"0.59966755",
"0.59834015",
"0.5965815",
"0.59571236",
"0.59554297",
"0.59436226",
"0.59330934",
"0.5911566",
"0.58994687",
"0.58981985",
"0.5878253",
"0.5878253",
"0.58773315",
"0.587653",
"0.587653",
"0.587653",
"0.5866699",
"0.584852",
"0.58264977",
"0.5818516",
"0.5817612",
"0.5805068",
"0.5779026",
"0.57784796",
"0.57767045",
"0.57675195",
"0.5744513",
"0.57307833",
"0.5725132",
"0.5715328",
"0.57061076",
"0.5696432",
"0.5688479",
"0.5683515",
"0.5679153",
"0.5670366",
"0.5666629",
"0.5661167",
"0.5652267",
"0.5652267",
"0.5633219",
"0.5633139",
"0.56321937",
"0.56297594",
"0.56297594",
"0.56276476",
"0.5624844",
"0.56093204",
"0.560804",
"0.5607651",
"0.5603267",
"0.55966896",
"0.55927",
"0.55896693",
"0.5588891",
"0.55833155",
"0.55822617",
"0.5576989",
"0.55754834",
"0.5575141",
"0.5574711",
"0.5573643",
"0.55717146",
"0.5569505",
"0.5568466",
"0.55684435",
"0.5565805",
"0.5556465",
"0.55514145",
"0.555137",
"0.555135",
"0.55478996",
"0.5540913",
"0.55322987",
"0.55295396",
"0.55290717",
"0.5527499",
"0.55270255",
"0.5521451",
"0.5520777",
"0.551415",
"0.5509465",
"0.55072004",
"0.55048335",
"0.5501403",
"0.54970235",
"0.5494586",
"0.5491559",
"0.5488585",
"0.54876",
"0.54856217",
"0.5476426"
] |
0.65022373
|
0
|
DELETE /bbhks/1 DELETE /bbhks/1.json
|
def destroy
@bbhk.destroy
respond_to do |format|
format.html { redirect_to bbhks_url }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @kb = Kb.find(params[:id])\n @kb.destroy\n\n respond_to do |format|\n format.html { redirect_to kbs_url }\n format.json { head :ok }\n end\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy\n @hk.destroy\n respond_to do |format|\n format.html { redirect_to hks_url }\n format.json { head :no_content }\n end\n end",
"def bucket_delete_object(key)\n http.delete(\"/#{key}\", bucket: bucket, key: key)\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete\n connection.delete(\"/#{URI.escape(@key)}\", @bucket_name)\n end",
"def destroy\n @bb = Bb.find(params[:id])\n @bb.destroy\n\n respond_to do |format|\n format.html { redirect_to bbs_url }\n format.json { head :no_content }\n end\n end",
"def delete(key)\n log \"deleting #{key} from #{container_path}\"\n object_path = File.join(container_path, Raca::Util.url_encode(key))\n response = storage_client.delete(object_path)\n (200..299).cover?(response.code.to_i)\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def delete\n request(:delete)\n end",
"def delete(args)\n args = {:path => args} unless args.is_a?(Hash)\n assert_supported_keys(args, [:path, :version, :callback, :context])\n assert_required_keys(args, [:path])\n args[:version] ||= -1\n\n if args[:callback] ## asynchronous\n raise KeeperException::BadArguments unless args[:callback].kind_of?(VoidCallback)\n return zoo_adelete(@zk_handle, args[:path], args[:version], args[:callback].proc, YAML.dump(args[:context]))\n end\n\n ## synchronous\n rc = zoo_delete(@zk_handle, args[:path], args[:version])\n raise KeeperException.by_code(rc), ZooKeeperFFI::zerror(rc) unless rc == ZOK\n return rc\n end",
"def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end",
"def destroy\n @spkj_bsb = SpkjBsb.find(params[:id])\n @spkj_bsb.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/spkj_bsbs\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bb.destroy\n respond_to do |format|\n format.html { redirect_to bbs_url, notice: 'Bb was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(key)\n\n # FIXME: insert code that connects to the backend and affects the delete\n # operation\n #\n # - This delete should be done atomically\n # - Convert any exceptions into a failed status result with a meaningful\n # error message.\n #\n\n { :result => false, :err_msg => 'FIXME: not implemented' }\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end",
"def delete(key)\n\n end",
"def delete_data(path, &block)\n url = \"#{host}/api/v#{version}/#{path}\"\n params = Jbuilder.encode(&block) if block_given?\n params ||= {}\n resource = RestClient::Resource.new(\n url, \n headers: {\n \"uid\" => @uid,\n \"client\" => @client,\n \"access-token\" => @access_token\n }\n )\n resource.delete(params) do |response, request, result, &blk|\n case response.code\n when 200\n if response.blank?\n true\n else\n auth_data = {\n uid: response.headers[:uid],\n client: response.headers[:client],\n access_token: response.headers[:access_token]\n }\n JSON.parse(response).merge(auth_data)\n end\n when 404\n nil\n else\n JSON.parse(response)\n end\n end\n end",
"def delete(path)\n path = format_path(path)\n bucket_path = get_bucket_path(path)\n date = gmtdate\n headers = {\n 'Host' => @aliyun_upload_host,\n 'Date' => date,\n 'Authorization' => sign('DELETE', bucket_path, '', '', date)\n }\n url = path_to_url(path)\n response = RestClient.delete(url, headers)\n response.code == 204 ? url : nil\n end",
"def destroy\n @kv = Kv.find(params[:id])\n @kv.destroy\n\n respond_to do |format|\n format.html { redirect_to kvs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @lob.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @boc.destroy\n respond_to do |format|\n format.html { redirect_to bocs_url, notice: 'Boc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n api(\"Delete\")\n end",
"def destroy\n @kemboi.destroy\n respond_to do |format|\n format.html { redirect_to kembois_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bow.destroy\n respond_to do |format|\n format.html { redirect_to bows_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ref_mkb = Ref::Mkb.find(params[:id])\n @ref_mkb.destroy\n\n respond_to do |format|\n format.html { redirect_to ref_mkbs_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @bdatabase = Bdatabase.find(params[:id])\n @bdatabase.destroy\n\n respond_to do |format|\n format.html { redirect_to bdatabases_url }\n format.json { head :no_content }\n end\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete(path, data = {})\n self.class.delete path, :body => data.merge(:u => access_token)\n end",
"def destroy\n @b = B.find(params[:id])\n @b.destroy\n\n respond_to do |format|\n format.html { redirect_to bs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @oncokb.destroy\n respond_to do |format|\n format.html { redirect_to oncokbs_url, notice: 'Oncokb was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n start { |connection| connection.request http :Delete }\n end",
"def destroy\n @bok.destroy\n respond_to do |format|\n format.html { redirect_to boks_url, notice: 'Bok was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(*rest) end",
"def destroy\n @api_haiku = Api::Haiku.find(params[:id])\n @api_haiku.destroy\n\n respond_to do |format|\n format.html { redirect_to api_haikus_url }\n format.json { head :no_content }\n end\n end",
"def call(id)\n client.delete(\"/api/rest/v1/api_keys/#{id}.json\")\n true\n end",
"def b2_delete_file(file)\n\n if parse_files_json(file) == {}\n\n puts \"File not present\"\n\n else\n \n result_hash = convert_json(b2_delete_file_version(file))\n\n if result_hash[\"fileName\"] == file\n puts \"File deleted successfully\"\n else\n puts \"Error deleting file\"\n end\n\n end\n\nend",
"def destroy\n @kv.destroy\n respond_to do |format|\n format.html { redirect_to kvs_url, notice: 'Kv was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(_url)\n # do nothing since we can't find the key by url\n end",
"def delete!\n request! :delete\n end",
"def destroy\n @apikey.destroy\n respond_to do |format|\n format.html { redirect_to apikeys_url, notice: \"Apikey was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def delete_api subpath, category=nil, &block\n\t\t\t@request_queue.delete \"/api/#{api_key}#{subpath}\", category, &block\n\t\tend",
"def destroy\n @api_key.destroy\n\n respond_to do |format|\n format.html { redirect_to(api_keys_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @lob.destroy\n\n head :no_content\n end",
"def destroy\n @bl = Bl.find(params[:id])\n @bl.destroy\n\n respond_to do |format|\n format.html { redirect_to bls_url }\n format.json { head :no_content }\n end\n end",
"def delete\n api_client.delete(url)\n end",
"def delete!( opts = {} )\n http_action :delete, nil, opts\n end",
"def destroy\n @key = Key.find(params[:id])\n @key.destroy\n\n respond_to do |format|\n format.html { redirect_to keys_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @katbib2.destroy\n respond_to do |format|\n format.html { redirect_to katbib2s_url, notice: 'Katbib2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rishabh.destroy\n respond_to do |format|\n format.html { redirect_to rishabhs_url }\n format.json { head :no_content }\n end\n end",
"def deleteFlatpack( flatpack_id)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n return doCurl(\"delete\",\"/flatpack\",params)\n end",
"def cmd_delete argv\n setup argv\n e = @hash['element']\n response = @api.delete(e)\n msg response\n return response\n end",
"def destroy\n @bath.destroy\n respond_to do |format|\n format.html { redirect_to baths_url, notice: 'Bath was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"def destroy\n @whiskey = Whiskey.find(params[:id])\n @whiskey.destroy\n\n respond_to do |format|\n format.html { redirect_to whiskeys_url }\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end",
"def destroy\n @kai2_ji7.destroy\n respond_to do |format|\n format.html { redirect_to kai2_ji7s_url }\n format.json { head :no_content }\n end\n end",
"def delete(key); end",
"def delete(key); end",
"def delete(key); end",
"def delete(key); end",
"def delete(key); end",
"def delete\n \n end",
"def destroy\n @bread.destroy\n respond_to do |format|\n format.html { redirect_to breads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end",
"def destroy\n @sshkey.destroy\n respond_to do |format|\n format.html { redirect_to sshkeys_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @kh.destroy\n respond_to do |format|\n format.html { redirect_to khs_url, notice: 'Kh was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @swift_api_key.destroy\n respond_to do |format|\n format.html { redirect_to swift_api_keys_url, notice: 'Swift api key was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lk.destroy\n respond_to do |format|\n format.html { redirect_to lks_url, notice: 'Lk was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @basin = Basin.find(params[:id])\n @basin.destroy\n\n respond_to do |format|\n format.html { redirect_to basins_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bounty.destroy\n respond_to do |format|\n format.html { redirect_to bounties_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end",
"def destroy\n @kingsizeb.destroy\n respond_to do |format|\n format.html { redirect_to kingsizebs_url, notice: 'Kingsizeb was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bloom = Bloom.find(params[:id])\n @bloom.destroy\n\n respond_to do |format|\n format.html { redirect_to blooms_url }\n format.json { head :no_content }\n end\n end",
"def delete_and_give_me_a_json(additional_path, params = nil)\n if self.service_base_path != nil\n if params == nil\n params = Hash.new\n end\n params[:api_key] = self.access_token\n message = self.http_client.delete \"#{self.base_url}#{self.service_base_path}/#{additional_path}.json\", params\n trata_erro(message.content)\n end\n end",
"def destroy\n @epembash.destroy\n respond_to do |format|\n format.html { redirect_to epembashes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ghb.destroy\n respond_to do |format|\n format.html { redirect_to ethers_url, notice: 'Ether was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bemap = Bemap.find(params[:id])\n @bemap.destroy\n\n respond_to do |format|\n format.html { redirect_to bemaps_url }\n format.json { head :ok }\n end\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def delete!\n\t\t\tClient.delete @root\n\t\tend",
"def destroy\n @configuration_key.destroy\n respond_to do |format|\n format.html { redirect_to configuration_keys_url }\n format.json { head :no_content }\n end\n end",
"def delete(name)\n raise('wrong type: String required') unless name.is_a?(String)\n raise('wrong value: name must be valid') unless !name.nil? && !name.empty?\n\n @client.post({\n 'action' => 'del',\n 'object' => 'htpl',\n 'values' => name,\n }.to_json)\n end",
"def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end",
"def destroy\n @kebab = Kebab.find(params[:id])\n @kebab.destroy\n\n respond_to do |format|\n format.html { redirect_to(kebabs_url) }\n format.xml { head :ok }\n end\n end",
"def delete(options={})\n connection.delete(\"/\", @name)\n end",
"def deleteExecution(execution_id)\n uri = URI(RUNDECKSERVER + ':' + RUNDECKPORT + '/api/12/execution/' + execution_id)\n http = Net::HTTP.new(uri.host, uri.port)\n headers = {'Content-Type'=> 'application/jsonr','X-RunDeck-Auth-Token'=> API_KEY }\n r = http.delete(uri.path, headers) \n return r\nend",
"def delete\n\n end",
"def destroy\n @apk_bin = ApkBin.find(params[:id])\n @apk_bin.destroy\n\n respond_to do |format|\n format.html { redirect_to apk_bins_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bahan = Bahan.find(params[:id])\n @bahan.destroy\n\n respond_to do |format|\n format.html { redirect_to bahans_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.6856093",
"0.6775672",
"0.6773763",
"0.67693406",
"0.6764606",
"0.6667239",
"0.66556567",
"0.66301256",
"0.65291506",
"0.65151274",
"0.6487478",
"0.6487478",
"0.6487478",
"0.6487478",
"0.64871603",
"0.6428292",
"0.6417436",
"0.6410501",
"0.6404583",
"0.63994753",
"0.6397355",
"0.63879913",
"0.6380776",
"0.63782644",
"0.6367628",
"0.6366155",
"0.6362105",
"0.63399625",
"0.6336033",
"0.63335836",
"0.6317685",
"0.63176775",
"0.63121104",
"0.6310866",
"0.63004106",
"0.6292076",
"0.6289173",
"0.6282769",
"0.62723315",
"0.62723315",
"0.62702584",
"0.6265615",
"0.62643886",
"0.625983",
"0.6257925",
"0.62560844",
"0.62521183",
"0.62515074",
"0.624788",
"0.623893",
"0.62280434",
"0.6227633",
"0.62254435",
"0.62214905",
"0.62168795",
"0.6215979",
"0.62105274",
"0.6202518",
"0.6201041",
"0.61978585",
"0.6196659",
"0.61890537",
"0.6188041",
"0.6182748",
"0.61803675",
"0.6178372",
"0.6175953",
"0.61751574",
"0.6174029",
"0.6174029",
"0.6174029",
"0.6174029",
"0.6174029",
"0.61723906",
"0.6172323",
"0.61722535",
"0.61677533",
"0.6161806",
"0.6159122",
"0.6158288",
"0.61501426",
"0.61500084",
"0.6146239",
"0.6145647",
"0.614352",
"0.6142802",
"0.61398596",
"0.61343765",
"0.613241",
"0.6125799",
"0.6121309",
"0.61189413",
"0.6116668",
"0.6113984",
"0.61136895",
"0.6108233",
"0.6106777",
"0.610515",
"0.61050814",
"0.6100758"
] |
0.72690946
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_bbhk
@bbhk = Bbhk.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_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"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.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def bbhk_params
params.require(:bbhk).permit(:hall_size, :bed1_size, :bed2_size, :kitchen_size, :floor, :sold_out, :status)
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 end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"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.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
This method will enable/disable strong password policy for users.
|
def set_strong_password(handle:, enable: false)
mos = handle.query_classid(class_id: "AaaUserPolicy")
user_policy = mos[0]
enable ? user_policy.set_prop(:user_password_policy, "enabled") : user_policy.set_prop(:user_password_policy, "disabled")
handle.set_mo(mo: user_policy)
return handle.query_dn(dn: user_policy.dn)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def allow_users_to_change_passwords?\n @policy.allow_users_to_change_password\n end",
"def apply_password_policy\n build_password_policy.apply\n end",
"def skip_password!\n # Securely remove all password fields, otherwise user cannot confirm.\n self.password = nil\n self.password_confirmation = nil\n self.encrypted_password = ''\n self.skip_password = true\n end",
"def disable\n authorize! @user\n @user.enabled = false\n @user.save\n @user.owned_extensions.update_all(enabled: false)\n redirect_to root_path, notice: t(\"user.disabled\", name: @user.username)\n end",
"def disable_secure_password\n `sed -i.bak -e \"s/has_secure_password/# has_secure_password/\" ./app/models/user.rb`\nend",
"def is_strong_password_set(handle:)\n mos = handle.query_classid(class_id: \"AaaUserPolicy\")\n if mos.size == 0\n raise ImcOperationError.new(\"Check Password Strength\", \"MO does not exist\")\n end\n return (mos[0].user_password_policy == \"enabled\")\nend",
"def twofa_disable\n if current_user.update_attributes( :gauth_enabled => false )\n flash[:info] = \"Two-factor authentication has been disabled\"\n redirect_to admin_twofa_path\n return\n end\n \n flash[:error] = \"Something went wrong while trying to turn off two-factor authentication\"\n redirect_to admin_change_password_path\n end",
"def need_change_password!\n return unless password_expiration_enabled?\n\n need_change_password\n save(validate: false)\n end",
"def disable!(current_user: nil, force_save: false)\n force_save! if force_save\n self.current_user ||= current_user\n update! disabled: true\n end",
"def enable_two_factor!\n update!(otp_required_for_login: true)\n end",
"def disable\n\t\tif user = check_admin\n\t\t\ttarget_user = User.find_by(id: params[:id])\n\t\t\ttarget_user.toggle!(:enabled)\n\t\t\tredirect_back fallback_location: '/home'\n\t\tend\n\tend",
"def enable_otp\n current_user.otp_secret = User.generate_otp_secret\n current_user.otp_required_for_login = true\n current_user.save!\n redirect_back(fallback_location: '/')\n end",
"def disable_empty_password_validation()\n @password = \"non-empty\"\n end",
"def admin_enable_otp\n user = User.find(params[:id])\n authorize! :edit, @user #prevent other users from enabling OTP on another user.\n user.otp_secret = User.generate_otp_secret\n user.otp_required_for_login = true\n user.save!\n redirect_back(fallback_location: '/')\n end",
"def enable_two_factor!\n update!(otp_required_for_login: true)\n end",
"def enable_two_factor!\n update!(otp_required_for_login: true)\n end",
"def enable_two_factor!\n update!(otp_required_for_login: true)\n end",
"def disable_password_restrictions(acts)\n server_info = json { execute_prlsrvctl('info', '--json') }\n server_info.fetch('Require password to', []).each do |act|\n execute_prlsrvctl('set', '--require-pwd', \"#{act}:off\") if acts.include? act\n end\n end",
"def disable_two_factor!\n\n update_attributes second_factor_enabled: false, encrypted_otp_secret_key: nil\n\n end",
"def update_password\n @user.password = @new_e_password\n if GlobalConstant::User.auto_blocked_status == @user.status\n # if we had blocked a user for more than a threshhold failed login attemps we set status to blocked\n # now we should reset it to active\n @user.status = GlobalConstant::User.active_status\n @user.failed_login_attempt_count = 0\n end\n @user.save!\n end",
"def activate!(params)\n self.active = true\n self.password = params[:user][:password]\n self.password_confirmation = params[:user][:password_confirmation]\n save\n end",
"def activate!(params)\n self.active = true\n self.password = params[:user][:password]\n self.password_confirmation = params[:user][:password_confirmation]\n save\n end",
"def activate!(params)\n self.active = true\n self.password = params[:user][:password]\n self.password_confirmation = params[:user][:password_confirmation]\n save\n end",
"def enable\n if disabled?\n Cratus::LDAP.replace_attribute(\n dn,\n Cratus.config.user_account_control_attribute,\n ['512']\n )\n refresh\n else\n true\n end\n end",
"def before_save_user\n self.encrypted_password.encode! 'utf-8'\n\n # If demo is enabled, demo user cannot change email or password nor be locked\n if Feedbunch::Application.config.demo_enabled\n demo_email = Feedbunch::Application.config.demo_email\n if email_changed? && self.email_was == demo_email\n Rails.logger.info 'Somebody attempted to change the demo user email. Blocking the attempt.'\n self.errors.add :email, 'Cannot change demo user email'\n self.email = demo_email\n end\n\n demo_password = Feedbunch::Application.config.demo_password\n if encrypted_password_changed? && self.email == demo_email\n Rails.logger.info 'Somebody attempted to change the demo user password. Blocking the attempt.'\n self.errors.add :password, 'Cannot change demo user password'\n self.password = demo_password\n end\n\n if locked_at_changed? && self.email == demo_email\n Rails.logger.info 'Keeping demo user from being locked because of too many authentication failures'\n self.locked_at = nil\n end\n\n if unlock_token_changed? && self.email == demo_email\n Rails.logger.info 'Removing unlock token for demo user, demo user cannot be locked out'\n self.unlock_token = nil\n end\n end\n end",
"def disable\n Heroku::Auth.safe_ask_for_password\n api.request(\n :expects => 200,\n :method => :delete,\n :path => \"/account/two-factor\",\n :headers => { \"Heroku-Password\" => Heroku::Auth.current_session_password }\n )\n display \"Disabled two-factor authentication.\"\n end",
"def enable_or_disable\n @user = User.find(params[:id])\n begin\n if(@user.user_type == 'e')\n @user.user_type = 'd'\n if(@user.update_attributes(params[:user]))\n flash[:notice] = \"User #{@user.name} disabled\"\n end\n else if(@user.user_type == 'd')\n @user.user_type = 'e'\n if(@user.update_attributes(params[:user]))\n flash[:notice] = \"User #{@user.name} enabled\"\n end\n end\n end\n rescue Exception => e\n flash[:notice] = \"Exception in enable_or_disable: \" + e.message\n end\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def enable_enforce(enabled = true)\n self.enabled = enabled\n end",
"def reset_password(*args)\n self.legacy_password = false\n super\n end",
"def enable\n user = User.find_by_username params[:username]\n raise ActiveRecord::RecordNotFound unless user\n\n command = EnableUserCommand.new(user, current_user, request.remote_ip)\n begin\n command.execute\n rescue => e\n flash['error'] = \"#{e}\"\n else\n flash['success'] = \"User #{user.username} enabled.\"\n ensure\n redirect_back fallback_location: user_url(user)\n end\n end",
"def disable_two_factor!\n update!(\n otp_required_for_login: false,\n otp_secret: nil,\n otp_backup_codes: nil)\n end",
"def require_password?\n if self.new_record?\n APP_CONFIG[:auto_activate] or self.password\n else\n true and !self.password.nil?\n end\n end",
"def password_required?\n false\n end",
"def password_required?\n false\n end",
"def password_required?\n false\n end",
"def password_required?\n false\n end",
"def password_required?\n false\n end",
"def set_password_policy(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetPasswordPolicy'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :minimum_password_length\n\t\t\targs[:query]['MinimumPasswordLength'] = optional[:minimum_password_length]\n\t\tend\n\t\tif optional.key? :require_lowercase_characters\n\t\t\targs[:query]['RequireLowercaseCharacters'] = optional[:require_lowercase_characters]\n\t\tend\n\t\tif optional.key? :require_numbers\n\t\t\targs[:query]['RequireNumbers'] = optional[:require_numbers]\n\t\tend\n\t\tif optional.key? :require_symbols\n\t\t\targs[:query]['RequireSymbols'] = optional[:require_symbols]\n\t\tend\n\t\tif optional.key? :require_uppercase_characters\n\t\t\targs[:query]['RequireUppercaseCharacters'] = optional[:require_uppercase_characters]\n\t\tend\n\t\tself.run(args)\n\tend",
"def enable_admin\n if current_user.admin?\n user = User.find(params[:id])\n user.update_attribute(\"admin\", true)\n redirect_to \"/users\"\n else\n redirect_to \"/home\"\n flash[:warning] = \"Only admins can perform that action.\"\n end\n end",
"def twofa\n @user = current_user\n \n if params[:user]\n if @user.update_attributes params.require(:user).permit(:gauth_enabled,:password,:password_confirmation)\n if (params[:user][:gauth_enabled] == '1')\n flash[:info] = \"Two-factor authentication has been enabled\"\n else\n flash[:warn] = \"Two-factor authentication was not enabled\"\n end\n redirect_to admin_twofa_path\n return \n else\n flash[:error] = \"Something went wrong while trying to update your settings\"\n end\n end\n \n if !@user.twofa_enabled?\n @user.regenerate_secret!\n end\n end",
"def enable\n account = Account.for(\"github\").with_username(params[:id]).first!\n @user = User.unscoped.where(id: account.user_id).first\n authorize! @user\n @user.enabled = true\n @user.save\n redirect_back fallback_location: root_path, notice: t(\"user.enabled\", name: @user.username)\n end",
"def enable_two_factor!\n\n self.otp_secret_key = generate_totp_secret\n self.second_factor_enabled = true\n save(validate: false)\n\n end",
"def enable_privileged(password)\n @transport.cmd('String' => 'enable', 'Match' => /.+assword.+/)\n @transport.cmd(password)\n end",
"def disable_flip\n # TODO: force a login\n begin\n jwt_payload = JWT.decode(params[:token], Rails.application.secrets.secret_key_base).first\n current_user_id = jwt_payload[\"id\"]\n Flipper[:beta_button].disable current_user if current_user && current_user.id == current_user_id\n rescue JWT::ExpiredSignature, JWT::VerificationError, JWT::DecodeError\n # head :unauthorized\n end\n redirect_to root_path\n end",
"def admin_reactivate\n user = User.find(params[:id])\n authorize! :edit, @user #prevent other users from disabling OTP on another user.\n user.deactivated = false\n user.save!\n flash[:notice] = \"Successfully Reactivated user.\"\n redirect_back(fallback_location: '/')\n end",
"def password_required?\n if new_record? && oauth_account\n false\n else\n super\n end\n end",
"def enable\n key = SecurityKey.find_by_key(params[:key])\n if key\n if request.post?\n if params[:acceptance] == 'yes'\n account = key.securable\n account.update(password: params[:password])\n account.authenticate(session, cookies)\n key.destroy\n redirect_to homepage_url and return\n else\n flash.now[:error] = 'Please accept the Terms of Service.'\n end\n end\n else\n redirect_to login_url, flash: {error: 'That account is invalid or has already been activated.'} and return\n end\n end",
"def password_required?\n false\n end",
"def password_required?\n false\n end",
"def disable_two_factor!\n update!(\n otp_required_for_login: false,\n otp_secret: nil,\n otp_backup_codes: nil)\n end",
"def disable_two_factor!\n update!(\n otp_required_for_login: false,\n otp_secret: nil,\n otp_backup_codes: nil)\n end",
"def encrypt_password\n return if self.password.blank?\n \n self.salt = Digest::SHA1.hexdigest(\"--#{Time.now.to_s}--#{self.username}--\") if self.new_record?\n self.crypted_password = self.encrypt(self.password)\n end",
"def disable\n user = User.find_by_username params[:username]\n raise ActiveRecord::RecordNotFound unless user\n\n command = DisableUserCommand.new(user, current_user, request.remote_ip)\n begin\n command.execute\n rescue => e\n flash['error'] = \"#{e}\"\n else\n flash['success'] = \"User #{user.username} disabled.\"\n ensure\n redirect_back fallback_location: user_url(user)\n end\n end",
"def disable_user(username)\n begin\n p = get_permissions(username)\n if !p\n raise \"Username not found\"\n end\n p[:enabled] = false\n p.save!\n if !p.persisted?\n raise \"Failed to save user data for #{username}\"\n end\n return true\n rescue\n return false\n end\n end",
"def should_encrypt_password=(flag)\n @encrypt_password_flag = flag\n end",
"def encrypt_password\n if self.id.nil? || self.password_changed?\n self.password = BCrypt::Password.create(self.password)\n end\n end",
"def disable_two_factor(user_id)\n patch(\"/users/#{user_id}/disable_two_factor\")\n end",
"def encrypt_password\r\n \r\n # If the user is new, create a salt\r\n self.make_salt if new_record?\r\n \r\n # Hash the salt and password to create the encrypted pass\r\n self.encrypted_password = sha_hash(\"#{self.password}--#{self.salt}\")\r\n \r\n end",
"def password_required?; false; end",
"def change_password\n @user = User.shod(params[:id])\n authorize! :update, @user\n end",
"def set_change_password(user)\n user.update_column(:must_change_passwd, true)\n session[:pwd] = 1\n end",
"def change_password!(password_attributes)\n unless skip_current_password\n self.current_password = password_attributes[:current_password]\n authenticated = validate_current_password\n else\n authenticated = true\n end\n self.skip_current_password = true\n assign_attributes(password_attributes)\n validated = authenticated && valid?\n self.skip_current_password = nil\n if validated\n update_attribute(:password, password_attributes[:password])\n else\n false\n end\n end",
"def password_required?\n return false if !persisted? and provider.present?\n super\n end",
"def encrypt_password!(user)\n return unless user.changed?(:password) # only run when the contract's password field changed (from nil to XXX).\n user.password_encrypted = Digest::SHA1.hexdigest(user.password)\n end",
"def disable_two_factor!\n update!(otp_required_for_login: false, otp_secret: nil, otp_backup_codes: nil)\n end",
"def password_required? \n false \n end",
"def disable\n {\n method: \"WebAuthn.disable\"\n }\n end",
"def disable\n {\n method: \"Security.disable\"\n }\n end",
"def password_required?\n provider.present? ? false : super\n end",
"def change_password\n #check if user is new or being updated\n if self.encrypted_password.present?\n #verifies password\n if self.password_check\n self.encrypt_password\n else\n raise \"error\"\n end\n else\n raise \"error\"\n end\n end",
"def encrypt_password\n self.salt = make_salt if new_record?\n self.encrypted_password = encrypt(password)\n end",
"def activate!(params)\n self.username = params[:user][:username] if params[:user][:username]\n self.active = true\n self.password = params[:user][:password]\n self.password_confirmation = params[:user][:password_confirmation]\n save\n end",
"def update!(**args)\n @enabled = args[:enabled] if args.key?(:enabled)\n @password_required = args[:password_required] if args.key?(:password_required)\n end",
"def encrypt_password\n if self.password.present?\n self.salt = BCrypt::Engine.generate_salt\n self.password = BCrypt::Engine.hash_secret(password, self.salt)\n end\n end",
"def protect(password = nil)\n @protect = 1\n @password = encode_password(password) unless password.nil?\n end",
"def encrypt_password!\n if( !password.blank? )\n self['encrypted_password_store'] = BCrypt::Password.create( password, :cost => 11 )\n password, password_confirmation = nil, nil\n end\n end",
"def encrypt_password\n return if password.blank?\n self.salt = User.make_token if new_record?\n self.crypted_password = encrypt(password)\n end",
"def skip_password_change_notification!; end",
"def enable\n {\n method: \"Security.enable\"\n }\n end",
"def update_attributes_and_password(attrs)\n self.assign_attributes(attrs)\n self.valid?\n if self.password.present? && confirm_passwords\n self.password_hash = Digest::SHA256.hexdigest(self.password + Rails.application.secrets.salt)\n end\n if self.errors.empty?\n self.save\n end\n end",
"def encrypt_password\n return if password.blank?\n self.salt = Digest::SHA1.hexdigest(\"--#{Time.now.to_s}--#{login}--\") if new_record?\n self.crypted_password = User.encrypt(password,self.salt)\n end",
"def disable_admin\n if current_user.admin?\n user = User.find(params[:id])\n user.update_attribute(\"admin\", false)\n redirect_to \"/users\"\n else\n redirect_to \"/home\"\n flash[:warning] = \"Only admins can perform that action.\"\n end\n end",
"def encrypt_password\n self.salt = make_salt unless has_password?(password)\n #the encrpyted_password attribute of the current user is the encryption of the password virtual attribute?\n self.encrypted_password = encrypt(password)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n p[:password_unset] = 0 \n update_attributes(p)\n end",
"def require_active_user\n unless current_user && current_user.status == UserStatus::ACTIVE\n flash[:alert]= I18n.t 'auth.msg.lock_account'\n redirect_to new_user_sessions_url\n return false\n end\n end",
"def set_password(pass)\n self.user_password = User.crypt(pass)\n end",
"def encrypt_password\n\t\treturn if password.blank?\n\t\tif new_record?\n\t\t\tself.salt = Digest::SHA1.hexdigest(\"--#{Time.now}--#{name}--\")\n\t\tend\n\t\tself.encrypted_password = User.encrypt(password, salt)\n\tend",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def set_password; nil; end",
"def enable_user(username)\n begin\n p = get_permissions(username)\n if !p\n raise \"Username not found\"\n end\n p[:enabled] = true\n p.save!\n if !p.persisted?\n raise \"Failed to save user data for #{username}\"\n end\n return true\n rescue\n return false\n end\n end",
"def block!\n self.update_attribute(:status, ConfigCenter::User::BLOCKED)\n end"
] |
[
"0.63576",
"0.6284358",
"0.62140554",
"0.61868924",
"0.61498594",
"0.61363536",
"0.6079338",
"0.6014652",
"0.5957391",
"0.5901183",
"0.58850247",
"0.58391345",
"0.5820849",
"0.58182645",
"0.58035684",
"0.58035684",
"0.58035684",
"0.5801583",
"0.5789339",
"0.57699084",
"0.5749893",
"0.5749893",
"0.5749893",
"0.5719345",
"0.56705356",
"0.55994225",
"0.55944514",
"0.55938274",
"0.55896044",
"0.55765945",
"0.5565437",
"0.5549301",
"0.5546909",
"0.5546909",
"0.5546909",
"0.5546909",
"0.5546909",
"0.55326277",
"0.55280185",
"0.55250114",
"0.55240095",
"0.5515234",
"0.5511125",
"0.54947513",
"0.5489708",
"0.54864824",
"0.5485706",
"0.5476139",
"0.5476139",
"0.54749393",
"0.54749393",
"0.54741067",
"0.54692626",
"0.54647565",
"0.54623985",
"0.5462055",
"0.545959",
"0.5458626",
"0.5452001",
"0.5447261",
"0.5447068",
"0.54384923",
"0.5435393",
"0.5435303",
"0.542749",
"0.54270786",
"0.5418467",
"0.54152083",
"0.54087317",
"0.5408121",
"0.54038566",
"0.539845",
"0.53892165",
"0.5385741",
"0.5380591",
"0.53719205",
"0.53662443",
"0.53488725",
"0.5346496",
"0.5342955",
"0.5339875",
"0.53383344",
"0.53366727",
"0.5331031",
"0.5330683",
"0.5327569",
"0.53274363",
"0.5319468",
"0.5319468",
"0.5319468",
"0.5319468",
"0.5319468",
"0.5319468",
"0.5319468",
"0.5319468",
"0.5319468",
"0.5319468",
"0.531771",
"0.53128654",
"0.53118277"
] |
0.7639294
|
0
|
This method will check if strong password policy is enabled.
|
def is_strong_password_set(handle:)
mos = handle.query_classid(class_id: "AaaUserPolicy")
if mos.size == 0
raise ImcOperationError.new("Check Password Strength", "MO does not exist")
end
return (mos[0].user_password_policy == "enabled")
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def password_required?\n @password_required\n end",
"def require_password?\n if self.new_record?\n APP_CONFIG[:auto_activate] or self.password\n else\n true and !self.password.nil?\n end\n end",
"def validate_password?\n active? && (password_hash.blank? || password.present? || password_required)\n end",
"def school_password_required\n Setting.find_by(key: \"require_school_password\").value == \"yes\"\n end",
"def password_required?\n provider.nil?\n #return false\n end",
"def password_required?\n !self.encrypted_password.nil?\n end",
"def password_required?\n signing && (!persisted? || !password.nil? || !password_confirmation.nil?)\n end",
"def password_required?\n admin? && (!persisted? || !password.nil? || !password_confirmation.nil?)\n end",
"def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end",
"def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end",
"def password_check\n return self.encrypted_password==BCrypt::Engine.hash_secret(self.password_verify, self.salt)\n end",
"def enabled?\n return policy_setting.enabled\n end",
"def active?\n self.encrypted_password.present?\n end",
"def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end",
"def password_required?\r\n #!persisted? || !password.nil? || !password_confirmation.nil?\r\n !password.nil? || !password_confirmation.nil?\r\n end",
"def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end",
"def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end",
"def passwordy?\n # puts \"*****************----------------> Handling user as PASSWORDY.\"\n !self.has_oauth?\n end",
"def password_required?\n false\n end",
"def password_required?\n false\n end",
"def set_strong_password(handle:, enable: false)\n mos = handle.query_classid(class_id: \"AaaUserPolicy\")\n user_policy = mos[0]\n enable ? user_policy.set_prop(:user_password_policy, \"enabled\") : user_policy.set_prop(:user_password_policy, \"disabled\")\n\n handle.set_mo(mo: user_policy)\n return handle.query_dn(dn: user_policy.dn)\nend",
"def password_required?\n\t\tsuper && provider.blank?\n\tend",
"def password_required?\n\t\tsuper && provider.blank?\n\tend",
"def passphrase_required?\n true\n end",
"def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end",
"def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end",
"def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end",
"def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end",
"def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end",
"def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end",
"def password_required?\n force_password_validation || !password.nil? || !password_confirmation.nil?\n end",
"def password_required?\n (!persisted? && user_tokens.empty?) || password.present? || password_confirmation.present?\n end",
"def password_required?\n !persisted? || password.present? || password_confirmation.present?\n end",
"def password_required?\n return false if using_open_id? || fb_user?\n crypted_password.blank? || !password.blank?\n end",
"def password_required?\n \n ( new_record? && oauth2_uid.nil? ) || !password.nil? || !password_confirmation.nil?\n end",
"def password_required?\n\t\t!persisted? || ( !password.nil? and !password.blank? ) || !password_confirmation.nil?\n\tend",
"def password_required?\n if !persisted?\n false\n else\n !password.nil? || !password_confirmation.nil?\n end\n end",
"def password_required?\n if !persisted?\n false\n else\n !password.nil? || !password_confirmation.nil?\n end\n end",
"def password_required?\n self.provider.blank?\n end",
"def password_required?\n is_user? && super && provider.blank? # provider.blank?\n end",
"def password_required?\n return false if !persisted? and provider.present?\n super\n end",
"def should_validate_password?\n if self.crypted_password_changed?\n return true\n elsif self.force_password_validation\n return true\n else\n return false\n end\n end",
"def password_required?\n return false if new_record?\n return false if can_log_in?\n return false if password.blank? and password_confirmation.blank?\n end",
"def password_required?\n !persisted? || !password.blank? || !password_confirmation.blank?\n end",
"def password_required?\n crypted_password.blank? || !password.blank?\n end",
"def password_required?\n if !persisted? \n false\n else\n !password.nil? || !password_confirmation.nil?\n end\n end",
"def password_required?\n self.crypted_password.blank? || !self.password.blank?\n end",
"def validate_password?\n provider == :password\n end",
"def should_validate_password?\n self.encrypted_password.nil? || !self.password.nil?\n end",
"def allow_users_to_change_passwords?\n @policy.allow_users_to_change_password\n end",
"def password_required?\n super && authorizations.length == 0 && !auth_temp_token\n end",
"def should_give_password?\n self.password_hash.nil?\n end",
"def password_required?\n confirmed? && (!password.blank?)\n end",
"def check_password_change_required?\n password_change_required || check_password_expired?\n end",
"def using_password?\n\t\t\t\t!send(crypted_password_field).blank?\n\t\t\tend",
"def challenge_password?\n !read_attributes_by_oid('challengePassword').nil?\n end",
"def password_required? \n false \n end",
"def password_required?\n provider.present? ? false : super\n end",
"def password_required?\n new_record? ? not_using_openid? && (crypted_password.blank? || !password.blank?) : !password.blank?\n end",
"def password_required?\n new_record? ? not_using_openid? && (crypted_password.blank? || !password.blank?) : !password.blank?\n end",
"def password_required?\n new_record? ? not_using_openid? && (crypted_password.blank? || !password.blank?) : !password.blank?\n end",
"def password_required?\n new_record? ? not_using_openid? && (crypted_password.blank? || !password.blank?) : !password.blank?\n end",
"def password_required?\n new_record? ? not_using_openid? && (crypted_password.blank? || !password.blank?) : !password.blank?\n end",
"def validate_password?\n password.present?\n end",
"def password_required?\n self.new_record? || self.encrypted_password.blank?\n end",
"def password_required?\n false\n end",
"def password_required?\n false\n end",
"def password_required?\n false\n end",
"def password_required?\n false\n end",
"def password_required?\n false\n end",
"def password_required?\n if persisted?\n return (!password.nil? || !password_confirmation.nil?)\n else\n return (password == \"\")\n end\n end",
"def password_required?\n\t\tencrypted_password.blank? || !password.blank?\n\tend",
"def password_required?\n provider.blank? && super\n end",
"def change_password_allowed?\n return true if auth_source_id.blank?\n return auth_source.allow_password_changes?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n super && provider.blank?\n end",
"def password_required?\n if authentications.empty?\n super || encrypted_password.blank?\n elsif new_record?\n false\n else\n super || encrypted_password.blank? && authentications.find{|a| a.valid?}.nil?\n end\n end",
"def password_required?\n if authentications.empty?\n super || encrypted_password.blank?\n elsif new_record?\n false\n else\n super || encrypted_password.blank? && authentications.find{|a| a.valid?}.nil?\n end\n end",
"def password_required?\n !password.nil?\n end",
"def password_required?\n !password.nil?\n end",
"def password_required?\n # Skip password validations if facebook connect user\n return false if facebook_connect_user?\n crypted_password.blank? || !password.blank?\n end",
"def password_required\n return @password_required\n end",
"def password_required\n return @password_required\n end",
"def password_required\n return @password_required\n end",
"def valid_password?\n password.present?\n end",
"def valid_password?\n password.present?\n end"
] |
[
"0.65472996",
"0.65444314",
"0.6535785",
"0.65058935",
"0.65026397",
"0.6471411",
"0.64578056",
"0.6443475",
"0.64409345",
"0.64409345",
"0.6432411",
"0.6424905",
"0.6424799",
"0.6417333",
"0.6415642",
"0.6405205",
"0.6405205",
"0.6361693",
"0.6346202",
"0.6346202",
"0.6326894",
"0.632588",
"0.632588",
"0.63106465",
"0.630453",
"0.630453",
"0.630453",
"0.630453",
"0.630453",
"0.630453",
"0.63031346",
"0.62755936",
"0.6269592",
"0.6257852",
"0.6246176",
"0.624249",
"0.6242237",
"0.6242237",
"0.62235904",
"0.6218103",
"0.62125874",
"0.62101775",
"0.6209254",
"0.6194305",
"0.61939156",
"0.6189464",
"0.61878973",
"0.61824733",
"0.61767477",
"0.6169495",
"0.6162978",
"0.61593926",
"0.6158468",
"0.6157975",
"0.6157969",
"0.6154384",
"0.6140986",
"0.6140462",
"0.611657",
"0.611657",
"0.611657",
"0.611657",
"0.611657",
"0.6105333",
"0.6101278",
"0.6088787",
"0.6088787",
"0.6088787",
"0.6088787",
"0.6088787",
"0.60822165",
"0.60675895",
"0.6058323",
"0.6055421",
"0.60519886",
"0.60519886",
"0.60519886",
"0.60519886",
"0.60519886",
"0.60519886",
"0.60519886",
"0.60519886",
"0.60519886",
"0.60519886",
"0.60519886",
"0.60519886",
"0.60519886",
"0.60519886",
"0.60519886",
"0.60519886",
"0.60468715",
"0.60468715",
"0.60439825",
"0.60439825",
"0.60278255",
"0.6025166",
"0.6025166",
"0.6025166",
"0.6023293",
"0.6023293"
] |
0.76257044
|
0
|
This method sets up the password expiration policy for local users
|
def password_expiration_set(handle:,
password_expiry_duration:,
password_history: 0,
password_notification_period: 15,
password_grace_period: 0)
mo = AaaUserPasswordExpiration.new(parent_mo_or_dn: "sys/user-ext")
args = {
:password_expiry_duration => password_expiry_duration.to_s,
:password_history => password_history.to_s,
:password_notification_period => password_notification_period.to_s,
:password_grace_period => password_grace_period.to_s
}
mo.set_prop_multiple(**args)
handle.set_mo(mo: mo)
return handle.query_dn(dn: mo.dn)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def apply_password_policy\n build_password_policy.apply\n end",
"def need_change_password!\n return unless password_expiration_enabled?\n\n need_change_password\n save(validate: false)\n end",
"def need_change_password\n return unless password_expiration_enabled?\n\n self.password_changed_at = nil\n end",
"def check_password_expiration\n # check inactive mins\n if current_user && current_user.password_expires_at && current_user.password_expires_at < Time.now\n redirect_to new_profile_password_path and return\n end\n end",
"def set_password_policy(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetPasswordPolicy'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :minimum_password_length\n\t\t\targs[:query]['MinimumPasswordLength'] = optional[:minimum_password_length]\n\t\tend\n\t\tif optional.key? :require_lowercase_characters\n\t\t\targs[:query]['RequireLowercaseCharacters'] = optional[:require_lowercase_characters]\n\t\tend\n\t\tif optional.key? :require_numbers\n\t\t\targs[:query]['RequireNumbers'] = optional[:require_numbers]\n\t\tend\n\t\tif optional.key? :require_symbols\n\t\t\targs[:query]['RequireSymbols'] = optional[:require_symbols]\n\t\tend\n\t\tif optional.key? :require_uppercase_characters\n\t\t\targs[:query]['RequireUppercaseCharacters'] = optional[:require_uppercase_characters]\n\t\tend\n\t\tself.run(args)\n\tend",
"def allow_users_to_change_passwords?\n @policy.allow_users_to_change_password\n end",
"def reset_password!(new_password, new_password_confirmation)\n self.password = new_password\n self.password_confirmation = new_password_confirmation\n self.haslocalpw = true # Added this line\n\n if valid?\n clear_reset_password_token\n after_password_reset\n end\n\n save\n end",
"def set_temp_password() \n\t\t#Generate new password\n\t\tpassword = User.generate_password()\n\t\t\n\t\tsalt = self.salt\n\t\tenc_password = Digest::SHA1.hexdigest(salt+password)\n\t\t\n\t\tself.temp_password = enc_password\n\t\tself.save\n\t\t\n\t\t#Ignore temp password if user is already logged in\n\t\tself.temp_password = nil\n\t\t\n\t\t#Notify user\n\t\tAppMailer.temporary_password_created(self, password).deliver\n\tend",
"def password_expiration_days=(value)\n @password_expiration_days = value\n end",
"def password_expiration_days=(value)\n @password_expiration_days = value\n end",
"def password_expiration_days=(value)\n @password_expiration_days = value\n end",
"def password_expiration_days=(value)\n @password_expiration_days = value\n end",
"def change_temp_password\n\tend",
"def update_password\n @user.password = @new_e_password\n if GlobalConstant::User.auto_blocked_status == @user.status\n # if we had blocked a user for more than a threshhold failed login attemps we set status to blocked\n # now we should reset it to active\n @user.status = GlobalConstant::User.active_status\n @user.failed_login_attempt_count = 0\n end\n @user.save!\n end",
"def valid_upto\n GlobalConstant::Cookie.password_auth_expiry\n end",
"def work_profile_password_expiration_days=(value)\n @work_profile_password_expiration_days = value\n end",
"def set_password; nil; end",
"def before_save_user\n self.encrypted_password.encode! 'utf-8'\n\n # If demo is enabled, demo user cannot change email or password nor be locked\n if Feedbunch::Application.config.demo_enabled\n demo_email = Feedbunch::Application.config.demo_email\n if email_changed? && self.email_was == demo_email\n Rails.logger.info 'Somebody attempted to change the demo user email. Blocking the attempt.'\n self.errors.add :email, 'Cannot change demo user email'\n self.email = demo_email\n end\n\n demo_password = Feedbunch::Application.config.demo_password\n if encrypted_password_changed? && self.email == demo_email\n Rails.logger.info 'Somebody attempted to change the demo user password. Blocking the attempt.'\n self.errors.add :password, 'Cannot change demo user password'\n self.password = demo_password\n end\n\n if locked_at_changed? && self.email == demo_email\n Rails.logger.info 'Keeping demo user from being locked because of too many authentication failures'\n self.locked_at = nil\n end\n\n if unlock_token_changed? && self.email == demo_email\n Rails.logger.info 'Removing unlock token for demo user, demo user cannot be locked out'\n self.unlock_token = nil\n end\n end\n end",
"def generate_temporary_password\n\n pw = Algol.password_salt\n # puts \">> User: generating a temporary password '#{pw}' <<\"\n update!({ password: User.encrypt(pw), auto_password: true })\n\n # expire all current/old temp passwords that weren't used\n pending_notices.all({ type: 'password' }).each { |n| n.expire! }\n\n notices.create({ type: 'password', data: pw })\n end",
"def work_profile_password_expiration_days\n return @work_profile_password_expiration_days\n end",
"def password=(new_password); end",
"def expire_password_on_demand?\n expire_password_after.present? && expire_password_after == true\n end",
"def reset_password\n set :password, Proc.new {\n Capistrano::CLI.password_prompt(\"Password (for user: #{user}): \")\n } \n end",
"def setup_expiration\n self.expires_at = Time.now.utc + ::Simple::OAuth2.config.authorization_code_lifetime if expires_at.nil?\n end",
"def password_expiration_days\n return @password_expiration_days\n end",
"def password_expiration_days\n return @password_expiration_days\n end",
"def password_expiration_days\n return @password_expiration_days\n end",
"def password_expiration_days\n return @password_expiration_days\n end",
"def after_database_authentication\n rotate_stale_password_digest\n end",
"def need_change_password!\n if self.expire_password_after.is_a? Fixnum or self.expire_password_after.is_a? Float\n need_change_password\n self.save(:validate => false)\n end\n end",
"def set_password\n @password = Password.last\n @new_password = Password.new\n end",
"def set_password_reset\n\t\tself.code = SecureRandom.urlsafe_base64\n\t\tself.expires_at = 4.hours.from_now\n\t\tself.save!\n\tend",
"def temporary_password_change_flag\n \"on_temporary_password\"\n end",
"def password_expires?\n @password_expires\n end",
"def set_temp_password\n self.password = SecureRandom.urlsafe_base64(6)\n end",
"def new_password; nil; end",
"def setpwent\n ::Etc.setpwent\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n p[:password_unset] = 0 \n update_attributes(p)\n end",
"def need_change_password\n if self.expire_password_after.is_a? Fixnum or self.expire_password_after.is_a? Float\n self.password_changed_at = self.expire_password_after.seconds.ago\n end\n\n # is date not set it will set default to need set new password next login\n need_change_password if self.password_changed_at.nil?\n\n self.password_changed_at\n end",
"def reset_password!\n reset_password\n save_without_session_maintenance(false)\n end",
"def set_change_password(user)\n user.update_column(:must_change_passwd, true)\n session[:pwd] = 1\n end",
"def before_save_password\n if @password_updated and valid?\n self.crypted_password = ::Challah::Encrypter.encrypt(@password)\n\n @password_updated = false\n @password = nil\n end\n\n self.persistence_token = ::Challah::Random.token(125) if self.persistence_token.to_s.blank?\n self.api_key = ::Challah::Random.token(50) if self.api_key.to_s.blank?\n end",
"def reset_password_period_valid?; end",
"def crypt_password\n # EmailNotify.send_user_create_notification self\n self[:password] =\n password_hash(password(true))\n @password = nil\n end",
"def clean_up_passwords; end",
"def password= passwd\n return unless passwd\n new_salt = User.fresh_salt\n self.passworddate = Date.today.to_s\n self.salt = new_salt\n self.send(:write_attribute, :password, User.password_hash(passwd.to_s, new_salt))\n end",
"def app_store_require_password=(value)\n @app_store_require_password = value\n end",
"def set_strong_password(handle:, enable: false)\n mos = handle.query_classid(class_id: \"AaaUserPolicy\")\n user_policy = mos[0]\n enable ? user_policy.set_prop(:user_password_policy, \"enabled\") : user_policy.set_prop(:user_password_policy, \"disabled\")\n\n handle.set_mo(mo: user_policy)\n return handle.query_dn(dn: user_policy.dn)\nend",
"def create_new_password\n pass = generate_password\n set_password(pass)\n pass\n end",
"def reset_password!\n reset_password\n save_without_session_maintenance(validate: false)\n end",
"def new_user_password(username)\n password = @prompt.mask('Password >')\n raise RequirementError.new, 'Requirements not met' if password.match?(/[!@#$%^&*(),.?\":{}|<>]/)\n\n @user = User.new(username, password, gen_uid)\n @user_playlist = Playlist.new(@user)\n store_user\n rescue RequirementError\n puts 'Password cannot contain special characters. Please try again!'.colorize(:light_red)\n end",
"def reset!\n self.password_cost = 9\n end",
"def check_expiration\n handle_link_expired if @user.password_reset_expired?\n end",
"def passcode_expiration_days=(value)\n @passcode_expiration_days = value\n end",
"def password_require_to_unlock_from_idle=(value)\n @password_require_to_unlock_from_idle = value\n end",
"def send_password_change_notification; end",
"def change_password\r\n \r\n end",
"def set_password(pass)\n self.user_password = User.crypt(pass)\n end",
"def attempt_set_password(params)\n update_attributes(password: params[:password], password_confirmation: params[:password_confirmation])\n end",
"def set_user\n zeus = User.find(@zeus_user.id)\n zeus.state = User.states['retrieved_password']\n zeus.save!\n \n request.session[:rbac_user_id] = @zeus_user.id\n end",
"def set_reg_modifications_allowed(allow = true)\n if allow\n cookies.signed[:user_permissions] = {\n value: \"yes\",\n expires: 24.hours.from_now\n }\n else\n cookies.delete :user_permissions\n end\n end",
"def set_reg_modifications_allowed(allow = true)\n if allow\n cookies.signed[:user_permissions] = {\n value: \"yes\",\n expires: 24.hours.from_now\n }\n else\n cookies.delete :user_permissions\n end\n end",
"def save_admin_pass(val)\r\n if val != ADMIN_PASS\r\n pass_salt = BCrypt::Engine.generate_salt\r\n pass_hash = BCrypt::Engine.hash_secret(val, pass_salt)\r\n save_setting(:admin_pass_salt, pass_salt)\r\n save_setting(:admin_pass_hash, pass_hash)\r\n save_setting(:is_admin_pass, true)\r\n end\r\n end",
"def build_password_policy\n Password.new(policy: password_policy,\n endpoints: selected_endpoints)\n end",
"def reset_password!\n new_password = Digest::MD5.hexdigest(Time.now.to_s.split(//).sort_by {rand}.join)[0, 10]\n self.password = new_password\n self.password_confirmation = new_password\n save!\n end",
"def set_cookie_expiration(opts)\n opts = check_params(opts,[:expirations])\n super(opts)\n end",
"def days_to_password_expiry\n no_of_days_remaining = (password_expiry_date.to_date - Time.zone.today).to_i\n no_of_days_remaining.to_i unless no_of_days_remaining >= Rails.configuration.x.authentication.password_due_period\n end",
"def update_password(newpwd)\n self.password = Utils.sha1(newpwd + 'ad2012spot' + email)\n end",
"def set_password_legacy\n guid = @user['generateduid'][0].to_ruby\n password_hash_file = \"#{@@password_hash_dir}/#{guid}\"\n begin\n File.open(password_hash_file, 'w') { |f| f.write(resource[:password_sha1])}\n rescue Errno::EACCES => detail\n raise(\"Could not write to password hash file: #{detail}\")\n end\n end",
"def attempt_set_password(params)\n\t p = {}\n\t p[:password] = params[:password]\n\t p[:password_confirmation] = params[:password_confirmation]\n\t update_attributes(p)\n end",
"def old_password=(string)\n end",
"def set_default_password\r\nself.password = :random\r\nend",
"def enable_two_factor!\n update!(otp_required_for_login: true)\n end",
"def start_expiry_period!\n self.update_attribute(:access_token_expires_at, Time.now + Devise.timeout_in)\n end",
"def password=(new_pw)\n @password = Password.create(new_pw)\n self.password_hash = @password\n end",
"def password=(val)\n return if val.blank?\n attribute_set(:salt, Digest::SHA1.hexdigest(\"--#{Time.now.to_s}--#{name}--\")) if new?\n attribute_set(:crypted_password, val.encrypt(self.salt))\n end",
"def generate_password\n self.password = \"1234\"\n end",
"def see_password!\n self.password_seen_at = Time.now\n self.save!\n end",
"def edit_password(user, new_password)\n if @config.restrictions[:password_count_restriction]\n unless new_password >= @config.restrictions[:password_count_restriction].to_i\n return false\n end\n end\n user.password = user.hash_plaintext(new_password)\n user.save_data\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes p\n end",
"def password_too_old?\n return false if new_record?\n return false unless password_expiration_enabled?\n return false if expire_password_on_demand?\n\n password_changed_at < expire_password_after.seconds.ago\n end",
"def set_password=(new_password)\n self.password = Password.create(new_password)\n self.save\n end",
"def generate_password\n require 'securerandom' unless defined?(SecureRandom)\n password = SecureRandom.hex(30)\n node.normal['mysql']['local_admins'][new_resource.user]['password'] = password\n password\n end"
] |
[
"0.6864609",
"0.668734",
"0.6328767",
"0.6137945",
"0.6082789",
"0.59794456",
"0.5977116",
"0.5895528",
"0.5891783",
"0.5891783",
"0.5891783",
"0.5891783",
"0.58833766",
"0.58698803",
"0.5853244",
"0.5841299",
"0.5838842",
"0.58146673",
"0.58000684",
"0.57996625",
"0.5792369",
"0.5788121",
"0.5766188",
"0.5756327",
"0.57455176",
"0.57455176",
"0.57455176",
"0.57455176",
"0.5745248",
"0.57250184",
"0.5719687",
"0.5703977",
"0.56971276",
"0.56621593",
"0.5651518",
"0.56467146",
"0.56383413",
"0.5637111",
"0.5585612",
"0.5584294",
"0.558136",
"0.55774194",
"0.5573753",
"0.55685055",
"0.55655795",
"0.5553504",
"0.55434036",
"0.55371994",
"0.5535332",
"0.552617",
"0.5521788",
"0.5519911",
"0.5494382",
"0.54777217",
"0.5471425",
"0.5460933",
"0.5448856",
"0.5446497",
"0.54416627",
"0.54395807",
"0.54362434",
"0.54362434",
"0.5434931",
"0.5426672",
"0.5423034",
"0.54166377",
"0.5415269",
"0.540344",
"0.5400737",
"0.53972447",
"0.53930694",
"0.5384248",
"0.53791696",
"0.53735137",
"0.53733987",
"0.53641814",
"0.5363792",
"0.5363153",
"0.5360403",
"0.53548914",
"0.53548914",
"0.53548914",
"0.53548914",
"0.53548914",
"0.53548914",
"0.53548914",
"0.53548914",
"0.53548914",
"0.53548914",
"0.53548914",
"0.53548914",
"0.53548914",
"0.53548914",
"0.53548914",
"0.53548914",
"0.53548914",
"0.5340196",
"0.533914",
"0.53360057",
"0.5334417"
] |
0.6358911
|
2
|
This method will check if the password expiration policy exists
|
def password_expiration_exists(handle:, **kwargs)
mo = AaaUserPasswordExpiration.new(parent_mo_or_dn: "sys/user-ext")
mo = handle.query_dn(dn: mo.dn)
if mo.nil?
return false, nil
end
return mo.check_prop_match(**kwargs), mo
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def expire_password_on_demand?\n expire_password_after.present? && expire_password_after == true\n end",
"def password_expires?\n @password_expires\n end",
"def check_password_expiration\n # check inactive mins\n if current_user && current_user.password_expires_at && current_user.password_expires_at < Time.now\n redirect_to new_profile_password_path and return\n end\n end",
"def check_password_expired?\n !days_to_password_expiry.nil? && days_to_password_expiry <= 0\n end",
"def valid_upto\n GlobalConstant::Cookie.password_auth_expiry\n end",
"def password_expired?\n password_expires_at = FieldType::Timestamp.encode(pwdLastSet) + AD_PASSWORD_EXPIRATION_DURATION\n now = FieldType::Timestamp.encode(Time.now)\n (password_expires_at < now)\n end",
"def check_expiration\n handle_link_expired if @user.password_reset_expired?\n end",
"def check_expiration\n if @band.password_reset_expired?\n flash[:danger] = \"Password reset has expired.\"\n redirect_to new_password_reset_url\n end\n end",
"def check_password_change_required?\n password_change_required || check_password_expired?\n end",
"def verify_expiration; end",
"def verify_expiration; end",
"def password_change_requested?\n return false unless password_expiration_enabled?\n return false if new_record?\n\n password_changed_at.nil?\n end",
"def check_expiration\n if @ngo.password_reset_expired?\n flash[:danger] = \"Password reset link has expired.\"\n redirect_to new_password_reset_url\n end\n end",
"def check_expiration\n if @user.password_reset_expired?\n flash[:danger] = \"Tempo de solicitacao expirada, por favor solicite novamente\"\n redirect_to new_password_reset_url\n end\n end",
"def check_expiration\n if @shop.password_reset_expired?\n flash[:danger] = \"Password reset has expired\"\n redirect_to new_password_reset_url\n end\n end",
"def check_expiration\n if @user.password_reset_expired?\n flash[:danger] = \"Password reset has expired.\"\n redirect_to new_password_reset_url\n end\n end",
"def check_expiration\n\t\t\tif @user.password_reset_expired?\n\t\t\t\tflash[:danger] = \"Password reset has expired.\"\n\t\t\t\tredirect_to new_password_reset_url\n\t\t\tend\n\t\tend",
"def password_too_old?\n return false if new_record?\n return false unless password_expiration_enabled?\n return false if expire_password_on_demand?\n\n password_changed_at < expire_password_after.seconds.ago\n end",
"def password_token_valid?\n (updated_at + 4.hours) > Time.now.utc\n end",
"def is_expiration_required\n return @is_expiration_required\n end",
"def check_expiration\n return unless @user.password_reset_expired?\n display_flash(:danger, 'Password reset token has expired.')\n redirect_to new_password_reset_url\n end",
"def check_expiration\n \tif @user.password_reset_expired?\n \t\tflash[:danger] = \"Password reset has expired.\"\n \t\tredirect_to new_password_reset_url\n \tend\n end",
"def check_expiration\n if @user.password_reset_expired?\n flash[:danger] = \"Password reset has expired.\"\n redirect_to new_password_reset_url\n end\n end",
"def reset_password_period_valid?\n reset_password_within = 3.days\n reset_password_sent_at && reset_password_sent_at.utc >= reset_password_within.ago\n end",
"def password_reset_expired?\n reset_sent_at < Settings.timeout_reset_password.hours.ago\n end",
"def check_expiration\n if @admin.password_reset_expired?\n flash[:danger] = \"Password reset has expired.\"\n redirect_to new_password_reset_url\n end\n end",
"def password_reset_expired?\n # TODO: the '2' hour expiration should be defined in an app constant\n self.password_reset_sent_at < 2.hours.ago\n end",
"def can_expire?\n return !!@expiry\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago rescue true\n end",
"def password_required?\n provider.nil?\n #return false\n end",
"def reset_password_period_valid?; end",
"def check_expiration\n if @user.password_reset_expired?\n flash[:danger] = \"Il link non è più valido\"\n redirect_to new_password_reset_url\n end\n end",
"def check_cert_expiring\n cert = certificate_get\n expire_date = cert.not_after\n\n now = Time.now\n # Calculate the difference in time (seconds) and convert to hours\n hours_until_expired = (expire_date - now) / 60 / 60\n\n if hours_until_expired < resource[:regenerate_ttl]\n true\n else\n false\n end\n end",
"def check_expiration\n redirect_to new_password_reset_url, alert: I18n.t(\"expired_reset_token\") if @user.password_reset_expired?\n end",
"def password_token_valid?\n (self.reset_password_sent_at + 4.hours) > Time.now.utc\n end",
"def check_expiration\n if @user.password_reset_expired?\n flash[:error] = \"Il link di reset è scaduto! Se vuoi ancora resettare la password, inviane un'altra!\"\n redirect_to new_password_reset_path\n end\n end",
"def check_expiration\n return unless @user.password_reset_expired?\n flash[:alert] = t('user_mailer.password_reset.expired_token')\n redirect_to new_password_reset_url\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def check_session_expiry\n manage_session_expiry(ReferenceData::SystemParameter.lookup('PWS', 'SYS', 'RSTU', safe_lookup: true))\n end",
"def password_reset_expired?\n reset_sent_at.nil? || reset_sent_at < 2.hours.ago\n end",
"def allow_users_to_change_passwords?\n @policy.allow_users_to_change_password\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago # reads as password reset sent earlier than 2 hours ago\n end",
"def expired?\n Time.now > expiration if expiration\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago # password reset sent earlier than two hours ago.\n end",
"def password_reset_expired?\n reset_sent_at && (reset_sent_at < 2.hours.ago)\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 24.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def validate_password?\n provider == :password\n end",
"def password_reset_expired?\n reset_password_sent_at < 1.hours.ago\n end",
"def check_expiration\n # if @user.password_reset_expired?\n # flash[:danger] = \"Password reset has expired.\"\n # redirect_to new_password_reset_url\n # end\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end",
"def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end"
] |
[
"0.7371907",
"0.72259814",
"0.718002",
"0.7102107",
"0.7082474",
"0.70229137",
"0.68210095",
"0.67888993",
"0.67438114",
"0.6703612",
"0.6703612",
"0.669852",
"0.6686004",
"0.6649779",
"0.66445786",
"0.6641466",
"0.6601076",
"0.6600784",
"0.6540958",
"0.6496776",
"0.6492925",
"0.6490889",
"0.64252603",
"0.64152807",
"0.6413423",
"0.6403813",
"0.6400839",
"0.63911355",
"0.63799125",
"0.6377344",
"0.63669837",
"0.6361911",
"0.63587666",
"0.63457674",
"0.6343349",
"0.6328632",
"0.6327416",
"0.63240784",
"0.6321231",
"0.6300758",
"0.6300424",
"0.6293889",
"0.6283271",
"0.62775517",
"0.62763375",
"0.62715596",
"0.6270818",
"0.62696195",
"0.62696195",
"0.62696195",
"0.62696195",
"0.62696195",
"0.62696195",
"0.62696195",
"0.62696195",
"0.62658155",
"0.6260987",
"0.6260629",
"0.6259756",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156",
"0.62549156"
] |
0.7295262
|
1
|
This method will create a new local user and setup it's role.
|
def local_user_create(handle:, name:, pwd:, priv: "read-only")
user = _get_local_user(handle, name)
if !user.nil?
return local_user_modify(handle: handle, name: name, :priv => priv, :account_status => AaaUserConsts::ACCOUNT_STATUS_ACTIVE)
end
available_user_id = _get_free_user_id(handle)
new_user = AaaUser.new( parent_mo_or_dn: "sys/user-ext", id: available_user_id)
args = {:name => name,
:pwd => pwd,
:priv => priv,
:account_status => AaaUserConsts::ACCOUNT_STATUS_ACTIVE}
new_user.set_prop_multiple(**args)
handle.set_mo(mo: new_user)
#return new_user
return handle.query_dn(dn: new_user.dn)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create_local\n uuid = @data[:id]\n\n log_event \"[I] Creating local user #{uuid}\"\n\n @entity = User.new(uuid: uuid)\n @entity.agent = Agent.named(@data.dig(:meta, :agent_name).to_s)\n\n apply_for_create\n\n @entity.save\n @entity\n end",
"def setup_user\n user = create(:user)\n login_as(user, scope: :user)\n end",
"def assign_role\n self.add_role!(\"user\")\n end",
"def create_user\n command = compile_command(\"useradd\") do |useradd|\n useradd << universal_options\n useradd << useradd_options\n end\n\n run_command(:command => command)\n\n # SmartOS locks new users by default until password is set\n # unlock the account by default because password is set by chef\n if check_lock\n unlock_user\n end\n end",
"def assign_role\n UserRole.create!(user_id: self.id, role_id: 3)\n end",
"def create_user\n User.create name: 'test', email: 'test@example.com', password: '123456'\n end",
"def create_user\n User.create name: \"test\", email: \"test@example.com\", password: \"123456\"\n end",
"def create_login_user(role = nil)\n create(\"#{role || :admin}_user\").tap { |u| login_user(u) }\n end",
"def create_user\n if current_user.manager? || current_user.admin?\n @user = User.new(user_params)\n @user.password = 'test@123'\n @user.password_confirmation = 'test@123'\n redirect_to @user if @user.save\n else\n flash[:notice] = NOT_AUTHORIZED\n redirect_to home_index_path\n end\n end",
"def create_user\n user new_resource.user do\n comment \"Service user for #{new_resource.name}\"\n gid new_resource.group if new_resource.group\n home new_resource.home\n shell '/bin/false'\n system true\n uid new_resource.uid\n end\n end",
"def create\n @user = Spree.user_class.new(user_params)\n\n @user.skip_confirmation!\n @user.spree_roles << Spree::Role.designer_role\n\n if @user.save\n set_roles\n\n flash.now[:success] = flash_message_for(@user, :successfully_created)\n redirect_to spree.edit_admin_user_path(@user)\n else\n render :new\n end\n end",
"def create_user(username:, password: 'pppppp', groups: [ 'administrator' ])\n # Ensure the User and Roles are gone before explicitly creating.\n delete_user(username)\n user = User.create!(username: username, email: username, password: 'pppppp', password_confirmation: 'pppppp')\n groups.each do |group|\n Avalon::RoleControls.add_role(group) unless Avalon::RoleControls.role_exists? group\n Avalon::RoleControls.add_user_role(username, group)\n end\n user\n end",
"def admin_create\n begin\n @user = User.new(user_params.merge(user_channel_id: current_user.user_channel_id))\n\n raise \"Invalid role[#{@user.role}]\" unless @user.is_available_role?\n if @user.save\n flash[:success] = t(:operation_succeeded)\n redirect_to users_path\n else\n render :new\n end\n rescue Exception => e\n flash.now[:error] = e.message\n render :new\n end\n end",
"def create_user_role\n if self.role.blank?\n id = Role.select{|role| role.role_type == $roles[:user]}.map(&:id)\n self.update_attributes(:role_id => id[0])\n end\n end",
"def create\n @user = User.new(user_params)\n unless @user.role\n @user.role = Role.find_by_name('SuperAdmin')\n end\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to super_admin_users_path, notice: 'Super Admin was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_user\n User.create name: 'test', email: 'test@example.com', password: '123456'\n end",
"def createNewUser(userName, initialGroup, userEmail, fname, lname, password)\n\n password = password.encrypt\n user = {\"login\" => userName,\n \"group0\" => initialGroup,\n \"email\" => userEmail,\n \"fname\" => fname,\n \"lname\" => lname,\n \"password\" => password,\n \"orga\" => \"0\"}\n saveUser(userName, user)\n end",
"def create\n authorize User\n @user = User.new(user_params)\n @user.operator = current_user\n @user.set_auto_generated_password\n\n respond_to do |format|\n if @user.save\n role = Role.where(:name => 'User').first\n user_has_role = UserHasRole.new\n user_has_role.assign_attributes({:user_id => @user.id, :role_id => role.id})\n user_has_role.save\n flash[:temporary_password] = @user.password\n format.html { redirect_to @user, notice: t('controller.successfully_created', model: t('activerecord.models.user')) }\n format.json { render json: @user, :status => :created, :location => @user }\n else\n prepare_options\n flash[:error] = t('user.could_not_setup_account')\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_admin_user\n unless User.is_exist?('rhoadmin')\n admin = User.create({:login => 'rhoadmin', :admin => 1})\n admin.password = ENV['PSWRD'] || ''\n admin.create_token\n end\n admin = User.load('rhoadmin')\n Rhoconnect.api_token = admin.token_id\n end",
"def create\n new_user = params.require(:user).permit(:name, :email, :role, :password, :password_confirmation)\n new_user[:role] = 'listener' # TODO hard code role for now (change to enum, manage via UI)\n @user = User.new(new_user)\n if @user.save\n flash[:success] = \"Welcome to MusiQ!\"\n sign_in @user\n redirect_to root_url\n else\n render'new'\n end\n end",
"def create\n\t\t\n\t\t@user = User.new(user_params)\n\t\t@user.user_role_id = 3\n\t\t@user.status_ace = true\n\t\t\n\t\tif @user.save\n\t\t\tredirect_to root_url, notice: \"New user created successfully. You can log in now.\"\n\t\t\telse\n\t\t\trender \"new\"\n\t\tend\n\t\t\n\tend",
"def create\n @user = User.new(user_params)\n @user.add_role(:user)\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(user_params)\n unless @user.role\n @user.role = Role.find_by_name('Admin')\n end\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to admin_users_path, notice: 'Admin was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_urole\n begin\n #@client.sobject_module = Salesforce #Using Salesforce Name, to avoid collision with my 'Order' Object in MongoDB.\n if self.user_role.nil?\n #self.user_role = UserRole.where(name: \"regular\").first\n self.user_role_id = Urole.where(name: \"regular\").first.id\n logger.info \"Setting this user '#{self.email}' to use 'regular' role @ #{Time.now}.\"\n else\n logger.info \"User '#{self.email}' is using '#{self.user_role.name}' role @ #{Time.now}.\"\n end\n rescue Exception => e\n logger.info 'Your DB has not been seeded. Please seed it first. ' + e.message\n end\n end",
"def create_new_user\n username = find_username\n @user = User.new(\n email: auth_email,\n username: username,\n password: Devise.friendly_token[0, 20]\n )\n @user.skip_confirmation!\n @user.save!\n\n @user\n end",
"def create\n @user = User.new(params[:user])\n if logged_in? && current_user.can?(:manage_users) && params[:user][:role_id]\n @user.role_id = params[:user][:role_id]\n else\n # the first user is created as an admin...\n @user.role = Role.find_by_name(User.count == 0 ? 'admin' : 'user')\n end\n \n session[:rauth_after_login] = \"/\"\n respond_to do |format|\n if Rauth::Bridge.create_account(@user, :user_name => @user.user_name, :password => params[:password], :confirmation => params[:password_confirm])\n add_default_contexts(@user)\n add_default_account(@user)\n flash[:notice] = l('Your profile was created.')\n self.current_user = @user if !logged_in?\n format.html { redirect_to(home_url) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_user(user, password, roles, options = nil)\n policy = create_policy(options, AdminPolicy, default_admin_policy)\n hash = LoginCommand.hash_password(password)\n command = AdminCommand.new\n command.create_user(@cluster, policy, user, hash, roles)\n end",
"def setup_user\n login_as(User.where(email: 'masterchef@cookbook.com').first, scope: :user)\n end",
"def create(config, name, user_guid)\n\n token = @client.token\n\n user_setup_obj = UsersSetup.new(config)\n admin_token = user_setup_obj.get_admin_token\n\n # elevate user just to create organization\n @client.token = admin_token\n\n new_org = @client.organization\n new_org.name = name\n if new_org.create!\n org_guid = new_org.guid\n users_obj = Users.new(admin_token, @client.target)\n users_obj.add_user_to_org_with_role(org_guid, user_guid, ['owner', 'billing'])\n\n # then put token back to the initial one\n @client.token = token\n org_guid\n end\n\n end",
"def create_patron_user\n\t branch = Nimbos::Branch.where(patron_id: self.id).first\n\t role = Nimbos::Role.find_or_create_by(name: \"admin\")\n\t user = self.users.new\n\t user.name = self.contact_name\n\t user.surname = self.contact_surname\n\t user.email = self.email\n\t user.language = self.language\n\t user.locale = self.locale\n\t user.mail_encoding = self.mail_encoding\n\t user.time_zone = self.time_zone\n\t user.branch_id = branch.id\n\t user.password = self.password\n\t user.password_confirmation = self.password\n\t user.firstuser = true\n\t user.role_ids = [role.id]\n\t user.save!\n\t #user.add_role :admin\n\t end",
"def create_manager\n user = User.new(first_name: \"Ralph\", last_name: \"Wiggum\", username: \"rwiggum\", email: \"chris+rwiggum@cryptographi.com\", password: 'muffins1', password_confirmation: 'muffins1', job_title: 'Manager')\n company_domain = \"cryptographi.com\"\n team = Team.find_by(domain_name: company_domain)\n if !team\n create_admin\n end\n user.team = team\n manager = User.find_by(email: 'chris+jsmith@cryptographi.com')\n user.manager_id = manager.id\n if user.save\n user.add_role :manager\n end\n end",
"def create\n @user = User.new(params[:user])\n ### Add the creator of the object (in this case User) into our record\n @user.creator = current_user\n ### Save the user roles when saving the user\n #@user.save do |result|\n @user.save && check_and_set_role do |result|\n respond_to do |format|\n if result\n flash[:notice] = \"User #{@user.username} was successfully registered.\"\n# @user.has_role!(:patient) # Add default group for user\n format.html { redirect_to(@user) } # redirect_to root_url\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"def find_or_create_test_user\n unless TestChamber::Config[:tc_no_login]\n unless TestChamber::Config[:test_username]\n email = \"#{SecureRandom.uuid}@tapjoy.com\"\n password = SecureRandom.uuid\n\n TestChamber::UserAPI.new(\n is_super_user: true,\n email_address: email,\n password: password,\n confirm_password: password,\n company_name: 'TestChamber Inc.',\n time_zone: 'Eastern Time (US & Canada)',\n country: 'United States',\n language: 'en',\n is_advertiser: true,\n is_publisher: true,\n agree_terms_of_service: true\n ).create!\n\n puts \"Created user #{email} with password #{password}\"\n u = TestChamber::Models::User.where(:email => email).first\n raise \"Unable to find user we just created with email #{email}\" unless u\n\n # give new user all the roles\n test_user = TestChamber::Models::User.where(:email => 'test@tapjoy.com').first\n u.user_roles = test_user.user_roles\n u.save!\n\n # TODO save these somewhere better\n Settings(test_username: email)\n TestChamber::Config(test_password: password)\n ENV['TEST_USERNAME'] = email\n ENV['TEST_PASSWORD'] = password\n end\n end\nend",
"def set_user_role\n role = Role.where({:name => \"system_user\"}).first\n raise RuntimeError, \"Error: unable to find role: system_user\" unless role\n user_role = UserRole.new\n user_role.role_id = role.id\n user_role.user_id = self.id\n user_role.save!\n end",
"def new_user\n if self.role_id.nil?\n self.role_id = 3\n end\n end",
"def new_user\n if self.role_id.nil?\n self.role_id = 3\n end\n end",
"def assign_role\n member_role = Role.find_by(name: \"member\")\n UserRole.create!(user_id: self.id, role_id: member_role[:id])\n end",
"def create_user\n # provide the interface asking for name, destination and duration\n # then, create and store the User object\n end",
"def with_role(role_name)\n self.role = Role.where(name: role_name).first_or_create\n self # returns the user\n end",
"def create_employee_user\n email = self.work_email\n user = User.new(email: self.work_email, password: 'appsimpact@#123', role: 'employee')\n user.save\n self.user_id = user.id\n end",
"def create\n fname = \"#{self.class.name}.#{__method__}\"\n super\n user=User.find_by_email(reg_params[:email])\n pars={}\n unless user.nil?\n pars[:name]=params[:user][:name]\n pars[:role]=params[:user][:role]\n user.update(pars) \n else\n user=User.new(params[:user])\n end\n LOG.debug(fname) {\"************************ current_user=#{user.inspect}\"}\n end",
"def add_user(user,role = 'Member')\n self.users.create(id: user.id, role: role)\n end",
"def create_user\n @user = User.find(session[:user_id])\n redirect_to(root_url) unless current_user?(@user) || current_user.admin?\n end",
"def create_guest_user\n user = User.new { |user| user.role = 'guest' }\n user.email = \"guest_#{Time.now.to_i}#{rand(99)}@example.com\"\n user.save(validate: false)\n user\n end",
"def create\n #logout_keeping_session!\n @new_user = User.new(params[:new_user])\n @new_user.role_id = params[:new_user][:role_id].to_i\n @new_user.user_login = params[:new_user][:user_login].downcase\n #params[:new_user][:admin] == \"1\" ? @new_user.admin = true : @user.admin = false\n success = @new_user && @new_user.save\n if success && @new_user.errors.empty?\n # Protects against session fixation attacks, causes request forgery\n # protection if visitor resubmits an earlier form using back\n # button. Uncomment if you understand the tradeoffs.\n # reset session\n # self.current_user = @user # !! now logged in\n redirect_back_or_default('/')\n flash[:notice] = \"New User Created.\"\n else\n flash[:notice] = \"Failed to add a new user. Please contact the site administrator.\"\n render :action => 'new'\n end\n end",
"def assign_default_role\n self.add_role(:newuser) if self.roles.blank?\n end",
"def assign_default_role\n self.add_role(:newuser) if self.roles.blank?\n end",
"def create\n @user = User.new(user_params)\n if User.count == 0\n @user.role = 'admin'\n else\n @user.role = \"user\"\n end\n\n respond_to do |format|\n if @user.save\n UserMailer.welcome_email(@user).deliver\n format.html { redirect_to :users, notice: 'User was successfully created.' }\n format.json { render action: 'show', status: :created, location: @user }\n else\n format.html { render action: 'new' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def cria_user\n return if user.present?\n User.create(email: self.end_email, password: '123123', password_confirmation: '123123',\n tb_empregado_id: self.id, e_admin: self.e_admin || false).encrypted_password\n end",
"def setup_user\n User.new( \n age: 5,\n bio: \"My test bio\",\n password: SecureRandom.hex(6),\n email: SecureRandom.hex(4) + \"@example.com\",\n picture: \"blah.jpg\",\n sex: \"M\",\n username: SecureRandom.hex(4)\n )\n end",
"def new_user(andrew_id)\n user = User.new\n user.andrew_id = andrew_id\n # If the app has just been created, the first user is an administrator.\n # Otherwise, everyone starts as a requester.\n user.role = User.first.nil? ? \"admin\" : \"requester\"\n user.save!\n return user\n end",
"def call\n context.user = User.find_by_telegram_id(context.telegram_user.id)\n return if context.user\n\n context.is_new_user = true\n context.user = User.create(\n telegram_id: context.telegram_user.id,\n )\n end",
"def create\n super do\n case @user.role\n when 'trainee'\n trainee = Trainee.new(user_id: @user.id)\n trainee.save\n when 'trainer'\n trainer = Trainer.new(user_id: @user.id)\n trainer.save\n end\n end\n end",
"def create_user\n params = {\n :client_id => Swiftype.platform_client_id,\n :client_secret => Swiftype.platform_client_secret\n }\n post(\"users.json\", params)\n end",
"def check_admin_user(password=\"spree\", email=\"spree@example.com\")\n admin = User.find_by_login(email) || User.create( :password => password,:password_confirmation => password,\n :email => email, :login => email )\n # create an admin role and and assign the admin user to that role\n admin.roles << Role.find_or_create_by_name(\"admin\")\n admin.save!\n end",
"def create\n\n @user = User.new(params[:user])\n if !is_admin?\n @user.role = \"Member\"\n end\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: 'User was successfully created.'}\n format.json { render json: @user, status: :created, location: @user }\n else\n if !is_admin?\n format.html { render \"signup\"}\n format.json { render json: @user.errors, status: :unprocessable_entity }\n else\n if @superadmin_user\n @role_options = [\"Administrator\", \"Member\"]\n else\n @role_options = [\"Member\"]\n end\n format.html {render \"new\"}\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n\n end\n end\n end",
"def create_user\n user = User.where(email: user_email)\n if user.blank? # new user\n @user = create_new_user\n church = nil\n if affiliation.blank?\n church = create_affiliation_from_church\n else\n church = Affiliation.find(self.affiliation)\n end\n @user.affiliation = church\n church.users << @user\n @user.save\n\n guest = Role.find_by_name(\"Guest\").id \n @user.role_ids=[guest]\n self.user_id = @user.id\n end\n end",
"def create_user(owner, username, password, readonly=false)\n user = @cp.create_user(username, password)\n # Only append to the list of things to clean up if the @roles exists.\n # This is so the method can be used in before(:all) blocks.\n @users << user if not @users.nil?\n # Create a role for user to administer the given owner:\n perm = readonly ? 'READ_ONLY' : 'ALL'\n role = create_role(nil, owner['key'], perm)\n @cp.add_role_user(role['id'], user['username'])\n return user\n end",
"def create_user\n return @user.send_confirmation_instructions if @user\n\n @user = User.create!(new_agent_params.slice(:email, :name, :password, :password_confirmation))\n end",
"def new_user\n User.new({\n email: 'hoge@hoge',\n password: 'hoge',\n password_confirmation: 'hoge'\n })\n end",
"def create\n if can?(:create, User)\n @user = User.new(params[:user])\n password_unencrypted = params[:user][:password]\n role = Role.where(:name => \"normal\")\n if role == nil or role.empty?\n role = Role.new\n role.name = \"normal\"\n role.save\n end\n @user.roles.push(role)\n end\n\n if can?(:create, User) and @user.save\n respond_to do |format|\n ForumMailer.welcome_email(@user, password_unencrypted).deliver\n format.json { render :json => @user.to_json, :status => 200, :text => \"User was created!\" }\n format.xml { head :ok }\n format.html { redirect_to :action => :index }\n end\n else\n respond_to do |format|\n format.json { render :text => \"Could not create user.\", :status => :unprocessable_entity } # placeholder\n format.xml { head :ok }\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end",
"def create_user\n \t@user = User.new(user_params)\n @user.username = @user.name.split.sum\n \t@user.facility_id = current_user.facility_id\n \t@user.email = 'medinternational.dev'+@user.username.to_s + \"@gmail.com\"\n \t@user.language = \"english\"\n \t@user.password = \"password\"\n @user.role = Role.find_by_name(\"bmet_tech\")\n \trespond_to do |format|\n \t\tif @user.save\n \t\t\tformat.html { redirect_to settings_path, notice: 'User successfully created'}\n \t\t\tformat.json { redirect_to settings_path, notice: 'User successfully created'}\n \t\telse\n \t\t\tformat.html {redirect_to settings_path, notice: 'Failed to create user'}\n \t\t\tformat.json { render json: @user.errors, status: :unprocessable_entity}\n \t\tend\n \tend\n end",
"def create_admin_user(args = {})\n create(:user, :admin, email: args.fetch(:email), password: args.fetch(:password))\n end",
"def create_from_current_user\n @role = create_role(:person => @current_user, :verified => true)\n @role.save\n redirect_to event_url(@event), :notice => \"You have joined the event as a #{@role.class.name}\"\n end",
"def create_employee\n user = User.new(first_name: \"Nelson\", last_name: \"Muntz\", username: \"nmuntz\", email: \"chris+nmuntz@cryptographi.com\", password: 'muffins1', password_confirmation: 'muffins1', job_title: 'Worker Guy')\n company_domain = \"cryptographi.com\"\n team = Team.find_by(domain_name: company_domain)\n if !team\n create_manager\n team = Team.find_by(domain_name: company_domain)\n end\n user.team = team\n manager = User.find_by(email: 'chris+rwiggum@cryptographi.com')\n user.manager_id = manager.id\n if user.save\n user.add_role :employee\n end\n end",
"def create\n authorize! :manage_users, :all\n @user = User.new(params[:user])\n if @user.role == 'admin' or @user.role == 'teacher'\n @user.validation_scenario = 'admin_or_teacher'\n end\n respond_to do |format|\n if @user.save\n @user.add_role @user.role\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def user_create(name='admin', is_admin=true)\n key = \"#{name}:#{is_admin}\"\n UserCache.instance[key] ||= User.find_or_create_by_name(name) do |u|\n u.email_address = \"#{u.name}@concord.org\"\n u.password = u.password_confirmation = \"#{u.name}pAsS\"\n u.state = 'active'\n u.administrator = is_admin\n end\nend",
"def set_user\n @user = User.find(params[:id])\n # automatically add user right when we see the user\n # /!\\ it add to every and single user visited!\n if !@user.is_user?\n @user.roles << Role.where(name: 'user').first_or_create\n end\n end",
"def create\n @user = User.invite_user user_params\n if @user.save\n flash[:notice] = t('users.created_successfully')\n redirect_to users_path\n else\n @roles = Role.accessible_roles\n @user.role = @user.role_ids[0]\n render :new\n end\n end",
"def create\n @user = User.new(user_params.merge(password: '123456'))\n respond_to do |format|\n if @user.save\n @user.set_role(user_params[:role_type], current_users_company)\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new, notice: @user.errors.full_messages }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(field_params)\n # Dont allow the field_param to set the user_role to whatever they would like, only use one of the values we allow.\n role = field_params[:role]\n if role == User.EMP_ROLE then\n @user.role = User.EMP_ROLE\n elsif role == User.ADM_ROLE then\n @user.role = User.ADM_ROLE\n else\n @user.role = User.USR_ROLE\n end\n respond_to do |format|\n if @user.save\n UserMailer.welcome_email(@user).deliver\n format.html { redirect_to :root, alert: 'User was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end",
"def new_user\n\t\t@resource = User.new\n\t\t@resource_name = 'user'\n\tend",
"def set_default_role\n add_role :user\n end",
"def user_create\n # Users.destroy_all\n name_input = @prompt.ask(\"What is your name?\")\n username_input = @prompt.ask(\"What is your desired Username?\")\n location_input = @prompt.ask(\"What is your location? example: \\\"NY\\\"\")\n password_input = @prompt.ask(\"What is your password?\")\n @user = User.create(name: name_input, state: location_input, password: password_input, username: username_input)\n puts \"Congratulations! You created an account!\"\n user_menu_runner\n # Initialize user menu methods here\n end",
"def create_user_information # for new users. runs last according to rails.\n self.dj_name = name\n self.roles = Role.where(:title => 'noob')\n self.active = true\n set_password\n end",
"def create\n fix_password_params(params)\n @user = User.new(params[:user])\n @user.uuid = \"urn:uuid:#{SecureRandom.uuid}\"\n set_roles(@user, params)\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def upgrade_to_main_user\n self.is_main_user = true \n self.save \n \n admin_role = Role.find_by_name(USER_ROLE[:admin]) \n self.add_role_if_not_exists(admin_role ) \n end",
"def create\n params[:user][:user_role_id] ||= UserRole.lowest.id\n\n if !current_user.can_assign_role?(params[:user][:user_role_id])\n role = UserRole.find(params[:user][:user_role_id])\n render json: { error: { detail: \"Forbidden: This operation is only available to users with role '#{ role.name }'.\", status: 403 } }, status: 403\n return\n else\n @user = User.find_by_email(params[:user][:email])\n if @user\n raise CircaExceptions::BadRequest, \"User with email #{params[:user][:email]} already exists.\"\n else\n params[:user][:password] ||= SecureRandom.hex(8)\n if params[:user][:agreement_confirmed]\n params[:user][:agreement_confirmed_at] = Time.now\n end\n @user = User.create!(user_params)\n update_notes\n render json: SerializeUser.call(@user)\n return\n end\n end\n end",
"def create_user(obj, type)\n @logger.info(\"Creating user for #{type} #{obj.name}\")\n user = SugarCRM::User.new\n user.user_name = (type == 'agent') ? obj.emerchantpay_agent_id : obj.emerchantpay_iso_id\n user.user_name ||= \"EMP\"\n user.last_name = obj.name\n user.type_c = type\n #user.email1 = obj.email_address || \"mail@example.com\"\n user.email1 = 'stefan@emerchantpay.com'\n user.status = 'Inactive'\n user.system_generated_password = false\n user.save!\n obj.assigned_user_id = user.id\n obj.save!\n \n populate_user_pool(user, type)\n end",
"def new\n @role = Role.new(vendor_id: @vendor.id)\n @role.build_user\n end",
"def create_listserv_user\n User.create!({\n email: 'list-recipient@chat.mindhub.org',\n first_name: 'list-recipient',\n last_name: 'chat.mindhub.org',\n password: 'creativefresno',\n password_confirmation: 'creativefresno',\n remember_me: false\n })\nend",
"def create_user_type(type)\n if User.find_by_username(type).nil?\n User.create({ \n email: \"#{type}@#{type}.com\", \n username: \"#{type}\",\n university: University.first,\n role: User.roles[type],\n password: 'password',\n encrypted_password: Devise.bcrypt(User, 'password')\n })\n end\nend",
"def register user_name, project_name\n unless @client.project.member? user_name, project_name\n @client.role.create user_name\n @client.role.create user_name, project_name\n @client.project.add_member user_name, project_name\n end\n end",
"def setup_user(input)\n # Create user\n ctx[:model] = User::CreationService.create(input[:params], otp_timestamp: ctx[:otp_timestamp])\n ctx[:model] ? Success(ctx[:model]) : Failure(ErrorService.bad_request_fail(message: 'Error setting up user'))\n end",
"def create\n @user = User.new(user_params.merge(password: 'test1234'))\n respond_to do |format|\n if @user.save\n @user.set_role(user_params[:role_type])\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # Note this is different to the usual situation where anybody can create\n # an account. Here, only administrators can create accounts for others;\n # and doing so does not log them out.\n unless current_user.admin?\n flash[:error] = \"Users can only be created by administrators.\"\n redirect_to (request.env[\"HTTP_REFERER\"] || root_path) and return\n end\n \n @user = User.new(params[:user])\n success = @user && @user.save\n if success && @user.errors.empty?\n # Protects against session fixation attacks, causes request forgery\n # protection if visitor resubmits an earlier form using back\n # button. Uncomment if you understand the tradeoffs.\n # reset session\n redirect_to users_path\n flash[:notice] = \"The account #{ERB::Util.h @user.login} has been setup for #{ERB::Util.h @user.name}.\"\n else\n flash.now[:error] = \"We couldn't set up that account, sorry.\"\n render :action => 'new'\n end\n end",
"def create\n \n # Try to find the user in the database; if not found, invite\n user = User.find_for_authentication(email: user_role_user_params[:email])\n if user.nil?\n user = User.invite!( user_role_user_params, current_user )\n end\n \n # If the user is already in the current organization, stop\n if @organization.users.include? user\n flash[:notice] = \"%s (%s) is already a member of this organization.\" % [ user.nickname, user.email ]\n redirect_to organization_users_path( @organization ) and return\n end\n \n # Abort if errors given\n unless user.save\n @user_role.errors.add( :email, 'cannot be blank.' )\n flash[:error] = \"There were some issues with inviting the user. (Is the email valid?)\"\n\n # Update the passed parameters for this role\n else\n @user_role.user = user\n flash[:success] = \"%s (%s) was invited successfully.\" % [ @user_role.user.nickname, @user_role.user.email ] if @user_role.update_attributes(user_role_params)\n end\n\n redirect_to organization_users_path( @organization )\n end",
"def create\n @user = User.new(user_params)\n user.skip_confirmation!\n\n respond_to do |format|\n if user.save && update_roles\n format.html { redirect_to admin_user_path(user), notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: user }\n else\n format.html { render :new }\n format.json { render json: user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def make_user\n end",
"def add_creative_project_user\n creative_project_role = CreativeProjectRole.create( creative_project_id: self.id, \n role: 'project manager'\n )\n \n creative_project_user = CreativeProjectUser.create( user_id: self.user_id, \n creative_project_role_id: creative_project_role.id, \n creative_project_id: self.id,\n approved_by_project_manager: true,\n approved_by_user: true\n ) \n end",
"def create\n\t\t\t\t@user = User.create!(create_user_params)\n\t\t\tend",
"def create\n Statements::CreateRole.new(context: self)\n end",
"def create_test_user(options = {})\n client.test_user!(options).tap { |user| test_users << user }\n end",
"def create\n p = user_params\n p[:password] = SecureRandom.base64(8)\n\n @user = User.new(p)\n\n respond_to do |format|\n if @user.save\n if p[:is_admin]\n @user.user_roles.create(role: UserRole.roles[:stakeholder_admin])\n end\n\n @user.send_reset_password_instructions\n format.html { redirect_to [@stakeholder, @user], notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: [@stakeholder, @user] }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def gen_roled_user(role, pass=\"test\")\n FactoryGirl.create(:User, role: role, password: pass, password_confirmation: pass)\n end",
"def create_user\n # first insert into user_secrets and use it's id in users table\n @user_secret = UserSecret.using_client_shard(client: @client).create!(login_salt: @login_salt_hash[:ciphertext_blob])\n\n password_e = User.using_client_shard(client: @client).get_encrypted_password(@password, @login_salt_hash[:plaintext])\n\n @user = User.using_client_shard(client: @client).new(\n client_id: @client_id,\n email: @email,\n password: password_e,\n user_secret_id: @user_secret.id,\n status: GlobalConstant::User.active_status,\n last_logged_in_at: Time.now.to_i\n )\n\n @user.send(\"set_\" + GlobalConstant::User.doptin_mail_sent_property) if @client.is_verify_page_active_for_client?\n @user.save!\n end",
"def add_user_role user, role\n user_role = ProjectRoleUser.new\n user_role.project = self\n user_role.user = user\n user_role.role = role\n user_role.save\n end",
"def create\n @user = params[:user] ? User.new(params[:user]) : User.new_guest\n if @user.save\n flash[:notice] = \"Your account was created successfully.\"\n current.user.move_to(@user) if current.user && current.user.guest?\n session[:user_id] = @user.id\n redirect_to root_path\n else\n render \"new\"\n flash[:notice] = \"There was a problem creating your account.\"\n end\n after_create :set_admin \n end",
"def create_user(email = nil, login = nil, password = nil, first_name = nil, last_name = nil)\n if password == nil\n password = @pointconfig[\"generic_user_password\"]\n end\n\n res = query(\"principal-update\", \n \"email\" => email,\n \"login\" => login, \n \"password\" => password,\n \"first-name\" => first_name,\n \"last-name\" => last_name,\n \"send-email\" => false,\n \"has-children\" => 0, \n \"type\" => \"user\")\n\n puts \"ACS: user created\"\n return res.body\n end",
"def create_user_and_login \n\t\tinsert_into :users, {\n\t\t\tid: 1 ,\n\t\t\tfirst_name: 'First',\n\t\t\tlast_name: 'Last',\n\t\t\tlogin: 'login',\n\t\t\tpassword: 'password',\n\t\t\trole_id: 1,\n\t\t\tuid: \"a\"\n\t\t}\n\n\t\tproxy.post( 'http://my.ownet/api/session',{\n\t\t\tlogin: 'login',\n\t\t\tpassword: 'password'\n\t\t}.to_json)\n\tend"
] |
[
"0.7387777",
"0.72308457",
"0.7163344",
"0.7130941",
"0.7059115",
"0.7043294",
"0.7030763",
"0.6997465",
"0.6979949",
"0.6960953",
"0.69037014",
"0.6899519",
"0.68781",
"0.68759614",
"0.6812599",
"0.6790734",
"0.67841697",
"0.67789215",
"0.6777278",
"0.67709756",
"0.6769678",
"0.67609155",
"0.67583674",
"0.67524743",
"0.6752037",
"0.67493916",
"0.6734905",
"0.67005926",
"0.6686341",
"0.6678886",
"0.6657777",
"0.6639086",
"0.66371566",
"0.66272485",
"0.66266805",
"0.66266805",
"0.6619066",
"0.66190493",
"0.6601345",
"0.65983266",
"0.65789753",
"0.65702635",
"0.6567945",
"0.65529406",
"0.655256",
"0.6543865",
"0.6543865",
"0.65372705",
"0.65369153",
"0.6531027",
"0.65297157",
"0.6523837",
"0.6502808",
"0.6500917",
"0.65000105",
"0.64894557",
"0.6487207",
"0.64860547",
"0.6484689",
"0.64772695",
"0.646198",
"0.6460298",
"0.6457691",
"0.64525974",
"0.6445863",
"0.6444392",
"0.6443386",
"0.6434157",
"0.64332277",
"0.6432835",
"0.6422664",
"0.6418719",
"0.63928753",
"0.6371632",
"0.63654435",
"0.63577193",
"0.6356697",
"0.63557345",
"0.6348041",
"0.63454425",
"0.63446146",
"0.63383675",
"0.6336467",
"0.633161",
"0.63292456",
"0.63246304",
"0.63197047",
"0.6319482",
"0.63176006",
"0.63128644",
"0.63035727",
"0.6302873",
"0.62857974",
"0.62811214",
"0.62806666",
"0.62792933",
"0.6277357",
"0.6272404",
"0.6263166",
"0.6262942"
] |
0.7044467
|
5
|
This method will modify the user with the username specified
|
def local_user_modify(handle:, name:, **kwargs)
found_user = _get_local_user(handle, name)
if found_user.nil?
raise ImcOperationError.new("Modify Local User", "User doesn't exist")
end
found_user.set_prop_multiple(**kwargs)
handle.set_mo(mo: found_user)
return handle.query_dn(dn: found_user.dn)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_username(username)\n @username = username\n end",
"def edit_username(user, username)\n manager = UserManager.new\n if manager.user_exists?(username)\n return false\n else\n manager.remove( :username => user.username )\n user.username = username\n session[\"username\"] = username\n session[\"user\"] = user\n user.save_data\n end\n end",
"def update_user\n end",
"def update \n user = User.find_by(username: @current_user.username)\n user.update!(username_edit_params)\n response = { message: Message.account_edited, status: :ok}\n json_response(response)\n end",
"def update!(**args)\n @username = args[:username] if args.key?(:username)\n end",
"def update!(**args)\n @username = args[:username] if args.key?(:username)\n end",
"def update!(**args)\n @username = args[:username] if args.key?(:username)\n end",
"def update!(**args)\n @user_name = args[:user_name] if args.key?(:user_name)\n end",
"def update!(**args)\n @user_name = args[:user_name] if args.key?(:user_name)\n end",
"def change_username(new_name)\n update_username(new_name)\n @username = new_name\n puts \"Success! Your new username is #{@username}\".colorize(:light_green)\n @prompt.keypress('Press any key to continue..')\n menu = Menu.new(self)\n menu.account_details\n end",
"def username=(new_username)\n @username = new_username\n end",
"def username= new_username\n @username = new_username\n end",
"def user_name_set(name)\n self.username.set name if nil_or_empty?(username[:value])\n end",
"def modify_user \n logger.info(\"-------------------Called modyfy user with id: \"+params[:id])\n @user = User.find(params[:id])\n end",
"def set_user\n @User = User.find_by_username(params[:username])\n end",
"def set_user_name_field(user_name)\n end",
"def update\n edited_user = User.find(params[:id])\n edited_user.update( params.require(:user).permit(:username) )\n redirect_to \"/users/#{edited_user.id}\"\nend",
"def update\n @user = find_user(params[:username])\n\n if @user.update(user_params, current_user)\n redirect_to users_path\n else\n render('edit', status: :unprocessable_entity)\n end\n end",
"def set_user\n @user = User.find_by(username: params[:username])\n end",
"def set_user\n @user = User.find_by(username: params[:username])\n end",
"def username=(new_name)\n @username = new_name.upcase\n end",
"def update_user(username, params)\n\t\t\t\tif @session['datastore'].has_key?(username)\n\t\t\t\t\t@session['datastore'][username] = params\n\t\t\t\tend\n\t\t\tend",
"def set_user\n @user = User.find(username: params[:username])\n end",
"def edit_username(username)\n wait_until{ change_username_link.visible? }\n change_username_link.click\n username_tb.type_text username\n submit_edit_username_btn.click\n verify_password(QA_ENV['bus_password'])\n alert_accept\n wait_until{ !submit_edit_username_btn.visible? }\n end",
"def user=(username)\n contact = if username.is_a?(User)\n username.id\n else\n username\n end\n @tainted = true\n end",
"def set_user\n @user = User.find_by(username: params[:id])\n end",
"def set_user\n @user = User.where(:username => params[:id]).first!\n end",
"def add_user_name(username)\n\t\tuser_name_input.set(username)\n\tend",
"def modify_user(user)\n query_api_object User, \"/rest/user\", user.dump(), \"PUT\"\n end",
"def set_user\n @user = User.find_by(username: params[:username])\n end",
"def user=(username)\n @user ? find_and_update('//apps:login', userName: [@user, username]) : create('login', username)\n\n @user = username\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_user\n @user = User.find_by(\"username = ?\", params[:username])\n end",
"def modify_user(user)\n query_api_object Model::User, '/rest/user', user.to_hash, 'PUT'\n end",
"def set_user\n @user = User.where(username: params[:username]).take\n end",
"def new_username=(value)\n @new_username = (value.nil? ? value : value.upcase)\n end",
"def update_user(user_name:, user:)\n validate_user_name(:user_name, user_name)\n response = wrap_response(@connection.put(user_path(user_name), user))\n\n response.fmap { |r| SftpgoClient::ApiResponse.new(r.body) }\n end",
"def update_user(user_name, options = {})\n request({\n 'Action' => 'UpdateUser',\n 'UserName' => user_name,\n :parser => Fog::Parsers::AWS::IAM::UpdateUser.new\n }.merge!(options))\n end",
"def update\n user_params = params.require(:user).permit(:first_name, :last_name, :bio, :email, :image)\n user = User.find_by username: params[:username]\n if !user || user.id != session[:user_id]\n flash[:error] = \"You are not authorized to edit this user's profile.\"\n redirect_to user_path params[:username]\n else\n user.update_attributes(user_params)\n redirect_to user_path(user.username)\n end\n end",
"def username=(value)\n write_attribute(:username, value)\n reset_persistence_token if username_changed?\n end",
"def username=(user) #method name is username= and it takes on the user parameter and sets it equals to the username variable \n @username = user\n end",
"def set_user\n if params[:username]\n @user = User.find_by!(username: params.fetch(:username))\n else\n @user = current_user\n end\n end",
"def update_by_username\n if has_missing_params?([:user_name])\n # incomplete/invalid HTTP params\n render 'shared/http_status', locals: { code: '422', message:\n HttpStatusHelper::ERROR_CODE['message']['422'] }, status: 422\n return\n end\n\n # Check if that user_name is taken\n user = User.find_by_user_name(params[:user_name])\n if user.nil?\n render 'shared/http_status', locals: { code: '404', message:\n 'User was not found' }, status: 404\n return\n end\n user.attributes = process_attributes(params, {})\n\n unless user.save\n # Some error occurred\n render 'shared/http_status', locals: { code: '500', message:\n HttpStatusHelper::ERROR_CODE['message']['500'] }, status: 500\n return\n end\n\n # Otherwise everything went alright.\n render 'shared/http_status', locals: { code: '200', message:\n HttpStatusHelper::ERROR_CODE['message']['200'] }, status: 200\n end",
"def update_name(new_name)\n self.update(name: new_name)\n self\n puts \"Your username has been updated.\".colorize(:magenta)\n end",
"def set_user; end",
"def set_user\n @user = User.find(params[:user_name])\n end",
"def set_user\n puts \"STAN THE MANNNNNNNNNNN\"\n @user = User.find(params[:id])\n end",
"def update_username(new_name)\n updated_data = Login.load_data.each do |user|\n user['username'] = new_name if user['id'] == @uid.to_s\n end\n File.open(Login.userdata, 'w') do |f|\n f.puts JSON.pretty_generate(updated_data)\n end\n end",
"def setUserField(userName, fieldName, fieldValue)\n\n if userName != nil && fieldName != \"password\"\n user = loadUser(userName)\n user[fieldName] = fieldValue\n saveUser(userName, user)\n end\n end",
"def set_user\n if !(User.where(id: params[:id]).empty?)\n @user = User.find(params[:id])\n else\n @user = User.find_by_username(params[:username])\n end\n end",
"def username= username\n\t\t\tcheck_username username\n\t\t\t@username = username\n\t\tend",
"def modify_current_user(username: :undef, avatar: :undef)\n avatar = if avatar != :undef && !avatar.nil?\n image_data = avatar.io.read\n \"data:#{avatar.content_type};base64,#{Base64.encode64(image_data)}\"\n else\n :undef\n end\n json = filter_undef({ username: username, avatar: avatar })\n request(Route.new(:PATCH, '/users/@me'), json: json)\n end",
"def cmd_twitt_set_user(*args)\n\t\t\t\tif args.length > 0\n\t\t\t\t\tprint_status(\"Setting the DM target user to #{args[0]}\")\n\t\t\t\t\t@user = args[0]\n\t\t\t\telse\n\t\t\t\t\tprint_error(\"Please provide a value\")\n\t\t\t\tend\n\t\t\tend",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def edit_real_name(user, real_name)\n user.real_name = real_name\n user.save_data\n end",
"def update\n @user = User.find(params[:id])\n unless @account.admin || @account.username==@user.username\n flash[:warning] = \"You do not have enough access rights to edit this user.\"\n redirect_to root_path\n return\n end\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(root_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_user(user, username)\n ary = %w(site_admin site_manager site_spectator active)\n ary.each do |perm|\n if user.key?(perm) && !(user[perm].is_a? Boolean)\n return Hash[@error =>\n format('user object: %s must be True or False', perm)]\n end\n end\n\n hash_user_password(user)\n create_or_update(user, username, 'user', 'users', false)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def update\n return redirect_to :h_1 unless params[:user]\n\n if params[:user][:username]\n allow = User.username_allowed(params[:user][:username], :current_user => current_user)\n params[:user][:username] = allow[:allowed] ? allow[:regular] : \"\"\n end\n \n condition = params[:user][:username] || params[:user][:email] || params[:user][:password]\n \n updated = current_user.update_attributes params[:user] if !condition\n updated = current_user.update_with_password params[:user] if condition\n \n unless updated\n @errors = current_user.errors\n #cookies[:flavour] = current_user.flavour#why?\n end\n if updated\n set_current_locale current_user.locale\n set_current_time_zone current_user.time_zone\n end\n redirect_to request.referrer\n end",
"def update\n @user = User.find_by_username(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:success] = \"Account updated.\"\n format.html { redirect_to @user }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.78716147",
"0.7823836",
"0.7442999",
"0.74086004",
"0.72497815",
"0.72497815",
"0.72497815",
"0.7208261",
"0.7208261",
"0.7193359",
"0.7181561",
"0.71658754",
"0.7140313",
"0.70669776",
"0.70609844",
"0.705566",
"0.70283574",
"0.7007235",
"0.6992635",
"0.6992635",
"0.6987614",
"0.69873863",
"0.6986206",
"0.6980536",
"0.69697434",
"0.69667846",
"0.69660604",
"0.68778527",
"0.68686247",
"0.68585366",
"0.68485",
"0.68450814",
"0.6844523",
"0.6844523",
"0.6844523",
"0.6844523",
"0.6844523",
"0.6844523",
"0.6844523",
"0.6835595",
"0.68320286",
"0.68229157",
"0.6795148",
"0.67887795",
"0.677956",
"0.67791253",
"0.6767974",
"0.67601836",
"0.67549664",
"0.67467535",
"0.6745004",
"0.67285794",
"0.6715682",
"0.6715082",
"0.6697797",
"0.6688209",
"0.6686452",
"0.66833544",
"0.66776663",
"0.66775566",
"0.6673974",
"0.6673974",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.6673622",
"0.66703284",
"0.6667496",
"0.6661666",
"0.665272",
"0.665272",
"0.665272",
"0.665272",
"0.665272",
"0.665272",
"0.665272",
"0.665272",
"0.665272",
"0.665272",
"0.66313535",
"0.6623483"
] |
0.7371988
|
4
|
This method checks if a user exists with attributes passed
|
def local_user_exists(handle: nil, **kwargs)
users = _get_local_users(handle)
users.each do |user|
if user.check_prop_match(**kwargs)
return true, user
end
end
return false, nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def user_exists?(username)\n users(username: username).present?\n end",
"def user_exists?\n \t\tself.errors.add(:name, \"does not exist!\") unless self.user_id.present?\n \tend",
"def user_exists?(filter)\n not(user_tuple(filter, false).nil?)\n end",
"def has_user?(name, options={})\n run(\"id #{name}\").success?\n end",
"def does_user_exist (username)\n user = Account.find_by(:user_name=> username)\n if user\n return true\n else\n return false\n end\nend",
"def user_exists(name)\n self.all.any?{|user| user.name == name}\n end",
"def user_attributes=(attrs)\n self.user = User.where(attrs).first_or_initialize(attrs) \n @show_exists_message = !user.new_record?\n end",
"def user_exists?(name)\n @users.member?(name)\n end",
"def does_user_exist(username)\n user = Account.find_by(:user_name => username)\n if user\n return true\n else\n return false\n end\nend",
"def user_exists(user)\n users.include? user\n end",
"def user_exists?(user)\n return !get_user(user).nil?\n end",
"def does_user_exist?(email)\n user = User.find_by(email: email)\n if user\n return true\n else\n return false\n end\nend",
"def user_exists(user)\n @users.key?(user)\n end",
"def user_exists?\n\t !User.find_by_email(email).nil? ? true : false\n\tend",
"def check_user_exists\n not_a_user = { \"text\": \"You ain't a user - please sign up with this link: ENV['BASE_URL']/users/sign_up\" }\n unless User.exists?(username: params[:user_name])\n puts params[:user_name]\n render json: not_a_user\n end\n end",
"def user_exists?(user)\n @users.key?(user)\n end",
"def does_user_exist?(username)\n user = UsersModel.find_by(:name => username.to_s)\n if user\n return true\n else\n return false\n end\nend",
"def user_exists?\n return (session[:user_id] && User.find(session[:user_id])) ? true : false\n end",
"def user_exists?(email_address)\n !!read_user(email_address)\n end",
"def user_exists?(user_name)\n resp = iam.get_user(user_name: user_name)\n if resp.length > 0\n true\n else\n false\n end\nrescue ::Aws::IAM::Errors::NoSuchEntity\n false\nend",
"def does_user_exist(username)\n # note :db_column_name syntax like \"params[:id]\"\n user = Account.find_by(:user_name => username)\n if user\n return true\n else\n return false\n end\nend",
"def does_user_exist(user_name)\n user = Account.find_by(:user_name => user_name)\n if user\n return true\n else\n return false\n end\n end",
"def does_user_exist(user_name)\n user = Account.find_by(:user_name => user_name)\n if user\n return true\n else\n return false\n end\n end",
"def fetch_and_validate_user\n @user = User.using_client_shard(client: @client).where(client_id: @client_id, email: @email).is_active.first\n return error_with_identifier('invalid_api_params',\n 'um_u_c_ve_2',\n ['user_already_present']\n ) if @user.present?\n\n success\n end",
"def exists?(name)\n find_user(name)&.size != 0\n end",
"def user_id_exists\n begin\n User.find(self.user_id)\n rescue ActiveRecord::RecordNotFound\n errors.add(:user_id, \"user_id foreign key must exist\")\n false\n end\n end",
"def user_exists?(username)\n Sys::Admin.get_user(username)\n true\n rescue\n false\n end",
"def check_user_exists(username)\n\t \t\tresult = @db.exec(\"SELECT * FROM users where username = '#{username}'\")\n\t\t\tparams = result.map { |x| x }\n\t \t\tif params.empty?\n\t \t\t\treturn nil\n\t \t\telse\n\t \t\t\tuser = Leftovers::Users.new(params.first[\"username\"],params.first[\"organization\"])\n\t \t\t\treturn user\n\t \t\tend\n\t \tend",
"def user?\n @user = User.find_by(email: @email) if @userinfo\n\n # No user with that email so create the user with auth0_id.\n create_user_and_login @userinfo if @user.nil?\n end",
"def username_exists?(params)\n !!User.find_by(username: params[:username])\n end",
"def check_existing(input)\n user = User.find_by(email: input[:params][:email])\n user ? Failure(ErrorService.bad_request_fail(message: 'User exists')) : Success(input)\n end",
"def requires_user_existence!\n if not e.user_exists?\n error \"You have to setup your user before you can perform this action.\"\n exit\n end\n end",
"def exists?\n users(should_user, should_vhost)\n end",
"def user?(user)\n user.blank? and return false\n unless user.is_a?(UserInfo) # user is supposed to be given by its id.\n user = UserInfo.find(user.to_i)\n end\n user.is_a?(UserInfo) \n end",
"def user_present?\n user_token_present? && User.find_by(auth_token: user_token)\n end",
"def user_has? name\n\t\tuid = Sdb[:user_info].filter(:name => name).get(:uid)\n\t\tuid ? uid : nil\n\tend",
"def user?(username)\n\t\t\t\tif(users.has_key?(username))\n\t\t\t\t\treturn(true)\n\t\t\t\tend\n\n\t\t\t\treturn(false)\n\t\t\tend",
"def userexist \n\t\tdatadb = Register.where(name: params[:name], emailid: params[:email], password: params[:pass]).first\n \n if datadb.present? \n render json: [{message: 'user validate'}]\n else\n render json: [{message: 'user not validate'}]\n\tend\n\t\t\n\tend",
"def create?\n user.present?\n end",
"def create?\n user.present?\n end",
"def create?\n user.present?\n end",
"def user_exists?(user)\n User.find(user.id) != nil && (participants.where(user_id: user.id).count > 0 || user == super_admin)\n end",
"def does_exist(username)\n @user_manager.exists?(username)\n end",
"def user_exists_mobile\n @user = User.none\n if !params[:email].nil?\n @user = User.find_by(email: params[:email].downcase)\n end\n if @user.blank?\n render json: {status: \"failure\"}\n else\n render json: {status: \"success\", user: @user, protege: @user.protege, card: @user.protege.card}\n end\n end",
"def hasuser? username\n\t\t@cf.usermanager.user? username\t\t\n\tend",
"def user_defined?\n !@user.nil? || !@user['userId'].nil?\n end",
"def ensure_user(user_name, attributes={})\n user = User.find_by(:user_name => user_name)\n return user if user\n User.create!(attributes.merge(:user_name => user_name))\nend",
"def _user? name\n\t\tuid = DB[:_user].filter(:name => name).get(:uid)\n\t\tuid ? true : false\n\tend",
"def user?(user)\n\t\t\t\tif(users()[user] != nil)\n\t\t\t\t\tCfruby.controller.inform('debug', \"\\\"#{user}\\\" exists\")\n\t\t\t\t\treturn(true)\n\t\t\t\telse\n\t\t\t\t\tCfruby.controller.inform('debug', \"\\\"#{user}\\\" does not exist\")\n\t\t\t\t\treturn(false)\n\t\t\t\tend\n\t\t\tend",
"def user_exists(user_guid)\n user = @client.users.find { |usr|\n usr.guid == user_guid\n }\n if user == nil\n return false\n else\n return true\n end\n end",
"def user_params_exists\n return unless params[:user].blank?\n json_response({ success: false, message: \"Missing user parameters.\" }, :unprocessable_entity)\n end",
"def User?(_Id, _Pwd)\r\n _Flag = 0\r\n _Users = YAML.load(File.read(\"_User_Info.yml\"))\r\n #puts \"_Users: #{_Users}\"\r\n if !(_Users)\r\n else\r\n\r\n _Users.each do |user|\r\n if user.has_value?(_Id.to_i) && user.has_value?(_Pwd)\r\n _Flag = 1 #existing user with matching password\r\n puts \"Welcome back #{user[:Name]}!!\"\r\n end\r\n end\r\n end\r\n return _Flag\r\nend",
"def check_init\n\t\tu = User.find_by(jive_id: params[:user])\n\t\tif u and u.jive_id > 0\n\t\t\trespond({ status: 0, message: \"User exists\", user: u, client: u.client })\n\t\telsif u\n\t\t\tif u.jive_id > 0\n\t\t\t\trespond({ status: 1, error: \"User is not in DB.\" })\n\t\t\telse\n\t\t\t\trespond({ status: 1, error: \"User needs a Jive ID.\" })\n\t\t\tend\n\t\telse\n\t\t\trespond({ status: 1, error: \"User not found.\" })\n\t\tend\n\tend",
"def has_user?\n !user.nil?\n end",
"def user_exists?(name)\n Etc.getpwnam(name).name == name\n rescue ArgumentError\n false\n end",
"def user_exists?(name, host = nil)\n user = host ? ::MySQL::User.find_by_username_and_host(name, host) : ::MySQL::User.find_by_username(name)\n !user.nil?\n end",
"def has_user?(user)\n self.users.include?(user)\n end",
"def user_exists?(public_key)\n User.all(public_key: public_key).count > 0\n end",
"def user_exist?(email: nil)\n return users.any? { |existing_user| existing_user.email.casecmp(email.downcase).zero? }\n end",
"def user_exists? env, username\n return false if config.nil? || config.empty?\n return true if config[env].has_key? username\n end",
"def check_for_existing_user\n user = User.find_for_authentication(email: params[:user][:email])\n if user.present?\n flash[:alert] = t(\".flash_error\")\n redirect_to new_user_session_path(user: { email: params[:user][:email] })\n end\n end",
"def user\n @user = users(:exist)\n end",
"def userExists(userName)\n user = loadUser(userName)\n #puts \"User::::#{user}\"\n if(user != nil && (!user.key?(\"BLOCKED\") || user[\"BLOCKED\"] == false))\n return true\n end\n return false\n end",
"def user_exist?(id)\n DB[:users].select.where(:id=>id).all\nend",
"def check_found_user(u, path)\n if u.nil?\n @msg.add(:error, \"Counld not find the user.\");\n render(path);\n return false;\n end\n return true;\n end",
"def ensure_user_created\n if User.find_by_ldap_uid(ldap_user.uid)\n Rails.logger.debug(\"User in user table.\")\n true\n else\n Rails.logger.debug(\"User not in user table, redirecting to new user form.\")\n redirect_to(new_users_url) and return\n end\n end",
"def username_exists?(username)\n return User.find_by_username(username) != nil\nend",
"def user?(user)\n self.user_id == user.id if user\n end",
"def user?(user)\n self.user_id == user.id if user\n end",
"def user?(user)\n self.user_id == user.id if user\n end",
"def username_exist\n user = User.find_for_database_authentication(username: params[:user][:username])\n if user\n render json: {status: 500, message: \"Username is already taken.\"}\n else\n render json: {status: 200, message: \"Username is available.\"}\n end\n end",
"def user?(user)\n user.id == self.user_id if user\n end",
"def user_exists?\n\n @user = User.where(:username => params[:user][:username]).where([\"id NOT IN (?)\", current_user.id])\n\n if @user != []\n respond_to do |format|\n format.json { render :json => false}\n end\n else\n respond_to do |format|\n format.json { render :json => true}\n end\n end\n end",
"def is_existing_user(db, username)\n username_arr = db.execute(\"SELECT username FROM users\")\n username_arr.each do |user|\n if user[0] == username\n return true\n end\n end\n return false\nend",
"def create?\n @user != nil\n end",
"def exists\n render plain: nil,\n status: User.find_by_username(params[:username]) ? 200: 404\n end",
"def valid?\n params['user'] && params['user']['username'] && params['user']['password']\n end",
"def check\n api.get_user\n end",
"def user?(user)\n users.include? user\n end",
"def ifMember(group_id,user_id)\n GroupUser.where(:group_id => group_id, :user_id => user_id).exists? #change to current_user_id \n end",
"def has_existing_email?\n User.find_by_email(self.email).present?\n end",
"def exists?(name)\r\n User.exists?(name) || Organization.exists?(name)\r\n end",
"def existing_username\n valid = true\n existing_username = DATABASE.execute(\"SELECT * FROM members WHERE username = '#{username}';\")\n \n if !existing_username.empty?\n valid = false\n end\n return valid\n end",
"def validate_user\n\n cache_data = CacheManagement::User.new([@user_id]).fetch\n @user = cache_data[@user_id]\n\n return validation_error(\n 'e_sam_2',\n 'invalid_api_params',\n ['invalid_user_id'],\n GlobalConstant::ErrorAction.default\n ) if @user.blank?\n\n return error_with_data(\n 'e_sam_3',\n 'user_not_verified',\n GlobalConstant::ErrorAction.default,\n {}\n ) if @user[:properties].exclude?(GlobalConstant::User.is_user_verified_property)\n\n success\n\n end",
"def user?(user)\n user_id = case user\n when ::Integer\n user\n when ::String\n user.to_i\n when TheCity::User\n user.id\n end\n get(\"/users/#{user_id}\")\n true\n rescue TheCity::Error::NotFound\n false\n end",
"def creatable_by?(user)\n true\n end",
"def current_user_has_create?(uri, options=nil)\n opts = options || current_user.try(:user_options) || nil\n current_user.present? and current_user.has_create?(uri, opts)\n end",
"def exists?(name)\n User.exists?(name) || Organization.exists?(name)\n end",
"def create?\n\t\t!@user.nil?\n\tend",
"def test_email_username?\n # get the user by the supplied email\n here = true\n found = User.find_by(email: params[:email])\n # If it's not nil and not equal to current user\n if ( !found.nil? && !@user.equal(found))\n # Someone already has that email\n flash[:error] = \"Email already in use\"\n here = false\n end\n # get the user by the supplied username\n found = User.find_by(username: params[:username])\n # If it's not nil and not equal to current user\n if ( !found.nil? && !@user.equal(found))\n flash[:error] = \"Username already in use\"\n here = false\n end\n # Since username and email aren't currently being used\n return here\n end",
"def check_user_existence\n recipient = User.find_by(email: recipient_email)\n if recipient\n self.recipient_id = recipient.id\n end\n end",
"def valid_user?(user_id)\n user_ids.include?(user_id)\nend",
"def current_user_exists?\n return false if config.current_user.nil?\n return true\n end",
"def email_exist\n user = User.find_for_database_authentication(email: params[:user][:email])\n if user\n render json: {status: 500, message: \"Email is already taken.\"}\n else\n render json: {status: 200, message: \"Email is available.\"}\n end\n end",
"def exists?\n username && api_key\n end",
"def isUserValid?(user_name)\n @users.each do |user|\n if user.name == user_name\n then\n print \"User found!\"\n return true\n end\n end\n false\n end",
"def currentUserExists?\n # Get the current user.\n user = User.get(:current)\n \n # Check it exists.\n return User.exists?(user[\"id\"])\n rescue ActiveResource::UnauthorizedAccess\n @error = \"User unauthorized.\"\n return false\n rescue ActiveResource::ClientError => e\n @error = e.message\n return false\n rescue ActiveResource::ConnectionError => e\n @error = e.message\n return false\n rescue Errno::ECONNREFUSED => e\n @error = \"Unable to connect to #{@site}\"\n return false\n end",
"def create\n checkexists = User.find_by(email: user_params[:email], organization_id: user_params[:organization_id])\n\tif checkexists\n\t\tflash[:danger] = 'A user with this email address already exists within the specified organization'\n\t\tredirect_to '/signup.html'\n\telse\n\t\t@user = User.new(user_params)\n\t\t@user.write_attribute(:is_admin, false)\n\t\tif @user.save\n\t\t\trender 'show'\n\t\telse\n\t\t\trender 'new'\n\t\tend\n\tend\n end",
"def user_present?\n current_user.present?\n end",
"def exists?(user_id)\n connect_cassandra\n rows = @client.execute(\"SELECT user_id FROM users WHERE user_id = '#{user_id}'\")\n !rows.empty?\nend"
] |
[
"0.73523635",
"0.7290885",
"0.72592443",
"0.72361",
"0.723594",
"0.72062635",
"0.7183617",
"0.71822983",
"0.7174621",
"0.71717006",
"0.71655554",
"0.71623045",
"0.71515745",
"0.71074444",
"0.71017236",
"0.7095231",
"0.70929945",
"0.7080989",
"0.70613754",
"0.70435816",
"0.702299",
"0.69917125",
"0.69917125",
"0.697451",
"0.6944305",
"0.69402045",
"0.68743837",
"0.6869362",
"0.68344426",
"0.6824103",
"0.68229485",
"0.679586",
"0.6757649",
"0.6757335",
"0.67412645",
"0.6728264",
"0.6721178",
"0.67150986",
"0.6714887",
"0.6714887",
"0.6714887",
"0.6703334",
"0.6693354",
"0.66878384",
"0.6673423",
"0.6662375",
"0.66564435",
"0.6643999",
"0.66177666",
"0.66136444",
"0.6597543",
"0.65872383",
"0.65843487",
"0.6583529",
"0.6576024",
"0.6567176",
"0.6563161",
"0.65373176",
"0.6527666",
"0.652626",
"0.6519396",
"0.65124875",
"0.6508892",
"0.64947116",
"0.6493082",
"0.64874893",
"0.6463245",
"0.6463115",
"0.6463115",
"0.6463115",
"0.64429647",
"0.6435038",
"0.6430906",
"0.64187384",
"0.64101243",
"0.64066553",
"0.64052534",
"0.64042753",
"0.63885057",
"0.63862777",
"0.6381785",
"0.63803035",
"0.6374452",
"0.6373336",
"0.6367701",
"0.6361001",
"0.6357267",
"0.6339181",
"0.63367754",
"0.6336213",
"0.633476",
"0.63260174",
"0.63210565",
"0.63209224",
"0.63161606",
"0.63086534",
"0.63083315",
"0.63057315",
"0.62994546",
"0.62934685"
] |
0.6942355
|
25
|
s=spicelist(b) c : spice set check(b,s,c) : return point(minus) myspicelist(s,c) hoge1(b,s) : return c, &puts point blendlist() & spicelist(b)
|
def read() #read each lines
a=[]
f=open("blendlist.txt")
f.each_line {|line|
a[a.length] = line.chomp} #add line to a's last,cutting enter
f.close
return a
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def render_subset_extend_interp_spokes(shiftx, shifty, color, ibegin, iend, srep_index)\n\n iend.each_with_index do |p, i|\n#\tif p.size >= 4 and (p[3].is_a? Integer) and p[3] >= 0 and p[3] < 3 \n#\t @app.stroke $sreps[p[3]].color\n if srep_index == 0\n if $subset_index.include? i\n \n\t\tif p.size >=3 and (p[2].is_a? Integer) and p[2] >= 0 and p[2] < 3 \n\t\t @app.stroke $sreps[p[2]].color\n\n other_srep_index = p[2]\n other_srep_spoke_index = p[3]\n other_srep_spoke_begin = $sreps[other_srep_index].interpolated_spokes_begin[other_srep_spoke_index]\n @app.line(other_srep_spoke_begin[0]+shiftx, other_srep_spoke_begin[1]+shifty, p[0]+shiftx, p[1]+shifty)\n\t\telse \n\t\t @app.stroke color\n\t\tend\n \n\t\t@app.line(ibegin[i][0]+shiftx, ibegin[i][1]+shifty, p[0]+shiftx, p[1]+shifty)\n\t end\n end\n end\n end",
"def spice; end",
"def render_extend_interp_spokes(shiftx, shifty, color, ibegin, iend)\n \n\n iend.each_with_index do |p, i|\n#\tif p.size >= 4 and (p[3].is_a? Integer) and p[3] >= 0 and p[3] < 3 \n#\t @app.stroke $sreps[p[3]].color\n\n\tif p.size >=3 and (p[2].is_a? Integer) and p[2] >= 0 and p[2] < 3 \n\t @app.stroke $sreps[p[2]].color\n\telse \n @app.stroke color\n\tend\n @app.line(ibegin[i][0]+shiftx, ibegin[i][1]+shifty, p[0]+shiftx, p[1]+shifty)\n end\n end",
"def steal_engine(ltr, pool, stealable, pool_active=[], stealable_active=[], lv=1, candidates=nil)\n all_active = pool_active.join('') + stealable_active.join('')\n\n if candidates.nil?\n print '| '*lv+ \"STEALENGINE: Trying #{stealable_active} + #{pool_active} : \"\n\n candidates = ltr.find_superset_str(all_active)\n return false unless candidates\n\n #puts '| '*lv+ \"STEALENGINE: Trying #{stealable_active} + pool #{pool_active}\"\n puts '| '*lv+ \" : OK! Remain #{stealable} + #{pool}\"\n else\n puts '| '*lv+ \"continue : #{stealable_active} + #{pool_active}\"\n end\n\n puts '| '*lv+ \" : Some candidates: \"+candidates.join(', ')\n\n if stealable.empty? and pool.empty?\n puts '| '*lv+\"COMPLETE\"\n if (!pool_active.empty?) and normalize_word(all_active) == normalize_word(candidates[0])\n return candidates[0]\n else\n return false\n end\n end\n\n if stealable.empty?\n # Deplete the pool\n puts '| '*lv+ \"pool draw\"\n\n pool.each_index do |pool_idx|\n letter = pool[pool_idx]\n\n new_pool = pool.dup\n new_pool.delete_at(pool_idx)\n\n res = steal_engine(ltr, new_pool, stealable, pool_active + [letter], stealable_active, lv+1)\n if res\n return res\n end\n\n res = steal_engine(ltr, new_pool, stealable, pool_active, stealable_active, lv+1, candidates)\n if res\n return res\n end\n end\n\n else\n puts '| '*lv+ \"stealables draw\"\n\n stealable.each_index do |steal_idx|\n steal = stealable[steal_idx]\n\n new_stealable = stealable.dup\n new_stealable.delete_at(steal_idx)\n\n # Try adding this steal\n res = steal_engine(ltr, pool, new_stealable, pool_active, stealable_active + [steal], lv+1)\n if res\n return res\n end\n\n # Try without adding additional steal\n res = steal_engine(ltr, pool, new_stealable, pool_active, stealable_active, lv+1, candidates)\n if res\n return res\n end\n end\n\n end\n\n return false\nend",
"def blocks g1, g2\n (g1 + g2).flatten.map{|x| x.abs}.sort.uniq\nend",
"def merge_spice(spice)\n largs = spice.dup\n \n res = @spice.inject([]) do |res, sparg|\n # If we've used all the new spice, don't\n # touch any more of the old spice.\n if sparg.is_a?(SpiceArg) && !largs.empty?\n res + sparg.spice_arg(largs)\n else\n res << sparg\n end\n end\n \n res + largs\n end",
"def two_pt\n fg - three_p\n end",
"def all a,b\n a.prove {\n stands = false; \n b.prove { stands = true; break } \n return if not stands\n }\n yield\n end",
"def mod_sub (a, b)\n self.mod_add a, Ecc::Point.new(b.x, -b.y)\n end",
"def make_damage(a_point)\n \tmsj = 'hit'\n\tship = ship_at(a_point)\n\tship.get_hit(a_point)\n\tif(ship.state() == 'sink')\n\t\tremove_to_the_fleet(ship)\n\t\tmsj = 'sink'\n\tend\n\tmsj\t\n end",
"def render_interp_spokes(shiftx, shifty, color, ibegin, iend, srep_index)\n\n ibegin.each_with_index do |p, i|\n if ($colored_spoke_indices.include? i and srep_index == 0)\n @app.stroke Color.blue\n else\n @app.stroke color\n end\n @app.line(p[0]+shiftx, p[1]+shifty, iend[i][0]+shiftx, iend[i][1]+shifty)\n end\n end",
"def do_minus s; a = mega_pop(s); b = mega_pop(s); s[:stack].push(b-a); end",
"def crossover s1, s2\n b1, b2 = s1.map{|i| i.clone}, s2.map{|i| i.clone}\n if rand <= @crossover_rate\n point = rand_int(1, s1.length - 1)\n 0.upto(s1.length - 1) do |i|\n if i < point\n b2[i].path = s1[i].path\n else\n b1[i].path = s2[i].path\n end\n end\n end\n [b1, b2]\n end",
"def if_ins(i,spl); end",
"def sub_b\n end",
"def render_srep(*args)\n srep = args[0]\n shiftx = args[1]\n shifty = args[2]\n scale = args[3]\n show_sphere = args[4]\n show_sphere = false\n srep.atoms.each_with_index do |atom, i|\n render_atom(atom.x + shiftx, atom.y + shifty, atom.color)\n if show_sphere\n center_x = atom.x + shiftx - atom.spoke_length[0]\n center_y = atom.y + shifty - atom.spoke_length[0]\n d = atom.spoke_length[0] * 2\n # if (srep.index != 1 or i != 2)\n\t render_circle(center_x, center_y, d, srep.color)\n # else\n # render_circle(center_x+10, center_y+10, 80, srep.color)\n # end\n end\n if srep.show_extend_disk\n center_x = atom.x + shiftx - atom.expand_spoke_length[0]\n center_y = atom.y + shifty - atom.expand_spoke_length[0]\n d = atom.expand_spoke_length[0] * 2 \n render_circle(center_x, center_y, d, srep.color)\n end \n atom_x = atom.x+shiftx\n atom_y = atom.y+shifty\n #render_spokes(atom_x, atom_y, atom.type, atom.spoke_length, atom.spoke_direction, srep.color)\n end\n\n if srep.interpolated_spokes_begin.length > 0 and srep.show_interpolated_spokes\n spoke_begin = srep.interpolated_spokes_begin\n spoke_end = srep.interpolated_spokes_end\n render_interp_spokes(shiftx, shifty, Color.white, spoke_begin, spoke_end, srep.index)\n end\n\n if srep.show_curve\n # display the interpolated curve points\n render_curve($sreps, srep.index, srep, shiftx, shifty)\n end\n end",
"def test_leaving_lst_2_false_silver_found\n p = Prospector.new(0,0,0)\n\tp.gold_found = 1\n\tp.silver_found = 3\n\tp.num_loc_visited = 4\n\trefute p.leaving?\n end",
"def spouse; end",
"def uct(hull1,hull2)\n hull = hull1 + hull2\n edge = [right_most(hull_points(hull1)),left_most(hull_points(hull2))]\n list = []\n list.push(edge)\n visited = [edge.first,edge.last]\n while upper_tangent(hull,edge) == false do\n while upper_tangent(hull1,edge) == false do\n edge = [next_anti_point(hull1, edge[0],visited),edge[1]]\n visited.push(edge.first)\n list.push(edge)\n end\n while upper_tangent(hull2,edge) == false do\n edge = [edge[0],next_clock_point(hull2, edge[1],visited)]\n upper_tangent(hull2,edge)\n visited.push(edge.last)\n list.push(edge)\n end\n end\n\n list.map {|x| visited.push(x[0],x[1])}\n visited.uniq #deletion canditatates\n return edge, visited\nend",
"def lb(t, s, c)\n\n end",
"def checkSrepIntersection\n (0..$sreps.length-1).each do |j|\n (0..$sreps.length-1).each do |i|\n if i != j\n $sreps[j].checkIntersection($sreps[i])\n end\n end\n end\n end",
"def get_hit(a_point)\n\toccupied_points.reject! { |point| point.is_equal(a_point) }\n\tset_state('damage') \n\tcheck_if_is_sink()\n end",
"def superweening_adorningly(counterstand_pyrenomycetales)\n end",
"def lbu(t, s, c)\n\n end",
"def lcs(s1, s2); end",
"def moves_bishop(color, a, b)\n\t\t_moves = []\n\t\t(continue_up_right(color, a, b)).each{|move| _moves << move}\n\t\t(continue_up_left(color, a, b)).each{|move| _moves << move}\n\t\t(continue_down_right(color, a, b)).each{|move| _moves << move} \n\t\t(continue_down_left(color, a, b)).each{|move| _moves << move}\n\t\t_moves.compact\n end",
"def test\n b = bulls()\n c = cows()- b\n if b == 4\n puts 'Congrats!'\n return :win\n end\n puts \"\\t#{b} - bulls\\n\\t#{c} - cows\"\n end",
"def contesting_heads(our_snake, other_snakes)\n return if other_snakes.blank?\n our_head = our_snake[:body].first\n\n other_snakes.keep_if { |snake|\n (our_head[:x] - snake[:body].first[:x]).abs + (our_head[:y] - snake[:body].first[:y]).abs == 2\n }\n other_snakes.keep_if { |snake| snake_size(snake) >= snake_size(our_snake) }\n\n other_snakes.each do |snake|\n other_x = snake[:body].first[:x]\n other_y = snake[:body].first[:y]\n\n $potential[:down] -= 5 if (other_y > our_head[:y])\n $potential[:up] -= 4 if (other_y < our_head[:y])\n\n $potential[:right] -= 5 if (other_x > our_head[:x])\n $potential[:left] -= 4 if (other_x < our_head[:x])\n end\nend",
"def point_crossover(other, n)\n indexes = (0...self.size).to_a # Insieme degli indici possibili\n points = [] # Insieme di punti di taglio del crossover\n n.times { points.push(indexes.delete_at(rand(indexes.size))) } # Prende casualmente n indici (diversi) possibili e li include in points\n a, b = self, other \n son_str = (0...self.size).map do |i|\n a, b = b, a if points.include?(i) # Se incontra un punto di crossover effettua uno swap\n a[i] # Elemento da includere in son\n end\n son_str\n end",
"def oil_blend(oil1, oil2)\n puts \"The combo of #{oil1} and #{oil2} should smell good together.\"\n puts \"Let's try it!\"\nend",
"def bet(chips)\n\n end",
"def points; end",
"def two_point_crossover(other)\n point_crossover(other, 2)\n end",
"def surge; end",
"def GenDamagedBox(x1, y1, x2, y2)\n thickness = GetDim('silkwidth')\n #d = [(x1-x2).abs, (y1-y2).abs].min / 10.0\n d = ((x1-x2).abs + (y1-y2).abs) / 20.0\n if x1 < x2 \n x = x1 + d\n else\n x = x1 - d\n end\n if y1 < y2 \n y = y1 + d\n else\n y = y1 - d\n end\n PcbElementLine(x1, y, x1, y2, thickness) +\n PcbElementLine(x, y1, x2, y1, thickness) +\n PcbElementLine(x1, y, x, y1, thickness) +\n PcbElementLine(x2, y2, x2, y1, thickness) +\n PcbElementLine(x2, y2, x1, y2, thickness)\nend",
"def cross(v1, v2)\n dx, dy = v2[0] - v1[0], v2[1] - v1[1]\n cr = [] # array containing intersections\n\n if dx == 0 and dy ==0 then\n\tnc = 0\n elsif dx == 0 then\n\tt = ( 0.0 - v1[1] ) / dy # y = 0\n\tx , y = v1[0] + t * dx, v1[1] + t * dy\n cr.push( [x, y] ) if x >= 0 && x <= 1 && t >= 0 && t <= 1\n\tt = ( 1.0 - v1[1] ) / dy # y = 1\n\tx, y = v1[0] + t * dx, v1[1] + t * dy\n\tcr.push( [x, y] ) if x >= 0 && x <= 1 && t >= 0 && t <= 1\n elsif dy == 0 then\n\tt = ( 0.0 - v1[0] ) / dx # x = 0\n\tx, y = v1[0] + t * dx, v1[1] + t * dy\n\tcr.push( [x, y] ) if y >= 0 && y <= 1 && t >= 0 && t <= 1\n\tt = ( 1.0 - v1[0] ) / dx # x = 1\n\tx, y = v1[0] + t * dx, v1[1] + t * dy\n cr.push( [x, y] ) if y >= 0 && y <= 1 && t >= 0 && t <= 1\n else\n\tt = ( 0.0 - v1[1] ) / dy # y = 0\n\tx , y = v1[0] + t * dx, v1[1] + t * dy\n cr.push( [x, y] ) if x >= 0 && x <= 1 && t >= 0 && t <= 1\n\tt = ( 1.0 - v1[1] ) / dy # y = 1\n\tx, y = v1[0] + t * dx, v1[1] + t * dy\n\tcr.push( [x, y] ) if x >= 0 && x <= 1 && t >= 0 && t <= 1\n\tt = ( 0.0 - v1[0] ) / dx # x = 0\n\tx, y = v1[0] + t * dx, v1[1] + t * dy\n\tcr.push( [x, y] ) if y >= 0 && y <= 1 && t >= 0 && t <= 1\n\tt = ( 1.0 - v1[0] ) / dx # x = 1\n\tx, y = v1[0] + t * dx, v1[1] + t * dy \n cr.push( [x, y] ) if y >= 0 && y <= 1 && t >= 0 && t <= 1\n end\n return cr\n end",
"def wherecrossing(pt1,pt2, theface)\r\n line = [pt1, pt2]\r\n theface.loops.each { |loop|\r\n edges = loop.edges\r\n edges.each { |e| #check each edge to see if it intersects line inside the edge\r\n l2 = [e.vertices[0].position, e.vertices[1].position] # make a line\r\n point = Geom.intersect_line_line(line, e.vertices) # find intersection\r\n if (point != nil)\r\n online1 = isonline(point, line[0], line[1]) # is the point on the line\r\n online2 = isonline(point, e.vertices[0].position, e.vertices[1].position) # is the point on the edge\r\n #ent.add_cpoint(point) if (online1 and online2)\r\n #puts \"online1 #{online1} #{online2}\"\r\n return point if (online1 and online2)\r\n # if (online1 and online2) then we can return true here, no need to process more\r\n end\r\n } # edges.each\r\n } # loops.each\r\n return nil\r\n end",
"def one a,b=:true\n stands = false\n a.prove { \n b.prove {\n return if stands\n stands = true\n } \n }\n yield if stands\n end",
"def lh(t, s, c)\n\n end",
"def look_ahead_for_support_both_sides\n look_ahead_for_support do |left, right|\n left & right\n end\n end",
"def starship; end",
"def -\n a = pop\n b = pop\n push b - a\n end",
"def remix(drinks)\n alcohols = strip(drinks, 0)\n mixers = strip(drinks, 1)\n solution = mixer(alcohols, mixers)\nend",
"def failed_split(*bonds)\n puts \"Ground Truth: #{basic_split(*bonds).inspect}\"\n self.find_internal_adducts unless @adducts\n # binding.pry if bonds.size == 2\n returns = []\n mols = []\n mols2 = []\n product_mols = []\n if bonds.size > 0\n # set apart the adducts\n p delete_and_restore_bonds(*bonds) do |mol|\n mol.ob.separate.map(&:upcast)\n end\n bonds.each do |bond|\n delete_and_restore_bonds(bond) do |mol| \n mols = mol.ob.separate.map(&:upcast)\n puts \"MOLS: #{mols.inspect}\"\n mols = []\n adducts_present = []\n mol.ob.separate.map(&:upcast).map {|a| @adducts.include?(a) ? adducts_present << a : mols << a}\n puts \"MOLS: #{mols.inspect}\"\n product_mols << mols\n end\n end # bonds.each\n puts \"PMOLS: #{product_mols.inspect}\"\n mols\n else\n mols = self.ob.separate.map(&:upcast).delete_if {|a| @adducts.include?(a)}\n mols2 = mols.map(&:dup)\n mols_all = mols.map(&:dup)\n @adducts.map do |adduct|\n #mols2.each {|mol| mol.associate_atom! adduct.atoms.first }\n mols_all.product([adduct]).map {|mol, adduct| mol.associate_atom! adduct.atoms.first }\n mols2.product([adduct]).map {|mol, adduct| mol.associate_atom! adduct.atoms.first }\n end\n# p mols3\n# p mols_all\n# puts \"+\"*50\n# p mols2 != mols\n products = mols2 != mols ? mols.product(mols2) : [mols]\n # p products\n products.delete_if do |set|\n puts \"set: #{set}\"\n set.last.ob.separate.map(&:upcast).include?(set.first)\n puts \"set: #{set}\"\n end\n # p products\n #binding.pry\n #puts \"adduct_added: #{adduct_added.inspect}\"\n # Right now, I'm making the response sets of matched pairs, even if they have adducts... which they should?\n # Is there a better way to feed these back?\n #adduct_added.empty? ? mols : mols.flatten.sort_by(&:mol_wt).reverse.zip(adduct_added.sort_by(&:mol_wt))\n #products.first.is_a?(Array) ? products.flatten : products\n products\n end\n end",
"def strain; end",
"def free_bottles_and_caps(bottles, caps)\n from_bottles = bottles / BOTTLE_TO_REDEEM\n from_caps = caps / CAP_TO_REDEEM \n update_bottles(from_bottles, from_caps)\n from_bottles + from_caps\nend",
"def scribble(x1, y1, x2, y2, steps, scrib_val, style)\n \n x_step = (x2-x1) / steps\n y_step = (y2-y1) / steps\n (0 ... steps).each do |i|\n if(style == SCRIBBLE)\n if (i < steps-1)\n line(x1, y1, x1 += x_step+rand(-scrib_val..scrib_val), y1 += y_step + rand(-scrib_val..scrib_val)) \n else\n # extra line needed to attach line back to point- not necessary in HATCHING style\n line(x1, y1, x2, y2)\n end\n elsif (style == HATCHING)\n line(x1, y1, (x1 += x_step)+rand(-scrib_val..scrib_val), (y1 += y_step) + rand(-scrib_val..scrib_val))\n end\n end\nend",
"def compute(name, ref, span, snps)\n return if span.length < 1\n\n span.sort! {|a,b| a[0] <=> b[0]}\n head = span.shift\n ss,ee = head[0],head[1]\n array = []\n \n array << ss \n span.each do |breaks|\n array << breaks[0]\n array << breaks[1]\n end\n array << ee \n\n while array.size > 0\n s = array.shift\n e = array.shift\n# $stderr.puts \"#{ref}\\t#{s}\\t#{e}\"\n (s..e).each do |i|\n @coverage[ref][i] += 1 #Compute coverage on base i\n end\n end\n\n snps.each_key do |pos|\n refbase = @seq[ref][pos-1,1].upcase\n curbase = snps[pos][:snpbase]\n if snps.key?(pos + 1) or snps.key?(pos + 2) or snps.key?(pos - 1) or snps.key?(pos - 2)\n if snps.key?(pos + 1) and refbase == snps[pos+1][:snpbase] and curbase == @seq[ref][pos,1].upcase\n snps[pos][:info] << \"swap;\"\n elsif snps.key?(pos - 1) and refbase == snps[pos-1][:snpbase] and curbase == @seq[ref][pos-2,1].upcase \n snps[pos][:info] << \"swap;\"\n elsif snps.key?(pos + 2) and refbase == snps[pos+2][:snpbase] and curbase == @seq[ref][pos+1,1].upcase\n snps[pos][:info] << \"swap;\"\n elsif snps.key?(pos - 2) and refbase == snps[pos-2][:snpbase] and curbase == @seq[ref][pos-3,1].upcase\n snps[pos][:info] << \"swap;\"\n elsif snps.key?(pos + 1) or snps.key?(pos - 1) \n snps[pos][:info] << \"mnp;\"\n else\n snps[pos][:info] << \"snp;\" \n end\n else\n snps[pos][:info] << \"snp;\" \n end\n @snp[ref][pos] = '' unless @snp[ref].key?(pos)\n @snp[ref][pos] << snps[pos][:info]\n end\nend",
"def catAndMouse(x, y, z)\n dis1 = z - x\n dis2 = z - y\n p dis1\n p dis2\n dis1.negative? ? dis1 = dis1 * -1 : nil\n dis2.negative? ? dis2 = dis2 * -1 : nil\n if dis1 < dis2\n \"Cat A\"\n elsif dis2 < dis1\n \"Cat B\"\n else\n \"Mouse C\"\n end\nend",
"def one_point_crossover(other)\n point_crossover(other, 1)\n end",
"def laboonify(a, b)\n puts \"Laboonifying #{a} and #{b}\"\n a * 2 + b\n end",
"def math(b1,b2,goal)\r\n\r\n\t# link to math:\r\n\t# http://www.math.tamu.edu/~dallen/hollywood/diehard/diehard.htm\r\n\t# mp = nq = k\r\n\t# (x)(b1) + (y)(b2) = goal\r\n\r\n\tx = 0\r\n\ty = 0\r\n\tcurrent_total = 0\r\n\r\n\t#determine x and y mathematically\r\n\twhile (current_total != goal) do\r\n\r\n\t\tif current_total < goal\r\n\t\t\tx += 1\r\n\t\telsif current_total > goal\r\n\t\t\ty -= 1\r\n\t\tend\r\n\r\n\t\tcurrent_total = x*b1.size + y*b2.size\r\n\t\tputs \"X: #{x}, Y: #{y}, CT: #{current_total}\"\r\n\r\n\tend\r\n\r\nend",
"def test_leaving_first_3_false_both_found\n p = Prospector.new(0,0,0)\n\tp.gold_found = 3\n\tp.silver_found = 4\n\tp.num_loc_visited = 3\n\trefute p.leaving?\n end",
"def subtract_point \n\t\t@lives -= 1\n\tend",
"def excise connected_components, gses, gsms\n excisions = 0\n connected_components.each { |c|\n print \"Connected component with #{c.length} GSEs:\\n\"\n c.each { |gse1|\n c.each { |gse2|\n next if (gse1 == gse2) or\n (gsms[gse1].length < gsms[gse2].length) or\n ! gsms[gse1].intersect?( gsms[gse2] )\n\n diff = gsms[gse1] - gsms[gse2]\n if diff.length >= @options.minimum # default: there must be at least 3 samples left\n inter = (gsms[gse1] & gsms[gse2])\n if @excisions\n if @excised[gse1] \n @excised[gse1] = (@excised[gse1] + inter)\n else\n @excised[gse1] = inter\n end\n end\n print \"gsms[#{gse1}]: #{gsms[gse1].length} -> #{diff.length}\\n\"\n if @options.verbose and @options.dictionary\n printf \"removing these GSMs from #{gse1}:\\n\"\n stringify_gsms inter\n end\n gsms[gse1] = diff\n excisions += 1\n end\n }\n }\n }\n\n print \"Number of excisions: #{excisions}\\n\"\n \n print \"\\nPairwise overlaps after excision:\\n\"\n overlapping = overlaps(gses.to_a, gsms, true)\n print \" total overlaps: #{overlapping[0]}\\n\"\n print \" nontrivial overlaps: #{overlapping[1]}\\n\"\n overlapping[1]\nend",
"def two_pt_a\n fga - three_p_a\n end",
"def sb(t, s, c)\n\n end",
"def spare?\n @ball1 + @ball2 == PINS\n end",
"def colliBall_h(balls)\r\n for molecule, mol_col_chk in balls.combination(2)\r\n if mol_col_chk.collide?(molecule) && (! molecule.noCollideList.include?(mol_col_chk))\r\n if @crn.reactions.key?([molecule.species, mol_col_chk.species]) \r\n @balls += split(@balls, [molecule, mol_col_chk], @crn.reactions[[molecule.species, mol_col_chk.species]][1])\r\n else \r\n #bounce around when it is not a reaction\r\n temp = Marshal.load(Marshal.dump(molecule.v))\r\n molecule.v = Marshal.load(Marshal.dump(mol_col_chk.v))\r\n mol_col_chk.v = temp\r\n end #no coList\r\n else\r\n molecule.noCollideList = molecule.noCollideList - [mol_col_chk]\r\n mol_col_chk.noCollideList = mol_col_chk.noCollideList - [molecule]\r\n end # if collide\r\n end #for\r\n end",
"def sweep; end",
"def clash_check(a, b)\n\tclashes = []\n a.each do |a_start, a_finish|\n range_a = a_start..a_finish\n\n # check against each of b's slots\n b.each do |b_start, b_finish|\n range_b = b_start..b_finish\n \n # detect overlap of ranges\n # if Rails: range_a.overlaps?(range_b)\n if range_a.cover?(range_b.first) || range_b.cover?(range_a.first) \n\t\t\t\tclashes << [range_a, range_b]\n end\n end\n end\n clashes.empty?\nend",
"def test_leaving_first_3_false_silver_found\n p = Prospector.new(0,0,0)\n\tp.gold_found = 0\n\tp.silver_found = 1\n\tp.num_loc_visited = 3\n\trefute p.leaving?\n end",
"def slop!; end",
"def slop!; end",
"def golden_section(direction=:both, exp=1)\nif direction==:both\nCGPoint.new(self.x.golden_section(exp), self.y.golden_section(exp))\nelsif direction==:x\nCGPoint.new(self.x.golden_section(exp), self.y)\nelsif direction==:y\nCGPoint.new(self.x, self.y.golden_section(exp))\nelse\n raise \"CGPoint: unknown direction #{direction}\"\nend\nend",
"def mismatches_in_horizon h, o1, o2, s, c1 = @sc1.cycle_time, c2 = @sc2.cycle_time\n tt = traveltime(s)\n \n for b1 in @sc1.greenwaves(h, o1, @from_direction, c1)\n b1.shift!(tt) # project this emitted band forward in time\n uncovered_bands = [b1]\n bands2 = @sc2.greenwaves(b1.to_r, o2, @from_direction, c2)\n # b1 shifted is now all potential mismatches;\n # use the bands from sc2 to chop off pieces\n while b2 = bands2.shift and not uncovered_bands.empty?\n b1 = uncovered_bands.pop\n remaining = b1.subtract(b2)\n uncovered_bands.concat remaining\n end\n \n uncovered_bands.each{|b|yield b}\n end\n end",
"def iscrossing(pt1,pt2, theface)\r\n line = [pt1, pt2]\r\n theface.loops.each { |loop|\r\n edges = loop.edges\r\n edges.each { |e| #check each edge to see if it intersects line inside the edge\r\n l2 = [e.vertices[0].position, e.vertices[1].position] # make a line\r\n point = Geom.intersect_line_line(line, e.vertices) # find intersection\r\n if (point != nil)\r\n online1 = isonline(point, line[0], line[1]) # is the point on the line\r\n online2 = isonline(point, e.vertices[0].position, e.vertices[1].position) # is the point on the edge\r\n #ent.add_cpoint(point) if (online1 and online2)\r\n #puts \"online1 #{online1} #{online2}\"\r\n return true if (online1 and online2)\r\n # if (online1 and online2) then we can return true here, no need to process more\r\n end\r\n } # edges.each\r\n } # loops.each\r\n return false\r\n end",
"def joining_forces; end",
"def client_code2(component1, component2)\n component1.add(component2) if component1.composite?\n\n print \"RESULT: #{component1.operation}\"\nend",
"def mix\n\n # Abort if there is no glass inside the replicator.\n return unless glass_inside_replicator\n\n # Draw power if possible and then mix ingredients around.\n if @power && @enterprise.reactor.draw_power(3)\n glass_inside_replicator.inside.contents.shuffle!.compact!\n end\n end",
"def blend(smoothie_ingredients)\n mix_ingredients = smoothie_ingredients.keys.join.split(//).shuffle\n return mix_ingredients.join.delete(\" \")\nend",
"def output_lcs_blosum(backtrack, v, w, i, j)\n\n v_str = \"\"\n w_str = \"\"\n\n loop do\n # break if (i == 0 || j == 0)\n break if (i == 0)\n # puts i.to_s + \" \" + j.to_s + \" \" + backtrack[i][j]\n if backtrack[i][j] == \"down\"\n v_str += v[i-1]\n w_str += \"-\"\n i -= 1\n elsif backtrack[i][j] == \"right\"\n v_str += \"-\"\n w_str += w[j-1]\n j -= 1\n else\n v_str += v[i-1]\n w_str += w[j-1]\n i -= 1\n j -= 1\n end\n end\n\n # puts v_str.reverse\n # puts w_str.reverse\n return [v_str.reverse, w_str.reverse]\n # return [v_str, w_str]\n <<-DOC\n OUTPUTLCS(backtrack, v, i, j)\n if i = 0 or j = 0\n return\n if backtracki, j = \"↓\"\n OUTPUTLCS(backtrack, v, i - 1, j)\n else if backtracki, j = \"→\"\n OUTPUTLCS(backtrack, v, i, j - 1)\n else\n OUTPUTLCS(backtrack, v, i - 1, j - 1)\n output vi \n DOC\n\n # return if (i == 0 || j == 0)\n # if backtrack[i][j] == \"del\"\n # output_lcs_blosum(backtrack, v, w, i-1, j) \n # print \"-\"\n # elsif backtrack[i][j] == \"add\"\n # output_lcs_blosum(backtrack, v, w, i, j-1) \n # print \"-\"\n # # elsif backtrack[i][j] == \"mismatch\"\n # # output_lcs(backtrack, v, w, i-1, j-1) \n # # print \"-\"\n # else\n # output_lcs_blosum(backtrack, v, w, i-1, j-1) \n # print v[i-1]\n # print w[j-1]\n # end\n end",
"def test_leaving_first_3_false_gold_found\n p = Prospector.new(0,0,0)\n\tp.gold_found = 1\n\tp.silver_found = 0\n\tp.num_loc_visited = 3\n\trefute p.leaving?\n end",
"def adjacent_heads(our_snake, other_snakes)\n our_head = our_snake[:body].first\n other_snake_heads = other_snakes.map { |s| s[:body].first }\n\n other_snake_heads.keep_if { |head| is_adjacent?(our_head, head) }\n return other_snake_heads\nend",
"def union(lb)\n\n\n\n\n\n end",
"def bbSub(first_point, second_point)\n\n bbp(first_point.x - second_point.x, first_point.y - second_point.y)\n end",
"def |\n a = pop\n b = pop\n push (a == -1) || (b == -1) ? -1 : 0\n end",
"def blend(ingredients)\n smoothie = ''\n ingredients.each do |x,y|\n smoothie += x\n end\n puts smoothie.gsub(/\\s+/, \"\").split(\"\").shuffle!.join\nend",
"def inherit(a=\"X\", b=\"Y\")\n x = \"X\"\n y = \"Y\"\n flip = 1 + rand(2)\n if flip == 2 \n x = a.gene[1,1]\n else\n x = a.gene[0,1]\n end\n flip = 1 + rand(2)\n if flip == 2 \n y = b.gene[1,1]\n else\n y = b.gene[0,1]\n end\n puts \"#{x}#{y}\"\n return \"#{x}#{y}\"\nend",
"def extract(s, a, b)\n sq = s.floor_sqrt\n e = s - a * a\n raise \"!!!\" if (e % b > 0)\n e = e / b\n c = 1\n d = a - e\n while s > (d - e) * (d - e) #extracting part\n d -= e\n c += 1\n end\n return [c, -d, e]\nend",
"def test_subtract\n @eval.load_stacks([5, 5, '-'])\n assert_equal 0, @eval.quick_maffs_a('-')\n end",
"def flip_range_neg_xy(points); points.collect{ |v| Vertex.new(v.y,v.x)}; end",
"def eaurang(a, b)\n a - b;\nend",
"def contains?(point_or_bb)\n end",
"def test_house_blend\n beverage = HouseBlend.new\n beverage = Soy.new(beverage)\n beverage = Mocha.new(beverage)\n beverage = Whip.new(beverage)\n assert_equal(\"House Blend Coffee, Soy, Mocha, Whip\",\n beverage.description)\n assert_equal(1.34, beverage.cost)\n end",
"def interior_steel(entities)\n#draw_rectangle(\"EW1\",70*12, 14*12+8, 20*12, entities)\n\n\tif($interior_steel != \"\")\n\t\n\t\tif($oh1 >= $oh2)\n\t\ta = entities.add_line([0,0,$height],[0,$width,$height])\n\t\tb = entities.add_line([0,0,$height],[0,0,$height1])\n\t\t\t\t\ta.faces[0].back_material = $interior_steel\n\t\t# if($oh1 <= $oh2)\n\n\t\t# else\n\t\t\t# a.faces[1].back_material = $interior_steel\n\t\t# end\n\t\t\n\t\t#entities.add_line([$length,0,$height],[$length,0,$height1])\n\n\n\t\tf = entities.add_line([$length,0,$height],[$length,0,$height1])\n\t\te = entities.add_line([$length,0,$height],[$length,$width,$height])\n\t\te.faces[1].back_material = $interior_steel\n\n\t\tentities.add_line([0,0,$height],[$length,0,$height])\n\t\td = entities.add_line([$corner,0,$height1],[$length-$corner, 0, $height1])\n\t\t\n\t\t\n\t\t\n\t\td.find_faces\n\t\td.faces[0].back_material = $interior_steel\n\t\td.faces[2].back_material = $interior_steel\n\t\tif($height1 == $height2)\n\t\t\td.faces[2].erase!\n\t\tend\n\n\t\tc = entities.add_line([$corner,$width,$height2],[$length-$corner,$width,$height2])\n\t\tc.faces[0].back_material = $interior_steel\n\t\tend\n\t\t\n\t\tif($oh1 < $oh2)\n\t\ta = entities.add_line([0,0,$height],[0,$width,$height])\n\t\tb = entities.add_line([0,$width,$height],[0,$width,$height2])\n\t\t\t\t\ta.faces[0].back_material = $interior_steel\n\t\t# if($oh1 <= $oh2)\n\n\t\t# else\n\t\t\t# a.faces[1].back_material = $interior_steel\n\t\t# end\n\t\t\n\t\t#entities.add_line([$length,0,$height],[$length,0,$height1])\n\n\n\t\tf = entities.add_line([$length,$width,$height],[$length,$width,$height2])\n\t\te = entities.add_line([$length,0,$height],[$length,$width,$height])\n\t\te.faces[1].back_material = $interior_steel\n\n\t\tentities.add_line([0,0,$height],[$length,0,$height])\n\t\td = entities.add_line([$corner,0,$height1],[$length-$corner, 0, $height1])\n\t\t\n\t\t\n\t\t\n\t\td.find_faces\n\t\td.faces[1].back_material = $interior_steel\n\t\t\t\td.faces[0].back_material = $interior_steel\n\t\t#d.faces[2].back_material = $interior_steel\n\t\tif($height1 == $height2)\n\t\t\td.faces[2].erase!\n\t\tend\n\n\t\tc = entities.add_line([$corner,$width,$height2],[$length-$corner,$width,$height2])\n\t\tc.faces[0].back_material = $interior_steel\n\t\tend\n\t\t\n\t\t\n\t\t\n\tend\nend",
"def sum_of_cubes(a, b)\n set = (a..b) {|num| num**3}\n \nend",
"def hook_solution?(a); end",
"def is_obstructed?(piece1_loc, destination)\r\n# converts the location arrays into easier-to-read x and y terms\r\n x1 = piece1_loc[0]\r\n y1 = piece1_loc[1]\r\n x2 = destination[0]\r\n y2 = destination[1]\r\n if piece2_loc != nil\r\n x3 = piece2_loc[0]\r\n y3 = piece2_loc[1]\r\n end\r\n # Determines whether the line between piece 1 and the destination is horizontal or vertical. \r\n # If neither, then it calculates the slope of line between piece 1 and destination. \r\n # If a second piece is given, then it also calculates the slope between piece 1 and piece 2.\r\n if y1 == y2\r\n horizontal = true\r\n elsif x1 == x2\r\n vertical = true\r\n else\r\n slope_dest = (y2-y1).to_f/(x2-x1).to_f\r\n end\r\n\r\n\tif horizontal && x1 < x2\r\n\t\t(x1+1..x2-1).each do |x|\r\n\t\t\treturn true if is_occupied?(x, y1)\r\n\t\tend\r\n\telsif horizontal && x1 > x2\r\n\t\t(x2+1..x1-1).each do |x|\r\n\t\t\treturn true if is_occupied?(x, y1)\r\n\t\tend\r\n\telsif vertical && y1 < y2\r\n\t\t(y1+1..y2-1).each do |y|\r\n\t\t\treturn true if is_occupied?(x1, y)\r\n\t\tend\r\n\telsif vertical && y1 > y2\r\n\t\t(y2+1..y1-1).each do |y|\r\n\t\t\treturn true if is_occupied?(x1, y)\r\n\t\tend\r\n\telsif horizontal || vertical\r\n\t\treturn false\r\n\telsif slope_dest.abs == 1.0 && x1 < x2\r\n\t\t(x1+1..x2-1).each do |x|\r\n\t\t\tdelta_y = x-x1\r\n\t\t\ty = y2 > y1 ? y1 + delta_y : y1 - delta_y\r\n\t\t\treturn true if is_occupied?(x, y)\r\n\t\tend\r\n\telsif slope_dest.abs == 1.0 && x1 > x2\r\n\t\t(x2+1, x1-1).each do |x|\r\n\t\t\tdelta_y = x1-x\r\n\t\t\ty = y2 > y1 ? y1 + delta_y : y1 - delta_y\r\n\t\t\treturn true if is_occupied?(x, y)\r\n\t\tend\r\n\telsif (slope_dest.abs != 1.0)\r\n\t\tfail 'path is not a straight line'\r\n\telse return false\r\n\tend\r\n\t\r\nend",
"def cops; end",
"def cops; end",
"def cops; end",
"def test_house_blend\n beverage = HouseBlend.new\n beverage = Soy.new(beverage)\n beverage = Mocha.new(beverage)\n beverage = Whip.new(beverage)\n assert_equal(\"House Blend Coffee, Soy, Mocha, Whip\", \n beverage.description)\n assert_equal(1.34, beverage.cost)\n end",
"def test_house_blend\n beverage = HouseBlend.new\n beverage = Soy.new(beverage)\n beverage = Mocha.new(beverage)\n beverage = Whip.new(beverage)\n assert_equal(\"House Blend Coffee, Soy, Mocha, Whip\",\n beverage.description)\n assert_equal(1.34, beverage.cost)\n end",
"def bizet; end",
"def convex_hull\n a = @points.to_a\n left = a.first\n a = a[1..-1]\n right = a.pop\n puts \"left = #{left} right = #{right} a = #{a.map{|p| p.to_s}.join(\", \")}\" if @debug\n upper = []\n lower = []\n # Partition remaining points into upper and lower buckets\n a.each do |p|\n dir = direction(left, right, p)\n puts \"p = #{p} dir = #{dir}\" if @debug\n if dir < 0\n upper << p\n else\n lower << p\n end\n end\n puts \"upper = #{upper.map{|p| p.to_s}.join(', ')}\" if @debug\n puts \"lower = #{lower.map{|p| p.to_s}.join(', ')}\" if @debug\n upper_hull = half_hull(left, right, upper, -1)\n lower_hull = half_hull(left, right, lower, 1)\n puts \"upper_hull = #{upper_hull.map{|p| p.to_s}.join(', ')}\" if @debug\n puts \"lower_hull = #{lower_hull.map{|p| p.to_s}.join(', ')}\" if @debug\n (upper_hull + lower_hull).uniq\n end",
"def tr!(p0, p1) end",
"def bigger_two(list_1,list_2)\n puts \"running code\"\n sum_one = list_1[0] + list_1[1]\n sum_two = list_2[0] + list_2[1]\n #changed variable name to sum because thats more clear than x and y\n if sum_one > sum_two\n return list_1\n else #used else to condense code\n return list_2\n end\n if sum_two = sum_one\n return list_1\n end\nend",
"def upc_a_with_composite_symbology; end",
"def manscape(input, a, b, a_plus_minus, b_plus_minus)\n trimmings = input[input.index(a)+a_plus_minus..input.index(b)+b_plus_minus]\n the_rest = input[input.index(b)+b_plus_minus..input.length]\n return [trimmings, the_rest]\nend",
"def hop; end"
] |
[
"0.5867874",
"0.5625464",
"0.54316103",
"0.5350838",
"0.5312374",
"0.52832705",
"0.5278998",
"0.52604115",
"0.52431065",
"0.5236236",
"0.5231217",
"0.52173835",
"0.51902956",
"0.51677024",
"0.5162017",
"0.5160616",
"0.51587653",
"0.51474094",
"0.5146269",
"0.5130203",
"0.5113588",
"0.5098224",
"0.5083853",
"0.506604",
"0.50627774",
"0.5061319",
"0.5024036",
"0.4993251",
"0.49885404",
"0.4972245",
"0.49532038",
"0.49497938",
"0.4947703",
"0.49414957",
"0.4936823",
"0.49326968",
"0.49284464",
"0.49193245",
"0.49130675",
"0.49124384",
"0.48933998",
"0.48912016",
"0.4887563",
"0.4885386",
"0.48792768",
"0.4878198",
"0.48754463",
"0.48705295",
"0.4867728",
"0.48626572",
"0.48536497",
"0.48437384",
"0.48415813",
"0.48403874",
"0.4840084",
"0.48367527",
"0.48341408",
"0.48303822",
"0.4830107",
"0.48276362",
"0.48270938",
"0.4823501",
"0.48199648",
"0.48199648",
"0.48151326",
"0.48029262",
"0.4801285",
"0.4799659",
"0.47993082",
"0.47925183",
"0.47761714",
"0.47665763",
"0.4756205",
"0.47538078",
"0.4747053",
"0.47454125",
"0.4739506",
"0.4737132",
"0.4729579",
"0.47274777",
"0.4724113",
"0.47209165",
"0.47171944",
"0.47125268",
"0.47110972",
"0.47094548",
"0.4708398",
"0.47055405",
"0.4704512",
"0.4697767",
"0.4697767",
"0.4697767",
"0.4695624",
"0.46953005",
"0.4694867",
"0.4692736",
"0.4687297",
"0.46856442",
"0.46840096",
"0.46829516",
"0.46823636"
] |
0.0
|
-1
|
Question 4 Using shift in the loop returns [1,3] Using pop in the loop returns [1,2]. Question 5
|
def factors(number)
dividend = number
divisors = []
number.times do
divisors << number / dividend if number % dividend == 0
dividend -= 1
end
divisors
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def pop()\n (@arr1.size-1).times { @arr2.push(@arr1.shift) }\n result = @arr1.shift\n @arr1, @arr2 = @arr2, @arr1\n result\n end",
"def pop\r\n @arr.shift\r\n end",
"def shift\n @arr.shift\n end",
"def pop\n while @q1.length > 1\n @q2.push(@q1.shift)\n end\n\n result = @q1.shift\n @q1 = @q2\n @q2 = []\n @count -= 1\n\n return result\n end",
"def using_shift(arr)\n arr.shift\nend",
"def pop()\n last = nil\n @q1.size.times do\n last = @q1.shift\n @q2.push last\n end\n (@q2.size-1).times do \n @q1.push(@q2.shift)\n end\n @q2.shift\n last\n end",
"def shift(arr)\n puts arr.to_s\n arr.shift\n arr.push(0)\n puts arr.to_s\nend",
"def using_shift (array)\n return array.shift\nend",
"def using_shift(array)\n array = array.shift(1)\n array.shift\n \nend",
"def using_shift(array)\n array.shift\nend",
"def using_shift(array)\n array.shift\nend",
"def using_shift(array)\n array.shift\nend",
"def using_shift(array)\n array.shift\nend",
"def using_shift(array)\n array.shift\nend",
"def using_shift(array)\n array.shift\nend",
"def using_shift(array)\n array.shift\nend",
"def using_shift(array)\n array.shift\nend",
"def using_shift(array)\n array.shift\nend",
"def using_shift(array)\n array.shift\nend",
"def using_shift(array)\n array.shift\nend",
"def using_shift(array)\n array.shift\nend",
"def using_shift(array)\n array.shift\nend",
"def shift\n raise \"index out of bounds\" if @length.zero?\n answer = self[0]\n (1...@length).each { |i| self[i - 1] = self[i] }\n @length -= 1\n\n answer\n end",
"def using_shift(array)\n array.shift()\nend",
"def shift\n raise \"index out of bounds\" unless (length > 0)\n\n first_val = self[0]\n (1...length).each{|i| self[i - 1] = self[i] }\n self.length -= 1\n\n first_val\n end",
"def shift; end",
"def shift; end",
"def shift() end",
"def shift() end",
"def shift\n unless empty?\n result = store.first\n swap(1, length)\n store.pop\n sink(1)\n end\n result\n end",
"def op_flip\n pop(2).each{|e| push(e)}\n end",
"def pop\n raise IndexError.new if @data.size == 0\n ret = @data[0]\n @data[0] = @data[@data.size - 1]\n @data = @data.take(@data.size - 1)\n percolate_down\n return ret\n end",
"def shiftValue\n arr = [1, 5, 10, -2]\n arr.shift\n arr.push(0)\n puts arr\nend",
"def shift arr\n arr.shift\n arr.push(0)\nend",
"def shift\n raise \"index out of bounds\" if @length == 0\n shift_val = @store[0]\n @length -= 1\n @store[0] = nil\n i = 1\n until i == @length + 1\n @store[i-1] = @store[i]\n i += 1\n end\n shift_val\n end",
"def shiftValue\r\n arr = [1, 5, 10, -2]\r\n arr.shift\r\n arr.push(0)\r\n puts arr\r\nend",
"def shift(ndigits)\n #This is a stub, used for indexing\n end",
"def pops num\r\n if num == 0\r\n return self, []\r\n end\r\n one = 0\r\n two = -num - 1\r\n three = -num\r\n four = -1\r\n left, right = self[one..two], self[three..four]\r\n end",
"def shift\n raise \"index out of bounds\" if (length == 0)\n\n val = self.store[0]\n self.store = self.store[1..-1]\n self.length -=1\n val\n end",
"def shift\n end",
"def shift\n end",
"def shift\n end",
"def shift\n return if @length == 0\n key = @head.next.key\n [key, delete(key)]\n end",
"def flipflop!\n\t\tif size > 1\n\t\t\ta, b = shift, pop\n\t\t\tunshift(b); push(a)\n\t\tend\n\tend",
"def shift_with_args(array)\n array = array.shift(2)\n array.shift(2)\n \nend",
"def pop\n value = peek\n @sp += 1\n value\n end",
"def test_array_shift4\n a = [1, 2, 3, 4, 5]\n assert_equal([1, 2], a.shift(2))\n end",
"def shift\n raise \"index out of bounds\" if (@length == 0)\n\n first = @store[0]\n (1...@length).each do |i|\n #slide everything to the left\n @store[i - 1] = @store[i]\n end\n @length -= 1\n first\n\n end",
"def using_pop(array)\n array = array.pop(1)\n array.pop\n\n\nend",
"def \n \n pop_with_args(array)\n # {...}(pop_x_times)\n\n\n array.pop(2)\n \n \n #-X-\n # array.pop()\n # array.pop()\n \nend",
"def pops\n 0\n end",
"def pop() end",
"def shift!\n shifted = @queue.shift\n\n return nil if shifted.nil?\n shifted[0]\n end",
"def pop\n\t\tif @length==1\n\t\t\t@last = nil\n\t\t\t@first = nil\n\t\telse \n\t\t\t@last = @last.back\n\t\t\t@last.front = nil\n\t\t\t@first = @last if @length==2\n\t\tend\n\t\t@length-=1\n\tend",
"def pop\n return nil if self.curr == 0\n val = self.arr[self.curr - 1]\n self.curr -= 1\n val\n end",
"def shift_val(arr)\n for i in 0..arr.length - 2\n arr[i] = arr[i+1]\n end\n arr[-1] = 0\n return arr\nend",
"def shift_with_args(arr)\n arr.shift(2)\nend",
"def pop()\n (@stack1.size-1).times { @stack2.push(@stack1.pop) }\n result = @stack1.pop\n @stack2.times { @stack1.push(@stack2.pop) }\n\n result\n end",
"def shift_right\n self.unshift(self.pop)\n end",
"def pop()\n @q.shift\n end",
"def rm_index\n\tarray = [0, 2, 4, 6, 8]\n\twhile array.length > 2\n\t\tputs array.pop\n\tend\nend",
"def shift_with_args (array)\n return array.shift(2)\nend",
"def shift_out\n end",
"def shift_with_args(array)\n array.shift(2)\nend",
"def shift_with_args(array)\n array.shift(2)\nend",
"def shift_with_args(array)\n array.shift(2)\nend",
"def shift_with_args(array)\n array.shift(2)\nend",
"def shift_with_args(array)\n array.shift(2)\nend",
"def shift_with_args(array)\n array.shift(2)\nend",
"def shift_with_args(array)\n array.shift(2)\nend",
"def shift_with_args(array)\n array.shift(2)\nend",
"def shift_with_args(array)\n array.shift(2)\nend",
"def pop\n new_tail = at(size - 2)\n old_tail = tail\n puts \"#{old_tail.data} is now gone!\"\n set_tail(new_tail)\n old_tail = nil\n old_tail\nend",
"def pop; end",
"def pop; end",
"def pop; end",
"def pop; end",
"def pop; end",
"def shift_out_left\n size.times do |i|\n yield(bit_at_position(size - i - 1), i)\n end\n end",
"def shift\n if @elements.empty?\n return nil\n end\n\n swap(0,@elements.size-1)\n ele = @elements.pop\n heapify(0)\n ele\n end",
"def pop\n\t\tif @pos <= 0\n\t\t\traise RuntimeError.exception @errormessage\n\t\tend\n\t\t\n\t\tret = values[0]\n\t\t\n\t\t@pos -= 1\n\t\tx = values[@pos]\n\t\t\n\t\ti = 0\n\t\twhile i*2+1 < @pos\n\t\t\tl, r = i*2+1, i*2+2\n\t\t\t\n\t\t\tl = r if r < @pos and values[r] < values[l]\n\t\t\t\n\t\t\tbreak if values[l] >= x\n\t\t\t\n\t\t\tvalues[i] = values[l]\n\t\t\ti = l\n\t\tend\n\t\t\n\t\tvalues[i] = x\n\t\tret\n\tend",
"def unshift\n self\n end",
"def remainder\n t = @input.slice(@index,@input.size-@index)\n return @push + t unless @push.nil?\n t\n end",
"def shift\n @data.shift\n end",
"def shift_left2(list)\n list_new = list\n i = 0\n first = list[0]\n\n list.size.times do |i|\n list_new[i] = list[i + 1]\n i += 1\n end\n list_new[list.size - 1] = first\n\n return list_new\n\nend",
"def -\n a = pop\n b = pop\n push b - a\n end",
"def shift_elements(index)\n while index < @length - 1\n @cache[index] = @cache[index+1]\n index += 1\n end\n end",
"def pop_with_args(array)\n array = array.pop(2)\n array.pop(2)\n \nend",
"def reverse_shift_out(&block)\n reverse_each(&block)\n end",
"def shift\n val = @tail.prev.obj\n @tail.prev = @tail.prev.prev\n @tail.prev.next = @tail\n val\n end",
"def shift\n return nil if empty?\n @que.shift\n end",
"def pop\n peek\n\n @out.pop\n end",
"def shift_with_args(array)\n array.shift(2)\n end",
"def pop()\n \n end",
"def pop()\n \n end",
"def pop()\n \n end",
"def shift\n @store.store.each_with_index do |ele, i|\n if ele != nil\n val = ele\n @store.store[i] = nil\n @count -= 1\n return val\n end\n end\n\n return nil if @count == 0\n end",
"def pop_with_args(array)\narray = array.pop(2)\narray.pop(2)\nend",
"def using_pop(arr)\n arr.pop\nend",
"def shift\n if @length > 0\n new_array = StaticArray.new(@array.length - 1)\n for i in 0..(@length - 2)\n new_array[i] = @array[i + 1]\n end\n shifted = @array[0]\n @length -= 1\n @last -= 1\n @array = new_array\n return shifted\n else\n raise(\"index out of bounds\")\n end\n end",
"def pop\n\t\tremove(@length - 1)\n\tend"
] |
[
"0.7117184",
"0.7054701",
"0.7001405",
"0.67946655",
"0.67830074",
"0.67653257",
"0.67512155",
"0.6745025",
"0.6728771",
"0.67045116",
"0.67045116",
"0.67045116",
"0.67045116",
"0.67045116",
"0.67045116",
"0.67045116",
"0.67045116",
"0.67045116",
"0.67045116",
"0.67045116",
"0.67045116",
"0.67007655",
"0.665539",
"0.6646893",
"0.6639258",
"0.66280854",
"0.66280854",
"0.6620605",
"0.6620605",
"0.65955305",
"0.658613",
"0.6582375",
"0.65756494",
"0.6567121",
"0.65433574",
"0.6539518",
"0.6498384",
"0.64966863",
"0.6455418",
"0.64177257",
"0.64177257",
"0.64177257",
"0.6411063",
"0.6405862",
"0.64037615",
"0.6398532",
"0.6394387",
"0.6350112",
"0.6337236",
"0.63363117",
"0.63354355",
"0.6330224",
"0.63001245",
"0.6286959",
"0.6283116",
"0.6281694",
"0.6280757",
"0.6278267",
"0.6277871",
"0.62735724",
"0.6259615",
"0.62576663",
"0.6254722",
"0.62397265",
"0.62397265",
"0.62397265",
"0.62397265",
"0.62397265",
"0.62397265",
"0.62397265",
"0.6233725",
"0.6233725",
"0.6214996",
"0.6208681",
"0.6208681",
"0.6208681",
"0.6208681",
"0.6208681",
"0.6205723",
"0.6202326",
"0.62018025",
"0.61971563",
"0.6192357",
"0.6192281",
"0.6191445",
"0.61848104",
"0.6180014",
"0.61781794",
"0.6175225",
"0.61714166",
"0.61360544",
"0.6126926",
"0.6125252",
"0.61248034",
"0.61248034",
"0.61248034",
"0.61245596",
"0.6120081",
"0.6117739",
"0.6116456",
"0.61143875"
] |
0.0
|
-1
|
GET /comments GET /comments.json def index
|
def index
@comments = @post.comments
@limitcomments = Comment.where(post_id: 1).limit(2).order("id DESC").reverse
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @comments = @commentable.comments\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end",
"def index\n @comments = Comment.all\n render json: @comments\n end",
"def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end",
"def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end",
"def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end",
"def comments\n client.get(\"/#{id}/comments\")\n end",
"def index\n #@comments = Comment.all\n comments = @blog.comments\n render json: comments, status: :ok\n end",
"def index\n @comments = Comment.where('user_id = ?', current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end",
"def index\n comments = @project.comments\n render json: comments\n end",
"def index\n logger.info(\"comments got index! #{params}\");\n @comments = Comment.find_by_post_id(params[:post_id])\n respond_with @comments\n end",
"def index\n @comments = DiscussionComment.all\n render json: @comments\n end",
"def index\n if params[:comment_id].nil?\n render json: {\n comments: @card.comments.paginate(page: params[:page], per_page: 3)\n }, statues: :ok\n else\n @comment = Comment.find(params[:comment_id])\n render json: {\n comment: @comment,\n replaies: @comment.replaies.paginate(page: params[:page], per_page: 3)\n }, statues: :ok\n end\n end",
"def index\n @post = Post.find_by_id(params[:post_id])\n if @post.nil?\n return render json: { error: \"Post not found\" }, status: :not_found\n end\n render json: @post.comments,status: 200\n end",
"def index\n @comments = @complaint.comments\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @comments }\n format.js\n end\n end",
"def list\n comments = Comment.where(post: @post)\n render json: comments, status: 200\n end",
"def index\n \t @comments = Comment.all\n end",
"def index\n @comments = @entry.comments\n respond_with(@comments)\n end",
"def index\n @comments = Comment.all\n end",
"def index\n comments = @post.comments\n render json: { comments: comments }\n #loop through comments and find first and last name by user_id\n #User.find....etc\n end",
"def comments\n @list.client.get(\"#{url}/comments\")\n end",
"def comments\n @list.client.get(\"#{url}/comments\")\n end",
"def index\n @post = Post.find(params[:post_id])\n @comments = @post.comments\n\n render json: @comments, include: ['user']\n end",
"def index\n @comments = Comment.order(\"created_at DESC\")\n render json: @comments, status: :ok\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n @comments = Comment.all\n end",
"def index\n \t\t@comments = Comment.all\n \tend",
"def index\n @comments = @commentable.comments.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"def index\n @comments = @post.comments.order(created_at: :desc)\n render json: @comments, status: :ok\n\n end",
"def index\n begin\n load_path\n @comments = @commentable.comments.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n rescue => e\n respond_to do |format|\n format.html { redirect_to root_path, :alert => e.message.to_s.html_safe }\n format.xml { render :xml => e.message, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n if params[:_post_id]\n post_comments = PostComment.where(post_id: params[:_post_id])\n render json: post_comments.as_json(\n include: { user: { only: [:name, :id] } },\n except: [:post_id, :user_id]),\n status: :ok\n else\n render json: @current_user.post_comments.as_json(\n include: { post: { only: [:title, :id, :excerpt] } },\n except: [:user_id, :post_id]),\n status: :ok\n end\n end",
"def index\n @section_comments = SectionComment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @section_comments }\n end\n end",
"def index\n event = Event.find(params[:event_id])\n render json: event.comments, status: :ok\n end",
"def comments\n @article = Article.find(params[:id])\n @comments = @article.comments\n\n respond_to do |format|\n format.html \n format.json { render json: @comments, status: :ok }\n end\n end",
"def index\n @comments = Comment.paginate(:page => params[:page])\n @ticket = Ticket.find(params[:ticket_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end",
"def index\n @comments = @commentable.comments\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end",
"def index\n @talk_comments = TalkComment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @talk_comments }\n end\n end",
"def index\n\t\t@comment = Comment.all\n\tend",
"def index\n comments = list.comments.desc(:created_at)\n comments = comments[5, (comments.length-1)]\n\n render json: comments\n end",
"def comments; rest_query(:comment); end",
"def index\n @comments = @commentable.comments\n end",
"def index\n @comments = CommentsArticle.all\n end",
"def index\n @comments = Comment.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end",
"def index\n @comments = Comment.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end",
"def index\n @imgcomments = Imgcomment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @imgcomments }\n end\n end",
"def index\n @comment_qs = CommentQ.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comment_qs }\n end\n end",
"def comments\n render json: @post.comments\n end",
"def index\n @commentable = find_commentable\n @comments = @commentable.comments\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @carts }\n end\n end",
"def index\n @comments = @link.comments.arrange(:order => :created_at)\n @comment = Comment.new()\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @link.comments }\n end\n end",
"def index\n # retrieve comments from db, including the user\n comments = @book.comments.includes(:user).order(id: :desc)\n render json: comments, status: :ok\n end",
"def show\n # comment = Comment.find_comment\n render json: @comment\n end",
"def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end",
"def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end",
"def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end",
"def show\n @comments = @post.comments\n respond_to do |format|\n format.html\n format.json\n end\n end",
"def index\n @commentes = Commente.all\n end",
"def index\n @comments = Comment.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @comments.to_xml }\n end\n end",
"def index\n @page = \"comments\"\n @comments = Comment.where('approved = ?', true).paginate(:per_page => 12, :page => params[:page]).order(\"created_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end",
"def show\n render json: comment\n end",
"def index\n @comments = Comment.where(\n \"auction_id = ? \",\n params[:auction_id])\n\n render json: @comments\n end",
"def index\n @comments = Post.all\n end",
"def all_comments\n render :json => User.find(params[:user_id]).comments\n end",
"def index\n @comments = Comment.find(:all, :include => :post, :order => 'comments.created_at DESC')\n @meta[:title] = 'Comments'\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end",
"def show\n render json: @comment\n end",
"def index\n @comments = @resource.comments.paginate( :page => params[:page], :per_page => 10, :order => 'id DESC' )\n end",
"def index\n post = Post.find(params[:post_id])\n comments = post.comments.order(updated_at: :desc)\n @comment = Comment.new\n\n @comments = comments.map do |comment|\n {\n content: comment.content,\n created_at: comment.created_at.strftime('%Y-%m-%d %H:%M:%S')\n }\n end\n\n render json: {\n data: {\n comments: @comments,\n new_comment: @comment,\n }\n }\n end",
"def show\n user = User.find_by({token: env['HTTP_TOKEN']})\n render json: user.comments.find(params[:id])\n end",
"def show\n comment = Comment.find(params[:id])\n render json: comment, status: 200\n end",
"def index\n \n @comments = @network.comments.find(:all, :order => 'created_at DESC')\n @comment_pages = @comments.paginate :page => params[:page], :per_page => 15\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end",
"def show\n @comment = Comment.find(params[:id])\n render json:@comment\n end",
"def index\n @comments = @task.comments.find(:all, :order => 'created_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end",
"def show\n comment = Comment.find_by(id: params[:id])\n render json: comment\n end",
"def index\n @comments = Comment.page params[:page]\n end",
"def index\n @comments = @parent.comments\n .includes(:user)\n .order_by(params[:order_by], params[:order])\n .page(params[:page])\n .per(params[:per_page])\n\n render json: @comments, each_serializer: CommentSerializer, meta: index_meta_data\n end"
] |
[
"0.83178943",
"0.82964265",
"0.829394",
"0.829394",
"0.829394",
"0.8202435",
"0.80578905",
"0.80145353",
"0.80028224",
"0.7984797",
"0.79781526",
"0.7868182",
"0.78367954",
"0.78183204",
"0.77816516",
"0.7734998",
"0.7731345",
"0.77272856",
"0.7708667",
"0.77036566",
"0.77036566",
"0.7659939",
"0.76556814",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7647311",
"0.7634508",
"0.7629336",
"0.7604411",
"0.7567327",
"0.7556171",
"0.75429815",
"0.7534375",
"0.7531747",
"0.75030315",
"0.74967694",
"0.7477078",
"0.7471549",
"0.74705875",
"0.7433155",
"0.74135315",
"0.74103266",
"0.7400316",
"0.7380116",
"0.7380116",
"0.7374327",
"0.73722893",
"0.7367139",
"0.73634934",
"0.73146397",
"0.7307752",
"0.73016787",
"0.7278653",
"0.7278653",
"0.7278653",
"0.7261974",
"0.7250805",
"0.7243639",
"0.7227937",
"0.72207665",
"0.7215711",
"0.7200602",
"0.71951854",
"0.7183599",
"0.7162424",
"0.71585226",
"0.71429145",
"0.71392626",
"0.71321017",
"0.7123323",
"0.7088869",
"0.70849484",
"0.70792156",
"0.70791703",
"0.70759773"
] |
0.0
|
-1
|
Use callbacks to share common setup or constraints between actions.
|
def load_article
@postsall = Post.all
#@post = Post.find(params[:post_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_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"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.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def comment_params
params.require(:like).permit(:user_id, :post_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 end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"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.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
PATCH/PUT /answers/1 def update
|
def auto_complete
q = params[:term].gsub(/\s/, "").gsub(" ", "")
uri = Addressable::URI.parse("https://www.googleapis.com/books/v1/volumes?q=#{q}&country=JP&maxResults=40&orderBy=relevance")
begin
response = Net::HTTP.get_response(uri)
result = JSON.parse(response.body)
book_result = result["items"]
.select{|item| item.has_key?("volumeInfo") && item["volumeInfo"].has_key?("title")}
.take(40)
.map{|item|
{
title: item["volumeInfo"]["title"],
subtitle: item["volumeInfo"]["subtitle"],
authors: item["volumeInfo"]["authors"],
categories: item["volumeInfo"]["categories"],
google_books_id: item["id"],
info: item["volumeInfo"]["industryIdentifiers"]
}
}
@results = Book.auto_complete_map(book_result)
render json: @results.to_json
rescue => e
p e.message
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @answer = current_user.answers.find(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(params[:answer])\n format.json { head :no_content }\n else\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find(params[:id])\n\n if @answer.update(answer_params)\n head :no_content\n else\n render json: @answer.errors, status: :unprocessable_entity\n end\n end",
"def update\n @answer = Answer.find(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(params[:answer])\n format.html { redirect_to @answer, notice: 'Answer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(params[:answer])\n format.html { redirect_to @answer, notice: 'Answer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question_answer = Question::Answer.find(params[:id])\n\n respond_to do |format|\n if @question_answer.update_attributes(params[:question_answer])\n format.html { redirect_to @question_answer, notice: 'Answer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tif @answer.update(answer_params)\n\t\t\t\tformat.html { redirect_to @answer, notice: 'Survey was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\tformat.json { render json: @answer.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n @answer = Answer.find(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(answer_params)\n format.html { redirect_to @answer, notice: 'Answer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = @question.answers.find(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(params[:answer])\n format.html { redirect_to([@question,@answer], :notice => 'Answer was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @answer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.update(params[:id], { \n :body => params[:body], \n :answer_type => params[:answer_type] }, \n params[:answers].values\n )\n\n respond_to do |format|\n format.json { render :json => @question.as_json({:include => :answers}) }\n\n # if @question.update_attributes(params[:question])\n # format.html { redirect_to @question, :notice => 'Question was successfully updated.' }\n # format.json { head :no_content }\n # else\n # format.html { render :action => \"edit\" }\n # format.json { render :json => @question.errors, :status => :unprocessable_entity }\n # end\n end\n end",
"def update\n if @answer.update(answer_params)\n respond_to_save_success(@answer, [@question, @answer])\n else\n respond_to_save_failure(:edit, @answer)\n end\n end",
"def update\n respond_to do |format|\n if @answer.update(answer_params)\n format.html { redirect_to questions_url, notice: 'Answer edited.' }\n else\n format.json {\n render json: @answer.errors,\n status: :unprocessable_entity\n }\n end\n end\n end",
"def update\n @question = Question.find(params[:question_id])\n @answer = @question.answers.new(answer_params)\n respond_to do |format|\n if @answer.update(answer_params)\n format.html { redirect_to question_answer_url(@question, @answer), notice: \"Answer was successfully updated.\" }\n format.json { render :show, status: :ok, location: @answer }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @answer.update(answer_params)\n format.html { redirect_to @answer, notice: 'Answer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(params[:answer])\n format.html { redirect_to @answer, notice: 'Respuesta actualizada correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @answer.update(answer_params)\n format.html { redirect_to answers_path, notice: 'Answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @answer }\n else\n format.html { render :edit }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(params[:answer])\n format.html { redirect_to(@answer, :notice => 'Answer was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @answer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(params[:answer])\n format.html { redirect_to(@answer, :notice => 'Answer was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @answer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(params[:answer])\n format.html { redirect_to(@answer, :notice => 'Answer was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @answer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(params[:answer])\n flash[:notice] = 'Answer was successfully updated.'\n format.html { redirect_to answer_url(@answer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @answer.errors.to_xml }\n end\n end\n end",
"def update\n @answer.update(answer_params)\n respond_with( [ :admin, @survey, @section, @question, @answer ] )\n end",
"def update\n respond_to do |format|\n if @answer.update(answer_params)\n format.html { redirect_to @answer, notice: 'Answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @answer }\n else\n format.html { render :edit }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @answer.update(answer_params)\n format.html { redirect_to @answer, notice: 'Answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @answer }\n else\n format.html { render :edit }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @answer.update(answer_params)\n format.html { redirect_to @answer, notice: 'Answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @answer }\n else\n format.html { render :edit }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(params[:answer])\n flash[:notice] = 'Answer was successfully updated.'\n format.html { redirect_to(@answer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @answer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Admin::Answer.find(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(params[:answer])\n flash[:notice] = 'Admin::Answer was successfully updated.'\n format.html { redirect_to(@answer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @answer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @answers = args[:answers] if args.key?(:answers)\n end",
"def update!(**args)\n @answers = args[:answers] if args.key?(:answers)\n end",
"def update!(**args)\n @answers = args[:answers] if args.key?(:answers)\n end",
"def update!(**args)\n @answers = args[:answers] if args.key?(:answers)\n end",
"def update\n respond_to do |format|\n if @answer.update(answer_params)\n format.html { redirect_to @answer.question, notice: 'Respuesta actualizada satisfactoriamente' }\n format.json { render :show, status: :ok, location: @answer }\n else\n format.html { render :edit }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(params[:comment])\n format.html { redirect_to @answer }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find_by_key(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(params[:answer])\n format.html { redirect_to answer_path(@answer.key), notice: 'Answer was successfully updated.' }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def update\n respond_to do |format|\n if @fake_answer.update(fake_answer_params)\n format.html { redirect_to @fake_answer, notice: 'Fake answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @fake_answer }\n else\n format.html { render :edit }\n format.json { render json: @fake_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find_by_uuid(params[:id])\n @question = @answer.question\n\n respond_to do |format|\n begin\n if @answer.update_attributes(params[:answer])\n format.html { redirect_to answer_path(@answer.uuid), notice: 'Your answer was successfully saved.' }\n format.json { render json: @answer, status: :created, location: answer_path(@answer.uuid) }\n else\n format.html { render action: \"edit\", location: edit_answer_path(@answer.uuid) }\n format.json { render json: @answer.errors, status: :unprocessable_entity, location: edit_answer_path(@answer.uuid) }\n end\n rescue ActiveRecord::ReadOnlyRecord\n format.html { redirect_to answer_path(@answer.uuid), notice: \"You cannot change the answer\" }\n format.json { render json: @answer.errors, status: :unprocessable_entity, location: answer_path(@answer.uuid) }\n end\n end\n end",
"def update\n @survey_answer = SurveyAnswer.find(params[:id])\n\n respond_to do |format|\n if @survey_answer.update_attributes(params[:survey_answer])\n flash[:notice] = 'SurveyAnswer was successfully updated.'\n format.html { redirect_to(@survey_answer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @survey_answer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find(params[:id])\n answer = params.require(:answer).permit(:text).merge(email: current_user.email)\n Answer.where('id = ?',@answer.id).update(answer)\n redirect_to questions_path, notice: '更新しました。'\n end",
"def update\n if @question.update(question_params)\n redirect_to set_answer_question_path(@question)\n end\n end",
"def update\n @user_answer = UserAnswer.find(params[:id])\n\n respond_to do |format|\n if @user_answer.update_attributes(params[:user_answer])\n format.html { redirect_to @user_answer, notice: 'User answer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @answer_respondent.update(answer_respondent_params)\n format.html { redirect_to @answer_respondent, notice: 'Answer respondent was successfully updated.' }\n format.json { render :show, status: :ok, location: @answer_respondent }\n else\n format.html { render :edit }\n format.json { render json: @answer_respondent.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @asked_to_answer.update(asked_to_answer_params)\n format.html { redirect_to @asked_to_answer, notice: 'Asked to answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @asked_to_answer }\n else\n format.html { render :edit }\n format.json { render json: @asked_to_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @textanswer = Textanswer.find(params[:id])\n\n respond_to do |format|\n if @textanswer.update_attributes(params[:textanswer])\n format.html { redirect_to @textanswer, notice: 'Textanswer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @textanswer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @quiz_answer.update(quiz_answer_params)\n format.html { redirect_to @quiz_answer, notice: 'Quiz answer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @quiz_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @submitted_answer = SubmittedAnswer.find(params[:id])\n\n respond_to do |format|\n if @submitted_answer.update_attributes(params[:submitted_answer])\n format.html { redirect_to @submitted_answer, notice: 'Submitted answer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @submitted_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @answer.editable? && @answer.update(answer_params)\n format.html { redirect_to [@project, @discussion], notice: 'Answer was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def update\n respond_to do |format|\n if @reply_answer.update(reply_answer_params)\n format.html { redirect_to @reply_answer, notice: 'Reply answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @reply_answer }\n else\n format.html { render :edit }\n format.json { render json: @reply_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @actual_answer.update(actual_answer_params)\n format.html { redirect_to @actual_answer, notice: 'Actual answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @actual_answer }\n else\n format.html { render :edit }\n format.json { render json: @actual_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_rest\n @entry_answer = EntryAnswer.find(params[:id])\n\n respond_to do |format|\n if @entry_answer.update_attributes(params[:entry_answer])\n flash[:notice] = 'EntryAnswer was successfully updated.'\n format.html { redirect_to(@entry_answer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_answer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @m_answer = MAnswer.find(params[:id])\n respond_to do |format|\n if @m_answer.update(m_answer_params)\n format.html { redirect_to m_question_path(@m_question), notice: 'M answer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @m_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n if params[:question][:answer].present?\n @question.answered_by = current_user.id\n @question.answered_at = Time.zone.now if @question.answered_at.nil?\n end\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to api_v1_question_path(@question), notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n answer = Answer.find(params[:answer_id])\n if answer.update(content: params[:content])\n render json: {answer: answer, success: true} \n else\n render json: @answer.errors, success: false \n end\n end",
"def update\n @client_answer = ClientAnswer.find(params[:id])\n\n respond_to do |format|\n if @client_answer.update_attributes(params[:client_answer])\n format.html { redirect_to @client_answer, notice: 'Client answer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\tquestion_param = question_params.merge(:words => in_words(question_params[\"answer\"].to_i))\n\trespond_to do |format|\n if @question.update(question_param)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\t\n end",
"def update\n @student_answer = StudentAnswer.find(params[:id])\n\n respond_to do |format|\n if @student_answer.update_attributes(params[:student_answer])\n format.html { redirect_to @student_answer, notice: 'Student answer was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # Do not support updating an answer for now\n # Once you have answered there is no return\n end",
"def update\n @answer=AttemptAnswer.find_by_id(params[:id])\n \n @answer.update_attribute(:user_answer, params[:user_answer])\n if @answer.user_answer = params[:user_answer]\n render json: @answer, status: :no_content\n\n else\n head(:unprocessable_entity)\n\n end\n end",
"def update\n respond_to do |format|\n if @submitted_answer.update(submitted_answer_params)\n format.html { redirect_to @submitted_answer, notice: 'Submitted answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @submitted_answer }\n else\n format.html { render :edit }\n format.json { render json: @submitted_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_answer\n respond_to do |format|\n if @answer.update(answer_params)\n format.html { redirect_to :planner, notice: 'Answer was successfully updated.' }\n format.json { respond_with_bip(@answer) }\n else\n format.html { render :edit }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, :notice => 'Question was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_answer.update(tipo_answer_params)\n format.html { redirect_to @tipo_answer, notice: 'Tipo answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_answer }\n else\n format.html { render :edit }\n format.json { render json: @tipo_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @answer_record.update(answer_record_params)\n format.html { redirect_to @answer_record, notice: 'Answer record was successfully updated.' }\n format.json { render :show, status: :ok, location: @answer_record }\n else\n format.html { render :edit }\n format.json { render json: @answer_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n flash[:notice] = 'Page was successfully updated.' if @answer.update(answer_params)\n respond_with @answer\n end",
"def update\n respond_to do |format|\n if @user_answer.update(user_answer_params)\n format.html { redirect_to @user_answer, notice: 'User answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_answer }\n else\n format.html { render :edit }\n format.json { render json: @user_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_answer.update(user_answer_params)\n format.html { redirect_to @user_answer, notice: 'User answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_answer }\n else\n format.html { render :edit }\n format.json { render json: @user_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.json { render :json => 'Question updated OK' }\n format.xml { head :ok }\n else\n format.json { render :json => @question.errors }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @selected_answer.update(selected_answer_params)\n format.html { redirect_to @selected_answer, notice: 'Selected answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @selected_answer }\n else\n format.html { render :edit }\n format.json { render json: @selected_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @my_question = MyQuestion.find(params[:id])\n\n respond_to do |format|\n if @my_question.update_attributes(params[:my_question])\n format.html { redirect_to @my_question, notice: 'My question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @answer.update(answer_params)\n format.html { redirect_to model_customer_path(@model, @customer), notice: 'Model was successfully updated.' }\n format.json { render :show, status: :ok, location: @model }\n else\n format.html { render :edit }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to new_question_path, notice: 'questions was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @questionnaire = Questionnaire.find(params[:id])\n\n respond_to do |format|\n if @questionnaire.update_attributes(params[:questionnaire])\n format.html { redirect_to @questionnaire, notice: 'Questionnaire was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @questionnaire.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @b_answer = BAnswer.find(params[:id])\n respond_to do |format|\n if @b_answer.update(b_answer_params)\n format.html { redirect_to b_question_b_answer_path(@b_question,@b_answer), notice: 'B answer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @b_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @survey_answer_item = SurveyAnswerItem.find(params[:id])\n\n respond_to do |format|\n if @survey_answer_item.update_attributes(params[:survey_answer_item])\n format.html { redirect_to @survey_answer_item, notice: 'Survey answer item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey_answer_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #@question = Question.find(params[:id])\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: t('alert.question.update_success', default: 'Question was successfully updated.') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t@question = Question.find(params[:id])\n\t@questionnaire_question=QuestionnaireQuestion.find_by_question_id(@question.id)\n\t@questionnaire=Questionnaire.find(@questionnaire_question.questionnaire_id)\n\n\trespond_to do |format|\n\t if @question.update_attributes(params[:question])\n\t#\tformat.html { redirect_to(@question, :notice => 'Question was successfully updated.') }\n\t\tformat.html { redirect_to new_question_path(:questionnaire_id=>@questionnaire.id), :notice => 'Answer was successfully Saved.' }\n\t\tformat.xml { head :ok }\n\t else\n\t\tformat.html { render :action => \"edit\" }\n\t\tformat.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n\t end\n\tend\n end",
"def update\n question = Question.find(params[:id_question])\n if question.update(params_question)\n render json: question, status: 200\n else\n render json: question.errors, status: 422\n end\n\n end",
"def update\n respond_to do |format|\n if @answer.post.update(embedded_post_params)\n format.js { head :no_content }\n format.json { render :show, status: :ok, location: @answer }\n else\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @multiple_choice_question = MultipleChoiceQuestion.find(params[:id])\n\n respond_to do |format|\n if @multiple_choice_question.update_attributes(params[:multiple_choice_question])\n format.html { redirect_to @multiple_choice_question, notice: 'Multiple choice question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @multiple_choice_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @icebreaker_answer.update(icebreaker_answer_params)\n format.html { redirect_to @icebreaker_answer, notice: 'Icebreaker answer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @icebreaker_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if current_user.id == @answer.user_id && params['answer']['question_id'].present?\n respond_to do |format|\n if @answer.update(answer_params)\n flash[:notice] = \"Answer was successfully updated!!\"\n format.html { redirect_to controller: 'questions', action: 'show', id: @answer.question_id }\n format.json { render :show, status: :ok, location: @answer }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n else\n flash[:alert] = \"Not Authorized User!!\"\n redirect_to controller: 'questions', action: 'show', id: @answer.question_id\n end\n end",
"def update\n if @answer.update(answer_params)\n render json: { answer: view_show(@answer, @user_logged_in) }, status: :ok\n else\n @errors = translateModelErrors @question\n add_prefix_to_field @errors, \"answer:\"\n render json: { errors: @errors }, status: :bad_request\n end\n rescue ActionController::ParameterMissing\n @errors = [Error.new('missing_field', 'answer')]\n render json: { errors: @errors }, status: :bad_request\n end",
"def update\n @test_question = TestQuestion.find(params[:id])\n\n respond_to do |format|\n if @test_question.update_attributes(params[:test_question])\n format.html { redirect_to @test_question, :notice => 'Test question was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @test_question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n \n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to(@question, :notice => 'Question was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @online_answer = OnlineAnswer.find(params[:id])\n\n respond_to do |format|\n if @online_answer.update_attributes(params[:online_answer])\n format.html { redirect_to @online_answer, notice: 'Online answer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @online_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n def answer_given(question_id)\n return (params[:answer] and params[:answer][question_id.to_s] and\n params[:answer][question_id.to_s].length > 0)\n end\n \n @resp = Response.find(params[:id])\n\n @questionnaire.questions.each do |question|\n if question.kind_of? Questions::Field\n ans = Answer.find_answer(@resp, question)\n if answer_given(question.id)\n if ans.nil?\n ans = Answer.new :question_id => question.id, :response_id => @resp.id\n end\n ans.value = params[:answer][question.id.to_s]\n ans.save\n else\n # No answer provided\n if not ans.nil?\n ans.destroy\n end\n end\n end\n end\n\n respond_to do |format|\n if @resp.update_attributes(params[:response])\n format.html { redirect_to(response_url(@questionnaire, @resp)) }\n format.js { redirect_to(response_url(@questionnaire, @resp, :format => \"js\")) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.js { render :action => \"edit\" }\n format.xml { render :xml => @resp.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @check_answer.update(check_answer_params)\n format.html { redirect_to @check_answer, notice: 'Check answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @check_answer }\n else\n format.html { render :edit }\n format.json { render json: @check_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find(params[:id])\n if @answer.user == current_user\n @answer.approved = false\n end\n respond_to do |format|\n if @answer.update_attributes(params[:answer])\n @answer.create_activity :update, owner: current_user\n flash.now[:notice] = 'Answer was successfully updated.'\n format.html\n format.json { head :no_content }\n format.js { render \"answers/create\", :layout => false }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n format.js { render \"answers/create\", :layout => false }\n end\n end\n end",
"def update\n\t\t@question = Question.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @question.update_attributes(params[:question])\n\t\t\t\tformat.html { redirect_to @question, notice: 'Question was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @question.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @possible_answer.update(possible_answer_params)\n format.html { redirect_to @possible_answer, notice: 'Possible answer was successfully updated.' }\n format.json { render :show, status: :ok, location: @possible_answer }\n else\n format.html { render :edit }\n format.json { render json: @possible_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @quizzes_answer.update(quizzes_answer_params)\n format.html { redirect_to quiz_assessments_path(@quizzes_answer.assessment.quiz) }\n format.json { render :show, status: :ok, location: @quizzes_answer }\n else\n format.html { render :edit }\n format.json { render json: @quizzes_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @answer = args[:answer] if args.key?(:answer)\n end",
"def update!(**args)\n @answer = args[:answer] if args.key?(:answer)\n end"
] |
[
"0.8243493",
"0.81722856",
"0.816276",
"0.816276",
"0.8112311",
"0.8106613",
"0.8101315",
"0.80886626",
"0.80577314",
"0.8039944",
"0.8014571",
"0.7978505",
"0.79637265",
"0.7962886",
"0.7960491",
"0.7936517",
"0.7936517",
"0.7936517",
"0.7919692",
"0.7904783",
"0.7896381",
"0.7896381",
"0.7896381",
"0.78881264",
"0.7873908",
"0.7818253",
"0.7818253",
"0.7818253",
"0.78177375",
"0.7766977",
"0.7729478",
"0.7674801",
"0.7618207",
"0.7593668",
"0.75601864",
"0.7559476",
"0.7557358",
"0.75510246",
"0.7518114",
"0.7509034",
"0.7505676",
"0.749301",
"0.7485745",
"0.7457884",
"0.7444876",
"0.74448216",
"0.74254733",
"0.74111724",
"0.7385702",
"0.7382087",
"0.7374115",
"0.7371099",
"0.7370359",
"0.7354614",
"0.7325987",
"0.73253495",
"0.73115915",
"0.7308374",
"0.7303474",
"0.7290746",
"0.7290746",
"0.7290746",
"0.7290746",
"0.7290746",
"0.72799337",
"0.7273125",
"0.7242453",
"0.72345716",
"0.7231793",
"0.7231793",
"0.722918",
"0.72220457",
"0.72159797",
"0.721561",
"0.721147",
"0.71917325",
"0.71915805",
"0.71884614",
"0.71879834",
"0.7183352",
"0.7170183",
"0.7167587",
"0.71514213",
"0.7146309",
"0.71387285",
"0.7138093",
"0.71333957",
"0.7113652",
"0.71110755",
"0.71086806",
"0.7104117",
"0.7100984",
"0.7091381",
"0.7085995",
"0.7085629",
"0.7085629",
"0.7085629",
"0.708435",
"0.70795983",
"0.7069948",
"0.7069948"
] |
0.0
|
-1
|
Use callbacks to share common setup or constraints between actions. def set_answer
|
def save_title_query
@query = TitleQuery.new(user_id: current_user.try(:id), query: params[:term])
@query.save
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def ask(question)\n ui.ask question\n end",
"def ask_question\n\n end",
"def set_answer\n\t\t#@answer = Survey.find(params[:id])\n\tend",
"def set_answer\n @answer = Answer.find(params[:id])\n @question = @answer.question\n end",
"def set_answer\n @answer = Discovery::Answer.find(params[:id])\n end",
"def pre_answer &block\n application \"pre_answer\", &block\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_correct_answer\r\n set_question_and_answer\r\n @answer.correct = 1\r\n save_answer_and_render\r\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_answer\n @answer = Answer.find(params[:id])\n end",
"def set_given_answer\n @given_answer = GivenAnswer.find(params[:id])\n end",
"def set_given_answer\n @given_answer = GivenAnswer.find(params[:id])\n end",
"def set_answer\n @answer = Form::Answer.find(params[:id])\n end",
"def mark(_ = nil)\n publish_answers\n end",
"def validate_answer(answer)\n end",
"def post_process(answer)\n answer\n end",
"def answering!(to_whom, &block)\n @asker, @askers_callback = to_whom, block\n self\n end",
"def set_question_answer\n @question_answer = QuestionAnswer.find(params[:id])\n end",
"def perform(user, questions)\n \n end",
"def set_fake_answer\n @fake_answer = FakeAnswer.find(params[:id])\n end",
"def set_answer\n @team_answer = TeamAnswer.find(params[:id])\n end",
"def set_answer\n @answer = @question.answers.find(params[:id])\n end",
"def set_answer\n\t @doubt = Answer.find(params[:id])\n\t end",
"def answer\n @contest_response = get_my_latest_response(@contest.id, true)\n return play if @contest_response.completed?\n\n ans_attr = {:question_id => params[:question_id]}\n ans_attr[:question_option_id] = params[:answer][:question_option_id] if params[:answer] && 'Skip' != params[:commit] \n if ans = @contest_response.add_answer(ans_attr)\n unless ans.errors.empty?\n respond_to do |format|\n render :xml => ans.errors.to_xml and return\n end\n end\n end \n respond_to do |format|\n format.html { redirect_to contest_url(@contest.url_attributes(:action => 'play')) }\n format.js { play }\n format.xml { return render(:xml => @contest_response.to_xml(:base_url => request.host_with_port)) }\n end \n end",
"def touch_multi_choice_answer\n touch if question_type == \"MultiChoiceQuestion\"\n end",
"def set_actual_answer\n @actual_answer = ActualAnswer.find(params[:id])\n end",
"def set_asked_to_answer\n @asked_to_answer = AskedToAnswer.find(params[:id])\n end",
"def set_answer\n if Answer.find_by(id: params[:id]).blank?\n redirect_to controller: 'home', action: 'error404'\n else\n @answer = Answer.find(params[:id])\n end\n end",
"def set_check_answer\n @check_answer = CheckAnswer.find(params[:id])\n end",
"def update!(**args)\n @answer = args[:answer] if args.key?(:answer)\n end",
"def update!(**args)\n @answer = args[:answer] if args.key?(:answer)\n end",
"def update!(**args)\n @answer = args[:answer] if args.key?(:answer)\n end",
"def update!(**args)\n @answer = args[:answer] if args.key?(:answer)\n end",
"def set_help_call_answer\n @help_call_answer = HelpCallAnswer.find(params[:id])\n end",
"def set_possible_answer\n @possible_answer = PossibleAnswer.find(params[:id])\n end",
"def ask\n @question = params[:question]\n end",
"def find_answer\nend",
"def set_answer\n @quiz = Quiz.find(params[:quiz_id])\n @question = Question.find_by(quiz_id: @quiz.id, number: params[:question_id]) || Question.find_by(quiz_id: @quiz.id, id: params[:question_id])\n @answer = Answer.find_by(question_id: @question.id, id: params[:id]) if params.key?(:id)\n end",
"def process_answer\n @problem = Problem.find(params[:id])\n unless params[:answer]\n @message = \"You did not submit an answer; please make sure to select/type an answer.\"\n render_tutor :file => \"notice_message\"\n else\n ActiveRecord::Base.transaction do\n if (@problem.correct?(params[:answer])) # answer is correct\n changed_and_notify_observers(:answer => { :correct => params[:answer], :problem => @problem})\n flash[:message] = \"Correct!\"\n flash[:message_type] = :correct\n move_student_on\n else # answer is incorrect!\n changed_and_notify_observers(:answer => { :incorrect => params[:answer], :problem => @problem})\n flash[:message] = \"Sorry, that is incorrect. Let's move on and figure out why!\"\n flash[:message_type] = :incorrect\n help_student_out\n end\n end\n end\n end",
"def ask_questionaire\n alert_reserved_and_exit if git.reserved_branch?\n announce\n ask_title\n ask_label\n ask_pivotal_ids if config.use_pivotal_tracker\n ask_jira_ids if config.use_jira\n end",
"def set_answer_option\n @answer_option = AnswerOption.find(params[:id])\n end",
"def set_answer\n \t@answer = Answer.where(id:params[:answer_id])[0]\n render json: {success: false, message: 'Invalid Ansser ID !'}, status: 400 if @answer.nil?\n \tend",
"def question_help_click\n MenuControllerContracts.invariant(self)\n @alert_view = @help_view = Views::ConnectAllAlertView.new(@window, self)\n MenuControllerContracts.invariant(self)\n end",
"def set_option_answer\n @option_answer = OptionAnswer.find(params[:id])\n end",
"def quiz\n end",
"def set_post\n @answer = Answer.find(params[:id])\n end",
"def set_user_answer\n @user_answer = UserAnswer.find(params[:id])\n end",
"def set_user_answer\n @user_answer = UserAnswer.find(params[:id])\n end",
"def set_ask\n @ask = Ask.find(params[:id])\n end",
"def set_ask\n @ask = Ask.find(params[:id])\n end",
"def set_ask\n @ask = Ask.find(params[:id])\n end",
"def set_m_answer\n @m_answer = MAnswer.find(params[:id])\n end",
"def call\n return broadcast(:invalid) if form.invalid?\n\n store_initial_opinion_state\n\n transaction do\n answer_opinion\n notify_opinion_answer\n end\n\n broadcast(:ok)\n end",
"def set_incorrect_answer\r\n set_question_and_answer\r\n @answer.correct = 0\r\n save_answer_and_render\r\n end",
"def set_answer\n @answer = @discussion.answers.find(params[:id])\n end",
"def correct_answer(text)\n answer = Answer.new(text, true)\n @errorReporter.register answer\n @test.last_question.add_answer answer\nend",
"def set_ask\n @ask = Ask.find(params[:id])\n end",
"def set_reply_answer\n @reply_answer = ReplyAnswer.find(params[:id])\n end",
"def run\n puts \"------------------ NEW TURN ------------------\"\n ask_question\n get_answer\n validate_answer\n end",
"def question_otto_button_click\n MenuControllerContracts.invariant(self)\n @alert_view = @help_view = Views::OttoInstructionsAlertView.new(@window, self)\n MenuControllerContracts.invariant(self)\n end",
"def set_boolean_answer\n @boolean_answer = BooleanAnswer.find(params[:id])\n end",
"def self_intro_enquiry(*args)\n self.update_attribute(:bot_response, \"I'm Brian.\")\n return false\n end",
"def method_missing(method_name, *args)\n match = method_name.to_s.match(/dynamic_answer_(\\d+)(=?)/)\n if match\n match[2] == \"=\" ? set_answer(match[1], args.first) : get_answer(match[1])\n else\n super\n end\n end",
"def ask\n end",
"def ask_question_and_check_answer\n question = MathGame::Question.new\n puts \"#{@turn}: #{question.display_question}\"\n question.obtain_answer\n question.display_message_on_answer\n question.correct?\n end",
"def set_survey_answer\n @survey_answer = SurveyAnswer.find(params[:id])\n end",
"def questions\n \n end",
"def ask\n @poll_centre = PollCentre.find(@question.poll_centre_id)\n if @poll_centre.has_current_question?\n #then error\n output_error = {\"error\" => \"There is a question currently in progress. Please wait for it to finish\"}\n respond_to do |format|\n format.json { render json: output_error.to_json, status: :bad_request }\n end\n elsif @question.is_asked?\n output_error = {\"error\" => \"Question already asked\"}\n respond_to do |format|\n format.json { render json: output_error.to_json, status: :bad_request }\n end\n else\n @question.started = true\n if @question.save\n channel_name = @poll_centre.title\n Pusher[\"#{channel_name}\"].trigger('question-start', {\n question_text: @question.text,\n option_a: @question.option_a,\n option_b: @question.option_b,\n option_c: @question.option_c,\n option_d: @question.option_d,\n question_id: @question.id\n })\n respond_to do |format|\n format.json { render json: @question, status: :ok }\n end\n else\n output_error = {\"error\" => \"Couldn't ask question. Please try again.\"}\n respond_to do |format|\n format.json { render json: output_error.to_json, status: :bad_request }\n end\n end\n end\n end",
"def correct_answer\n @correct_answer ||= question.correct\n end",
"def toggle_answer\n authorize!(:toggle_answer, @topic)\n if @post.toggle_answer\n render json: { isTopicResolved: @topic.reload.resolved? }\n else\n render json: { errors: @post.errors.full_messages.to_sentence }, status: :bad_request\n end\n end",
"def set_topic_answer\n @topic_answer = TopicAnswer.find(params[:id])\n end",
"def update\n def answer_given(question_id)\n return (params[:answer] and params[:answer][question_id.to_s] and\n params[:answer][question_id.to_s].length > 0)\n end\n \n @resp = Response.find(params[:id])\n\n @questionnaire.questions.each do |question|\n if question.kind_of? Questions::Field\n ans = Answer.find_answer(@resp, question)\n if answer_given(question.id)\n if ans.nil?\n ans = Answer.new :question_id => question.id, :response_id => @resp.id\n end\n ans.value = params[:answer][question.id.to_s]\n ans.save\n else\n # No answer provided\n if not ans.nil?\n ans.destroy\n end\n end\n end\n end\n\n respond_to do |format|\n if @resp.update_attributes(params[:response])\n format.html { redirect_to(response_url(@questionnaire, @resp)) }\n format.js { redirect_to(response_url(@questionnaire, @resp, :format => \"js\")) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.js { render :action => \"edit\" }\n format.xml { render :xml => @resp.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def answer\n @question = params[:questions]\n # we need to get the value from params in order to store the question.\n if @question.eql? 'I am going to work'\n @answer = 'Great!'\n elsif @question.end_with?('?')\n @answer = 'Silly question, get dressed and go to work!'\n else\n @answer = \"I don't care, get dressed and go to work!\"\n # we create @ = instance variable in order to use outside of the method.\n end\n end",
"def set_answer_respondent\n @answer_respondent = AnswerRespondent.find(params[:id])\n end",
"def start_questionnaire\n # bypassing the need for the user to select the survey - since we're launching with just one 'legislation'\n # When multiple legislations are available, this value will need to be provided by the form\n access_code = params[:survey_access_code] ||\n current_user.try(:default_jurisdiction) ||\n Survey::DEFAULT_ACCESS_CODE\n\n\n # if a dataset isn't supplied, create one for an authenticated user, or mock one for unauthenticated\n @dataset = Dataset.find_by_id(params[:dataset_id]) || (user_signed_in? ? current_user.datasets.create : Dataset.new)\n authorize! :update, @dataset\n\n # use the most recent survey\n @survey = Survey.where(:access_code => access_code).order(\"survey_version DESC\").first\n\n @response_set = ResponseSet.\n create(:survey => @survey,\n :user_id => current_user.try(:id),\n :dataset_id => @dataset.id\n )\n\n if @survey && @response_set\n session[:response_set_id] = current_user ? nil : @response_set.id\n\n if params[:source_response_set_id]\n source_response_set = ResponseSet.find(params[:source_response_set_id]) # TODO: ensure user has rights to copy the response set answers?\n @response_set.copy_answers_from_response_set!(source_response_set)\n end\n\n # flash[:notice] = t('surveyor.survey_started_success')\n redirect_to(surveyor.edit_my_survey_path(\n :survey_code => @survey.access_code, :response_set_code => @response_set.access_code))\n else\n flash[:notice] = t('surveyor.unable_to_find_that_legislation')\n redirect_to (user_signed_in? ? dashboard_path : root_path)\n end\n end",
"def advice\n end",
"def reply\n end"
] |
[
"0.630475",
"0.6207",
"0.6164153",
"0.6143247",
"0.61074156",
"0.610059",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6087265",
"0.6066268",
"0.6060683",
"0.6060683",
"0.6060683",
"0.6060683",
"0.6060683",
"0.5973714",
"0.5973714",
"0.59658813",
"0.58997095",
"0.5845405",
"0.58156246",
"0.58129764",
"0.5806757",
"0.58045006",
"0.5751614",
"0.57510495",
"0.5751017",
"0.57260615",
"0.57195437",
"0.5710537",
"0.5704957",
"0.5688665",
"0.56852555",
"0.5679747",
"0.5657007",
"0.5657007",
"0.5657007",
"0.5657007",
"0.5648185",
"0.56426334",
"0.56399155",
"0.56334037",
"0.5626959",
"0.562537",
"0.5625058",
"0.5617678",
"0.56093127",
"0.56079364",
"0.5598152",
"0.5594649",
"0.55883044",
"0.5586729",
"0.5586729",
"0.558459",
"0.558459",
"0.558459",
"0.55811834",
"0.557118",
"0.5560542",
"0.5557292",
"0.55472815",
"0.55462754",
"0.5526166",
"0.552565",
"0.5518939",
"0.5482255",
"0.5479219",
"0.5464996",
"0.5461826",
"0.5458575",
"0.5448193",
"0.54417735",
"0.5441739",
"0.54390997",
"0.5430106",
"0.54258883",
"0.54153395",
"0.5412012",
"0.5405957",
"0.5400877",
"0.5393512",
"0.5378264"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def answer_params
params.require(:answer).permit(:user_id, :question_id, :content, :book_id, :title, :is_tweet, :is_anonymous)
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 end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def valid_params_request?; end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def url_whitelist; end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.6980957",
"0.6783065",
"0.6747844",
"0.6741468",
"0.67356336",
"0.6592548",
"0.65036845",
"0.64978707",
"0.64825076",
"0.64795035",
"0.64560914",
"0.64397955",
"0.6379666",
"0.6376688",
"0.6366702",
"0.6319728",
"0.6300833",
"0.6300629",
"0.6294277",
"0.6293905",
"0.6291174",
"0.62905735",
"0.6283171",
"0.6242344",
"0.62403613",
"0.6218049",
"0.62143815",
"0.62104696",
"0.61949855",
"0.6178671",
"0.6176147",
"0.6173327",
"0.6163395",
"0.6153005",
"0.6151833",
"0.6147288",
"0.61224324",
"0.6118827",
"0.61075264",
"0.61054534",
"0.6092497",
"0.6080082",
"0.60710967",
"0.60627776",
"0.60219413",
"0.60175914",
"0.60153484",
"0.60107356",
"0.60081726",
"0.60081726",
"0.60013986",
"0.6000165",
"0.59978646",
"0.59936947",
"0.59925723",
"0.5992084",
"0.59796256",
"0.5967569",
"0.5960056",
"0.59589803",
"0.5958441",
"0.5958401",
"0.5952607",
"0.5952406",
"0.5944409",
"0.59391016",
"0.593842",
"0.593842",
"0.5933845",
"0.59312123",
"0.5926475",
"0.59248453",
"0.59179676",
"0.59109294",
"0.59101623",
"0.5908172",
"0.59058356",
"0.5899052",
"0.5897749",
"0.5896101",
"0.58942914",
"0.58939576",
"0.5892063",
"0.5887407",
"0.588292",
"0.58797663",
"0.587367",
"0.58681566",
"0.5868038",
"0.5866578",
"0.58665025",
"0.58655846",
"0.58640826",
"0.5863465",
"0.5862226",
"0.586065",
"0.58581287",
"0.5854443",
"0.5854172",
"0.58507544",
"0.5849934"
] |
0.0
|
-1
|
GET /logincms GET /logincms.json
|
def index
@logincms = Logincm.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @login = Login.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @login }\n end\n end",
"def getLogin( login_id)\n params = Hash.new\n params['login_id'] = login_id\n return doCurl(\"get\",\"/login\",params)\n end",
"def auto_login\n render json: @user\n end",
"def auto_login\n render json: @user\n end",
"def auto_login\n render json: @user\n end",
"def auto_login\n render json: @user\n end",
"def auto_login\n render json: logged_in_user\n end",
"def login\n @users = User.all\n render json: User.all\n end",
"def process_login\n user = User.where(login: params[:user][:login], password: params[:user][:password]).first\n respond_with :api, json:!user.nil?\n end",
"def login \n render json: User.first\n end",
"def login\n user = User.last\n login!(user)\n ses = session[:session_token]\n render json: {\"ses\": ses}\n end",
"def check_sign\n user = @current_user\n render :json => { login:true , admin: user.admin, user: {login:user.login, type:user.user_type, id: user.id}}\n end",
"def new\n\n respond_to do |format|\n format.html\n format.json {render json: 'login'}\n end\n end",
"def new\n\n respond_to do |format|\n format.html\n format.json {render json: 'login'}\n end\n end",
"def login\n if @user\n render_json 'Signed in Successfully', true, @user, :ok, [:api_v1, user]\n else\n render_json 'Unable to Signed in: wrong email or password', false, {}, :unauthorized\n end\n end",
"def login\n @rest.headers[:content_type] = \"application/json\"\n\n response = api_request { @rest[\"login\"].post({:username => @username, :password => @password}) }\n\n @rest.headers[:x_opsview_token] = response[:token]\n @rest.headers[:x_opsview_username] = @username\n\n response\n end",
"def find(login_name)\n get(\"admin/user/#{login_name}\")\n response.parsed_response\n end",
"def mob_login\n token_manager = API::Concerns::TokenManager.new(params[:email], params[:password], params[:access_token])\n current_user = token_manager.current_user\n if !current_user.nil?\n render json: JSON.parse(current_user.to_json).except('id', 'password', 'pass_salt', 'updated_at')\n else\n render json: JSON.parse(token_manager.token.to_json)\n end\n end",
"def login\n\t @user = current_user\n\t respond_to do |format|\n\t format.html {render :text => \"#{@user.id}\"}\n\t #format.xml {render :text => \"#{@user.id}\" }\n\t format.json {render :json => \"#{@user.id}\"}\n\t end\n\tend",
"def login\r\n return set_test_site if params[:id] == 'test'\r\n\r\n session[:edit_mode] = 0 if !params[:ok]\r\n render action: 'login', layout: 'cms'\r\nend",
"def login\n @user = User.authenticate credentials[:email], credentials[:password]\n if @user # serializer makes it easier to return json, in this case the token\n render json: @user, serializer: LoginUserSerializer, root: 'user'\n else\n head :unauthorized # if authentication case this is executed\n end\n end",
"def request_login(http)\r\n login_post = construct_login_request\r\n login_response = http.request(login_post)\r\n logger.debug \"Login response: #{login_response.code}, Message: #{login_response.message}, Body: #{login_response.body}\"\r\n\r\n if login_response.code == '200'\r\n logger.debug 'Successfully logged in.'\r\n\r\n json_resp = JSON.parse(login_response.body)\r\n json_resp['auth_token']\r\n else\r\n logger.debug 'Failed log in.'\r\n nil\r\n end\r\n end",
"def login\n admin = Admin.find_by(email: params[:email])\n puts admin\n if admin && admin.authenticate(params[:password])\n token = encode_token({admin_id: admin.id})\n render json: {admin: admin, token: token} \n else\n render json: {errors: \"Invalid email/password combination\"}\n end\n end",
"def get_current_logged_in_user \n get(\"/users.json/current\")\nend",
"def get_current_logged_in_user \n get(\"/users.json/current\")\nend",
"def login\n\t\trespond_to do |format|\n\t\t\tformat.js {}\n\t\tend\n\tend",
"def new\n @login = Login.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @login }\n end\n end",
"def index\n #authorize! :index, @login, :message => 'Not authorized as an administrator.'\n #É preciso ir buscar a clinica do gestor atual para carregar a informação\n manager = Manager.first(:conditions => \"login_id = #{current_login.id}\")\n @clinic = manager.clinic\n\n @managers = Manager.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @managers }\n end\n end",
"def index\n @cms_users = User.all\n end",
"def login\n Socky.send( {:action => \"login\", \n :user => params[:user],\n :channel => params[:channel]}.to_json,\n :to => { :channels => params[:channel] })\n render :text => \"ok\"\n end",
"def getTokenLogin( portal_name, language, flatpack_id, multipack_id)\n params = Hash.new\n params['portal_name'] = portal_name\n params['language'] = language\n params['flatpack_id'] = flatpack_id\n params['multipack_id'] = multipack_id\n return doCurl(\"get\",\"/token/login\",params)\n end",
"def logincm_params\n params.require(:logincm).permit(:content)\n end",
"def login\n #handle unexpected error with status code 500\n begin\n if request.env['CONTENT_TYPE'].include?('application/json') \n @client = Client.new\n errCode = @client.login(params[:user], params[:password])\n if errCode > 0\n dic = {:errCode => 1, :count => errCode}\n respond_to do |format|\n format.json { render json: dic, :status => 200 }\n end\n else\n dic = {:errCode => errCode}\n respond_to do |format|\n format.json { render json: dic, :status => 200 }\n end\n end\n else\n render :json => { :errors => \"Wrong Content-Type on Request'\" }, :status => 500\n end\n rescue\n render :json => { :errors => \"Unknown Errors\" }, :status => 500\n end\n end",
"def login #i guess with an iPhone app you never really have to log in because your app \n\t\t\t #maintains state and logins in at every call\n\t\t#@user = \"if you can see this you called the login action\"\n\t\t#render :json => @user\n\t\trender \"login\"\n\tend",
"def http_auth_login\n # FIXME: Implement\n end",
"def login()\n uri = URI('http://54.252.241.122:8000/users/authenticate')\n http = Net::HTTP.new(uri.host, uri.port)\n req = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json')\n req.body = {email: 'demo1@g.com', password: '*********'}.to_json\n res = http.request(req)\n tkn=JSON.parse(res.body)\n return tkn['result']['token']\nend",
"def login\r\n session[:edit_mode] = 0 unless params[:ok]\r\n render action: 'login', layout: 'cms'\r\nend",
"def set_logincm\n @logincm = Logincm.find(params[:id])\n end",
"def login\n return redirect_to \"/\" if current_user.present?\n\n respond_to do |format|\n format.html { render(\"login\") }\n format.text { render plain: \"Text not supported\" }\n format.json { render json: { error: \"JSON not supported\" } }\n end\n end",
"def loginAdmin\n params.permit(:email_administrateur, :motDePasse_administrateur)\n login = AdministrateurService.instance.loginAdmin(params[:email_administrateur], params[:motDePasse_administrateur])\n (login != nil) ? (render json: login, status: :ok) : (render json: nil, status: :not_found)\n end",
"def login\n user = User.find_by(username: auth_params[:username])\n if user && user.authenticate(auth_params[:password])\n payload = {user_id: user.id}\n token = encode_token(payload)\n render json: {jwt: token, userid: user.id, admin: user.admin}\n else\n render json: {failure: \"login failed\"}\n end\n end",
"def login(user)\n post '/api/v1/login', params: {email: user.email, password: user.password}\n return json['auth_token']\n end",
"def sign_in\n login = params['login']\n password = params['password']\n type = (params['type'] || 'standard').to_sym\n\n if login.nil? || password.nil?\n render :json => {error:'please enter params'}\n return\n end\n\n if type == :standard\n user = User.where(login:login,password:password,user_type:type).first\n if user.nil?\n render :json => { login:false , error: 'Invalid credentials' }\n return\n else\n raw_token = {login: user.login , password: password , type:user.user_type }\n token = JsonWebToken.encode(raw_token)\n render :json => { login:true , token: token , admin:user.admin , user: {login:user.login, type:user.user_type, id: user.id} }\n return\n end\n end\n if type == :ldap\n sing_in_ldap({login:login, password:password})\n\n end\n end",
"def login\n response = get \"server\"\n response.code == 200\n end",
"def login\n response = get \"server\"\n response.code == 200\n end",
"def index\n @logins = Login.all\n #cookies[:current_user] = \"user\"\n login_user = Login.find_by_id(session[:login_id])\n end",
"def show\n @login = Login.find(params[:id])\n end",
"def sing_in_ldap(args)\n login = args[:login]\n password = args[:password]\n ldap = User.ldapCheckUser({login:login, password:password})\n if ldap[:bind] == false\n render :json => { login: false , error:ldap[:error]}\n return\n else\n userObj = {login:login , user_type: :ldap}\n user = User.where(userObj).first_or_create\n raw_token = {login: user.login , password: password , type:user.user_type }\n token = JsonWebToken.encode(raw_token)\n\n render :json => { login: true , token: token , admin: user.admin, user: {login:user.login, type:user.user_type, id: user.id} }\n return\n end\n end",
"def loginpage\n end",
"def login\n RestClient.post(\"#{base_url}/j_spring_security_check\", {:j_username => username, :j_password => password}) do |response, request, result, &block|\n @cookies = response.cookies\n @cookies.delete('Path')\n if [301, 302, 307].include? response.code\n response\n else\n response.return!(request, result, &block)\n end\n end\n end",
"def login\n json_response({ message: 'NOT IMPLEMENTED' })\n end",
"def login\n end",
"def user_repos1\n addons = Addon.joins(:user).where(\"lower(users.login) = ?\", params[:login].downcase)\n render json: to_v1_repo_hashes(addons)\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def index\n @cms_pages = current_portal.pages\n end",
"def check_login\n\t\tif current_user.nil?\n\t\t\trender :json => { :message => 'Faça o seu login para continuar' }, status: 401\n\t\tend\n\tend",
"def index\n @login_id = current_user.login_id\n end",
"def cms\n if @user != nil and @user.admin?(@routes)\n show :header, views: File.join(Classiccms::ROOT, 'views/cms')\n end\n end",
"def login\n @user = User.find_by_username(params[:username])\n if @user&.authenticate(params[:password])\n token = JsonWebToken.encode(id: @user.id)\n time = Time.now #+ 24.hours.to_i\n render json: { token: token, last_login_time: time.strftime(\"%m-%d-%Y %H:%M\"),\n user: @user}, status: :ok\n # comment: @user.comment şu şekilde diğerleride çağrılabilir.\n else\n render json: { error: 'Login Unsuccessfull(Invalid username / password)' }, status: :unauthorized\n end\n end",
"def auto_login\n @token = params[:token]\n # byebug\n user = User.find(JWT.decode(@token, \"put your secret password here\", true, algorithm: 'HS256')[0][\"user_id\"])\n render json: user\n end",
"def show\n @login_key = LoginKey.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @login_key }\n end\n end",
"def do_login\n @login_results = get_organizations\n end",
"def login\n\n end",
"def login\n\n end",
"def login\n user = User.find_by(username: user_params[:username])\n if user && user.authenticate(user_params[:password])\n render json: user, except: [:password_digest, :created_at, :updated_at]\n else\n render json: {errors: \"Wrong Username or Password!\"}\n end\n end",
"def login_0\n\n #definde needed header\n headers = {'Authorization' => \"Basic \" + @base_user_string}\n\n #Login\n response = request({:method => \"POST\", :url => @host + \"login\", :headers => headers})\n\n #Get organisation link\n @org_link = parse_content(response.body, '//Org')[0].attribute('href').to_s\n\n #Get authentication header key\n @auth_key = response.headers[:x_vcloud_authorization]\n\n end",
"def mints_user_magic_link_login(hash)\r\n # Login in mints\r\n response = @mints_user.magic_link_login(hash)\r\n if response['data']\r\n # Set a cookie with the session token\r\n cookies[:mints_user_session_token] = { value: response['data']['api_token'], secure: true, httponly: true, expires: 1.day }\r\n redirect_to response['data']['redirect_url'] || '/'\r\n else\r\n redirect_to '/'\r\n end\r\n end",
"def get_dashboard\n # Setp 3: Try to access to the dashboard\n dashboard_req = setup_http_request($dashboard, @cookie)\n res = @http.request(dashboard_req)\n if res.code=='400' or res['location'] == \"https://www.blablacar.fr/identification\"\n raise AuthenticationError, \"Can't get logged in\"\n end\n res.body.force_encoding('utf-8')\n end",
"def index\n\t\t#@test = \"If you can see this you can get into the index page, then you have cookies that rmr you are logged in\"\n\t\t#render :json => @test\n\t\trender \"menu\"\n\tend",
"def index\n @box_login = BoxLogin.first\n end",
"def login\n @user_login\n end",
"def index\n manager = Manager.first(:conditions => \"login_id = #{current_login.id}\")\n @neuropsychologists = Neuropsychologist.all(:conditions => \"clinic_id = #{manager.clinic.id}\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @neuropsychologists }\n end\n end",
"def login\n #localhost:3000/api/login -u 'admin:password'\n authenticate_or_request_with_http_basic do |username, password|\n if username.include? '%40'\n email = username.gsub('%40','@');\n @user = User.find_by_email(email.downcase)\n else\n @user = User.find_by_username(username.downcase)\n end\n\n if @user && @user.authenticate(password)\n remember_token = RememberToken.create(token: User.encrypt(User.new_remember_token), user_id: @user.id, accessed_at: Time.now)\n respond_to do |format|\n format.json { render :json => remember_token }\n end\n end\n end\n end",
"def login\n user = User.find_by(email: user_login_params[:email])\n\n if user && user.authenticate(user_login_params[:password])\n token = create_token(user.id)\n render json: {\n user: user.attributes.except(\"password_digest\"),\n token: token,\n }, status: :ok\n else\n render json: {error: \"unauthorized\"}, status: :unauthorized\n end\n end",
"def login\n user = User.find_by(email: user_login_params[:email])\n\n if user && user.authenticate(user_login_params[:password])\n token = create_token(user.id)\n render json: {\n user: user.attributes.except(\"password_digest\"),\n token: token,\n }, status: :ok\n else\n render json: {error: \"unauthorized\"}, status: :unauthorized\n end\n end",
"def show\n @login = Login.where(id:params[:id])\n end",
"def auth_info\n render :action => 'auth_info.json', :layout => false\n end",
"def auth\n\n @user = current_user\n render json: @user\n \n end",
"def login\n if session[:user] != nil then\n logged_in_home_page = home_index_path\n respond_to do |format|\n format.html { redirect_to logged_in_home_page}\n format.json { head :no_content }\n end\n return\n end\n\n @user = User.new\n \n respond_to do |format|\n format.html # login.html.erb\n format.json { render json: @user }\n end\n end",
"def check_login\n I18n.locale = cookies[:lang] || I18n.default_locale\n begin\n if !request.xhr?\n $domain = request.protocol +\n (request.domain == nil ? request.host : request.domain) +\n (request.port == 80 ? '' : (':' + request.port.to_s))\n end\n rescue\n $domain = 'http://brse-school.vn'\n end\n\n begin\n if !($domain.include?('http://brse-school.vn') || $domain.include?('45.252.249.221') || $domain.include?('localhost:8100'))\n redirect_to '/error'\n end\n rescue\n\n end\n\n if session[:user_id] == nil\n if !request.xhr?\n redirect_to admin_login_index_path\n else\n result = Hash.new\n result['status'] = false\n render json: result\n end\n else\n @language = Helper.getLang\n $user_id = session[:user_id]\n if !request.xhr?\n @msg = Helper.genMsg\n @countRegistCouse = RegisterCourse.where(deleted_at: nil, status: 1).count(:id)\n @countRegistAdvisories = RegisterAdvisory.where(deleted_at: nil, status: 1).count(:id)\n @countRegistEvents = RegisterEvent.where(deleted_at: nil, status: 1).count(:id)\n @countSubscribes = Subscribe.where(deleted_at: nil, status: 1).count(:id)\n end\n end\n end",
"def attemp_login\n login = params[:email_or_phone]\n password = params[:password]\n\n unless !(login.present? && password.present?)\n #on recherche le customer\n @customer = Customer.find_by_phone(login)\n if @customer.blank?\n respond_to do |format|\n format.json {}\n format.html {render :signing, notice: \"Impossible de trouver #{login}\"}\n end\n else\n if @customer.valid_password?(password)\n session[:customer] = @customer.authentication_token\n respond_to do |format|\n format.html { redirect_to client_index_path(user: @customer.hand), notice: \"Logged in as #{@customer.phone}\"}\n end\n else\n respond_to do |format|\n format.html {redirect_to client_signing_path, notice: \"Utilisateur inconnu\"}\n end\n end\n end\n end\n end",
"def show\n user= params[:user]\n repo= params[:repo]\n puts user\n puts repo\n url = BASE_URL + \"repos/\" + user + \"/\" + repo + \"/collaborators\"+ \"?client_id=e24305f14f7f9a67c465&client_secret=604015f905f6207ec29f3661b952397663d58347\"\n # url = BASE_URL + \"repos/rails/rails/collaborators\"\n # url = BASE_URL + \"repositories\"\n @repo = JSON.parse(open(url).read)\n @results = []\n\n\n @repo.each do |doc|\n ids = doc['login']\n url_people = BASE_URL + \"users/\" + ids + \"?client_id=e24305f14f7f9a67c465&client_secret=604015f905f6207ec29f3661b952397663d58347\"\n @results << JSON.parse(open(url_people).read)\n end\n\n end",
"def set_cms_user\n @cms_user = User.find(params[:id])\n end",
"def login\n\n=begin\n :: Expected Params ::\n\n Constants::REQUEST_PARAM_USERNAME => Username\n Constants::REQUEST_PARAM_USERPASSWORD => UserPassword\n\n=end\n\n # Look up for User in database\n find_user\n\n if @user\n @user.signin!(request)\n\n render json: {status: status_code(:ok), message: '', data: @user.as_signin_json}\n \n end\n\n end",
"def mints_user_magic_link_login(hash)\r\n # Login in mints\r\n response = @mints_user.magic_link_login(hash)\r\n if response['data'] && response['data']['redirect_url']\r\n # Set a cookie with the session token\r\n cookies[:mints_user_session_token] = { value: response['data']['api_token'], expires: 1.day, secure: true, httponly: true }\r\n redirect_to response['data']['redirect_url']\r\n else\r\n redirect_to '/'\r\n end\r\n end",
"def login\n if params[:user] && params[:pass]\n @user = User.find_by_username(params[:user])\n if @user\n if @user.password == params[:pass]\n @json = {:status => \"success\", :id => @user.id}\n render json: @json\n else\n send_error(\"invalid password\")\n end\n else\n send_error(\"user not found\") \n end\n else\n send_error(\"bad parameters\")\n end\n end",
"def get_login_response( server_url, user_email, password )\n a = Mechanize.new\n begin\n page = a.get(\"http://#{server_url}/api/v1/sessions/create?user_password=#{ CGI::escape(password) }&user_email=#{ CGI::escape(user_email) }\")\n JSON.parse(page.body)\n rescue\n puts $!\n end\n end",
"def login\n user = User.find_by(username: params[\"username\"])\n if user && user.authenticate(params[\"password\"])\n session[:current_user_id] = user.id\n render json: User.to_hash(user)\n else\n render json: nil\n end\n end",
"def login\n mandatory_keys = [:app_id, :user_name, :password, :sign]\n if params.slice(*mandatory_keys).values.any?(&:nil?)\n render json: to_response('Some params are lost') and return\n elsif @service_provider.nil?\n render json: to_response('ServiceProvider error') and return\n elsif not CommonUtils.valid_sign?(params[:app_id], params[:user_name], params[:password], @service_provider.credential, params[:sign])\n render json: to_response('Invalid request: parameter error') and return\n end\n\n user = User.find_by_user_name(params[:user_name])\n if user && user.authenticate(params[:password])\n render json: (user.invalid_role? ? to_response('User needs to be activated') : to_response('success', user))\n elsif user.nil?\n render to_response \"User not exist:#{params[:user_name]}\"\n else\n render to_response 'Password error'\n end\n end",
"def login; end",
"def login\n # render :login\n end",
"def login\n puts '--- LOGIN ---'\n puts username: params[:user][:username]\n puts password: params[:user][:password]\n # = 'escape'\n user = User.find_by(username: params[:user][:username])\n if user && user.authenticate(params[:user][:password])\n token = create_token(user.id, user.username)\n render json: {status: 200, token: token, user: user}\n else\n render json: {status: 401, message: \"Unauthorized - Login\"}\n end\n end"
] |
[
"0.62309784",
"0.62117326",
"0.6147455",
"0.6121151",
"0.6116952",
"0.6116952",
"0.61017126",
"0.6091954",
"0.60704756",
"0.5985689",
"0.59348506",
"0.5892269",
"0.58425117",
"0.58425117",
"0.58358234",
"0.5807124",
"0.58065164",
"0.5777034",
"0.5775717",
"0.57529545",
"0.5749891",
"0.5743868",
"0.5736755",
"0.5729465",
"0.5729465",
"0.57285947",
"0.56901896",
"0.56824386",
"0.56740135",
"0.56719214",
"0.5659358",
"0.56477064",
"0.564488",
"0.56266177",
"0.5616705",
"0.56061584",
"0.56032497",
"0.55774283",
"0.5568717",
"0.55657727",
"0.5554802",
"0.5546326",
"0.5540381",
"0.55370337",
"0.55370337",
"0.5528193",
"0.55265576",
"0.55232614",
"0.54909873",
"0.54855454",
"0.5481894",
"0.54818887",
"0.54742724",
"0.54681915",
"0.54681915",
"0.54681915",
"0.54681915",
"0.54681915",
"0.54681915",
"0.54681915",
"0.54681915",
"0.54681915",
"0.5462991",
"0.5460499",
"0.5460443",
"0.5460134",
"0.5449651",
"0.5435808",
"0.5428432",
"0.542379",
"0.5419751",
"0.5419751",
"0.53911734",
"0.53903013",
"0.5390136",
"0.5387016",
"0.5386261",
"0.5383576",
"0.5372424",
"0.5372103",
"0.5371052",
"0.5367317",
"0.5367317",
"0.53619117",
"0.535581",
"0.53555304",
"0.5354292",
"0.5351673",
"0.5351147",
"0.53450954",
"0.53423136",
"0.53378975",
"0.5334902",
"0.5330907",
"0.5315738",
"0.53151673",
"0.53114605",
"0.5311156",
"0.53093415",
"0.5307935"
] |
0.6821947
|
0
|
GET /logincms/1 GET /logincms/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @logincms = Logincm.all\n end",
"def show\n @login = Login.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @login }\n end\n end",
"def auto_login\n render json: @user\n end",
"def login\n @users = User.all\n render json: User.all\n end",
"def index\n #authorize! :index, @login, :message => 'Not authorized as an administrator.'\n #É preciso ir buscar a clinica do gestor atual para carregar a informação\n manager = Manager.first(:conditions => \"login_id = #{current_login.id}\")\n @clinic = manager.clinic\n\n @managers = Manager.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @managers }\n end\n end",
"def auto_login\n render json: @user\n end",
"def auto_login\n render json: @user\n end",
"def auto_login\n render json: @user\n end",
"def login \n render json: User.first\n end",
"def getLogin( login_id)\n params = Hash.new\n params['login_id'] = login_id\n return doCurl(\"get\",\"/login\",params)\n end",
"def auto_login\n render json: logged_in_user\n end",
"def user_repos1\n addons = Addon.joins(:user).where(\"lower(users.login) = ?\", params[:login].downcase)\n render json: to_v1_repo_hashes(addons)\n end",
"def new\n\n respond_to do |format|\n format.html\n format.json {render json: 'login'}\n end\n end",
"def new\n\n respond_to do |format|\n format.html\n format.json {render json: 'login'}\n end\n end",
"def process_login\n user = User.where(login: params[:user][:login], password: params[:user][:password]).first\n respond_with :api, json:!user.nil?\n end",
"def index\n manager = Manager.first(:conditions => \"login_id = #{current_login.id}\")\n @neuropsychologists = Neuropsychologist.all(:conditions => \"clinic_id = #{manager.clinic.id}\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @neuropsychologists }\n end\n end",
"def new\n @login = Login.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @login }\n end\n end",
"def index\n @cms_users = User.all\n end",
"def check_sign\n user = @current_user\n render :json => { login:true , admin: user.admin, user: {login:user.login, type:user.user_type, id: user.id}}\n end",
"def login\n\t @user = current_user\n\t respond_to do |format|\n\t format.html {render :text => \"#{@user.id}\"}\n\t #format.xml {render :text => \"#{@user.id}\" }\n\t format.json {render :json => \"#{@user.id}\"}\n\t end\n\tend",
"def show\n user= params[:user]\n repo= params[:repo]\n puts user\n puts repo\n url = BASE_URL + \"repos/\" + user + \"/\" + repo + \"/collaborators\"+ \"?client_id=e24305f14f7f9a67c465&client_secret=604015f905f6207ec29f3661b952397663d58347\"\n # url = BASE_URL + \"repos/rails/rails/collaborators\"\n # url = BASE_URL + \"repositories\"\n @repo = JSON.parse(open(url).read)\n @results = []\n\n\n @repo.each do |doc|\n ids = doc['login']\n url_people = BASE_URL + \"users/\" + ids + \"?client_id=e24305f14f7f9a67c465&client_secret=604015f905f6207ec29f3661b952397663d58347\"\n @results << JSON.parse(open(url_people).read)\n end\n\n end",
"def show\n @login_key = LoginKey.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @login_key }\n end\n end",
"def find(login_name)\n get(\"admin/user/#{login_name}\")\n response.parsed_response\n end",
"def login\n user = User.last\n login!(user)\n ses = session[:session_token]\n render json: {\"ses\": ses}\n end",
"def show\n @login = Login.find(params[:id])\n end",
"def index\n @sprojects = current_user.sprojects.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sprojects }\n end\n end",
"def index\n @repositories = current_user.repositories\n respond_to do |format|\n format.html { redirect_to session_url }\n format.json { render json: @repositories }\n end\n end",
"def index\n @cmms = Cmm.all\n render json: @cmms\n end",
"def set_logincm\n @logincm = Logincm.find(params[:id])\n end",
"def index\n @cms_pages = current_portal.pages\n end",
"def login\r\n return set_test_site if params[:id] == 'test'\r\n\r\n session[:edit_mode] = 0 if !params[:ok]\r\n render action: 'login', layout: 'cms'\r\nend",
"def show\n @login = Login.where(id:params[:id])\n end",
"def get_current_logged_in_user \n get(\"/users.json/current\")\nend",
"def get_current_logged_in_user \n get(\"/users.json/current\")\nend",
"def index\n\t\t#@test = \"If you can see this you can get into the index page, then you have cookies that rmr you are logged in\"\n\t\t#render :json => @test\n\t\trender \"menu\"\n\tend",
"def index\n @box_login = BoxLogin.first\n end",
"def index\n render json: current_org.users\n end",
"def user1\n if user = User.where(\"lower(users.login) = ?\", params[:login].downcase).first\n result = {\n :id => user.id,\n :username => user.login,\n :name => user.name,\n :avatar_url => user.avatar_url,\n :location => user.location\n }\n render json: result\n else\n head :not_found\n end\n end",
"def index\n @logins = Login.all\n #cookies[:current_user] = \"user\"\n login_user = Login.find_by_id(session[:login_id])\n end",
"def login\n #handle unexpected error with status code 500\n begin\n if request.env['CONTENT_TYPE'].include?('application/json') \n @client = Client.new\n errCode = @client.login(params[:user], params[:password])\n if errCode > 0\n dic = {:errCode => 1, :count => errCode}\n respond_to do |format|\n format.json { render json: dic, :status => 200 }\n end\n else\n dic = {:errCode => errCode}\n respond_to do |format|\n format.json { render json: dic, :status => 200 }\n end\n end\n else\n render :json => { :errors => \"Wrong Content-Type on Request'\" }, :status => 500\n end\n rescue\n render :json => { :errors => \"Unknown Errors\" }, :status => 500\n end\n end",
"def show\n @sproject = current_user.sprojects.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sproject }\n end\n end",
"def login\n @rest.headers[:content_type] = \"application/json\"\n\n response = api_request { @rest[\"login\"].post({:username => @username, :password => @password}) }\n\n @rest.headers[:x_opsview_token] = response[:token]\n @rest.headers[:x_opsview_username] = @username\n\n response\n end",
"def index\n @login_id = current_user.login_id\n end",
"def index\n @menus = @user.menus.all\n render json: @menus\n end",
"def user_repo1\n addon = Addon.joins(:user)\n .where(\"lower(users.login) = ?\", params[:login].downcase)\n .where(\"lower(repos.name) = ?\", params[:repo_name].downcase)\n .first\n render json: to_v1_repo_hash(addon)\n end",
"def index\n p = Profile.where(:username=>session[:username]).first\n if(!p.nil?)\n @sites = Profile.mysite(p.id)\n if(p.id==1)\n @sites = Site.find(:all, :order => \"created_at DESC\")\n end\n else\n redirect_to '/' and return\n end\n @site = Site.new\n @profile_id = Profile.where(:username=>session[:username]).first.id\n @categories = p.categories.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end",
"def login #i guess with an iPhone app you never really have to log in because your app \n\t\t\t #maintains state and logins in at every call\n\t\t#@user = \"if you can see this you called the login action\"\n\t\t#render :json => @user\n\t\trender \"login\"\n\tend",
"def index\n projects = current_user.admin_projects.paginate(:page => params[:page])\n render json: projects\n end",
"def mob_login\n token_manager = API::Concerns::TokenManager.new(params[:email], params[:password], params[:access_token])\n current_user = token_manager.current_user\n if !current_user.nil?\n render json: JSON.parse(current_user.to_json).except('id', 'password', 'pass_salt', 'updated_at')\n else\n render json: JSON.parse(token_manager.token.to_json)\n end\n end",
"def index\n @pages = current_site.pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n symptoms = Symptom.where(user_id: params[:user_id])\n\n if current_user.id == params[:user_id].to_i\n render json: SymptomSerializer.new(symptoms)\n else\n render json: { error: '401 Unauthorized' }, status: 401\n end\n\n\n end",
"def index\n @cms_pages = CmsPage.all\n end",
"def login\r\n session[:edit_mode] = 0 unless params[:ok]\r\n render action: 'login', layout: 'cms'\r\nend",
"def auto_login\n @token = params[:token]\n # byebug\n user = User.find(JWT.decode(@token, \"put your secret password here\", true, algorithm: 'HS256')[0][\"user_id\"])\n render json: user\n end",
"def request_login(http)\r\n login_post = construct_login_request\r\n login_response = http.request(login_post)\r\n logger.debug \"Login response: #{login_response.code}, Message: #{login_response.message}, Body: #{login_response.body}\"\r\n\r\n if login_response.code == '200'\r\n logger.debug 'Successfully logged in.'\r\n\r\n json_resp = JSON.parse(login_response.body)\r\n json_resp['auth_token']\r\n else\r\n logger.debug 'Failed log in.'\r\n nil\r\n end\r\n end",
"def index\n @api_v1_menus = Menu.all\n render json: @api_v1_menus\n end",
"def login\n\t\trespond_to do |format|\n\t\t\tformat.js {}\n\t\tend\n\tend",
"def index\n @sites = current_user.sites.page(params[\"page\"])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end",
"def login\n Socky.send( {:action => \"login\", \n :user => params[:user],\n :channel => params[:channel]}.to_json,\n :to => { :channels => params[:channel] })\n render :text => \"ok\"\n end",
"def index\n Rails.logger.info \"index #{current_user}\"\n respond_to do |format|\n format.html\n format.json { render json: {status: 'ok',\n message: 'Welcome to Scalarm',\n user_id: current_user.id.to_s } }\n end\n end",
"def index\n # @logins = Login.all\n end",
"def index\n @site_editorials = SiteEditorial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @site_editorials }\n end\n end",
"def show\n @cm = Cm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cm }\n end\n end",
"def new\n @sproject = current_user.sprojects.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sproject }\n end\n end",
"def getTokenLogin( portal_name, language, flatpack_id, multipack_id)\n params = Hash.new\n params['portal_name'] = portal_name\n params['language'] = language\n params['flatpack_id'] = flatpack_id\n params['multipack_id'] = multipack_id\n return doCurl(\"get\",\"/token/login\",params)\n end",
"def index\n auth_response = plaid_client.auth.get(access_token)\n render json: auth_response.to_json\n end",
"def index\n @repositories = current_user.repositories.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @repositories }\n end\n end",
"def logincm_params\n params.require(:logincm).permit(:content)\n end",
"def autologin\n token = request.headers['Authorization']\n user_id = JWT.decode(token, 'secret')[0][\"userId\"]\n user = User.find(user_id)\n render json: user.user_information\n end",
"def index\n @projects = current_user.projects\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n if current_user.try(:admin?)\n @checkins = Checkin.all\n @checkins_for_json = current_user.checkins\n elsif user_signed_in?\n @checkins = current_user.checkins\n @checkins_for_json = @checkins\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @checkins_for_json }\n end\n end",
"def index\n if logged_in?\n @moms= Mom.all\n else\n require_login\n end\n end",
"def loginAdmin\n params.permit(:email_administrateur, :motDePasse_administrateur)\n login = AdministrateurService.instance.loginAdmin(params[:email_administrateur], params[:motDePasse_administrateur])\n (login != nil) ? (render json: login, status: :ok) : (render json: nil, status: :not_found)\n end",
"def login()\n uri = URI('http://54.252.241.122:8000/users/authenticate')\n http = Net::HTTP.new(uri.host, uri.port)\n req = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json')\n req.body = {email: 'demo1@g.com', password: '*********'}.to_json\n res = http.request(req)\n tkn=JSON.parse(res.body)\n return tkn['result']['token']\nend",
"def index\n @current_admin_user = current_admin_user\n @menus = Menu.all\n @title = \"Menus\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @menus }\n end\n end",
"def login\n if @user\n render_json 'Signed in Successfully', true, @user, :ok, [:api_v1, user]\n else\n render_json 'Unable to Signed in: wrong email or password', false, {}, :unauthorized\n end\n end",
"def auth_info\n render :action => 'auth_info.json', :layout => false\n end",
"def login\n admin = Admin.find_by(email: params[:email])\n puts admin\n if admin && admin.authenticate(params[:password])\n token = encode_token({admin_id: admin.id})\n render json: {admin: admin, token: token} \n else\n render json: {errors: \"Invalid email/password combination\"}\n end\n end",
"def index\n course = Course.find(params[:course_id])\n sections = course.sections.all\n render json: sections.order(:id)\n end",
"def sign_in\n login = params['login']\n password = params['password']\n type = (params['type'] || 'standard').to_sym\n\n if login.nil? || password.nil?\n render :json => {error:'please enter params'}\n return\n end\n\n if type == :standard\n user = User.where(login:login,password:password,user_type:type).first\n if user.nil?\n render :json => { login:false , error: 'Invalid credentials' }\n return\n else\n raw_token = {login: user.login , password: password , type:user.user_type }\n token = JsonWebToken.encode(raw_token)\n render :json => { login:true , token: token , admin:user.admin , user: {login:user.login, type:user.user_type, id: user.id} }\n return\n end\n end\n if type == :ldap\n sing_in_ldap({login:login, password:password})\n\n end\n end",
"def index\n # @projects = @current_user.projects\n @projects = Project.all\n json_response(@projects)\n end",
"def index\n @user = User.find_by_id(session[:userid])\n @projects = current_user_projects\n respond_to do |format|\n format.html # index.html.erb\n format.json\n end\n end",
"def show\n authenticate_user!\n @server = Server.find(params[:id])\n @checks = @server.checks.page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @server }\n end\n end",
"def index\n if (params[:user])\n @containers = User.find_by_login(params[:user]).containers\n else\n if (current_user.nil?)\n redirect_to :controller => :users, :action => :login\n return\n else\n @containers = current_user.containers\n end\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :layout => false }\n end\n end",
"def show\n @login = Login.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @login }\n end\n end",
"def load_json\n uri = URI.parse(\"https://api.github.com/users/#{@login}/repos\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n request = Net::HTTP::Get.new(uri.request_uri)\n response = http.request(request)\n JSON.parse(response.body)\n end",
"def index\n @cms_pages = Cms::Page.all\n end",
"def index\n authorize! :index, Campus, :message => 'Acceso denegado.'\n @campuses = @university.campuses\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @campuses }\n end\n end",
"def login\n @user = User.authenticate credentials[:email], credentials[:password]\n if @user # serializer makes it easier to return json, in this case the token\n render json: @user, serializer: LoginUserSerializer, root: 'user'\n else\n head :unauthorized # if authentication case this is executed\n end\n end",
"def set_cms_user\n @cms_user = User.find(params[:id])\n end",
"def check_login\n login = params[\"login\"]\n @unique = (User.find_by_username login)? false : true\n respond_to do |format|\n format.json { render :json => @unique }\n end\n end",
"def index\n @logins = Login.all\n end",
"def new\n @orbituarysite = current_user.orbituarysites.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @orbituarysite }\n end\n end",
"def index\n @susu_memberships = SusuMembership.page(params[:page]).per(params[:per])\n\n render json: @susu_memberships\n end",
"def show\n @auth = Auth.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @auth }\n end\n end",
"def set_login\n if not Login.exists? params[:id]\n render nothing: true, status: 404\n return\n end \n @login = Login.find(params[:id])\n end",
"def index\r\n user = authenticate\r\n if user\r\n clients = Client.where('clientof = ?', user.id)\r\n render json: {clients: clients, message: 'Success', status: :ok}\r\n else\r\n render json: {message: 'Invalid token', status: :unauthorized}\r\n end\r\n end",
"def show\n @sysconfig = Sysconfig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sysconfig }\n end\n end",
"def cms\n if @user != nil and @user.admin?(@routes)\n show :header, views: File.join(Classiccms::ROOT, 'views/cms')\n end\n end",
"def index\n @projects = current_user.projects.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @systemadmins = Systemadmin.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @systemadmins }\n end\n end"
] |
[
"0.69324327",
"0.64393204",
"0.610745",
"0.61062604",
"0.6088195",
"0.6061601",
"0.6044134",
"0.6044134",
"0.6029762",
"0.5989709",
"0.59347856",
"0.5916991",
"0.5885574",
"0.5885574",
"0.5877869",
"0.58426505",
"0.5820806",
"0.5793826",
"0.57879686",
"0.5749836",
"0.5716764",
"0.57113117",
"0.5684039",
"0.56720257",
"0.56625956",
"0.5658012",
"0.56528336",
"0.5650388",
"0.56460226",
"0.564181",
"0.56132853",
"0.56105614",
"0.5598212",
"0.5598212",
"0.55979484",
"0.55969286",
"0.559218",
"0.5589459",
"0.5587315",
"0.55847955",
"0.55781597",
"0.55257773",
"0.5519201",
"0.5508872",
"0.5505516",
"0.5499849",
"0.54716253",
"0.54543823",
"0.54457456",
"0.5442572",
"0.5441989",
"0.54367757",
"0.54284984",
"0.54243803",
"0.5418703",
"0.54164565",
"0.5415876",
"0.54084504",
"0.53969514",
"0.5395669",
"0.5392892",
"0.5392595",
"0.5392353",
"0.53911734",
"0.5387966",
"0.5378174",
"0.5372534",
"0.5372017",
"0.53704405",
"0.5368616",
"0.5364889",
"0.53637064",
"0.53624254",
"0.53612155",
"0.53585076",
"0.535456",
"0.53509915",
"0.53501755",
"0.5340361",
"0.5338823",
"0.53333014",
"0.53283966",
"0.53283745",
"0.5323707",
"0.5318139",
"0.53170186",
"0.5310211",
"0.5307304",
"0.5304522",
"0.5301761",
"0.53016514",
"0.5299023",
"0.5298342",
"0.5297879",
"0.52909374",
"0.52902937",
"0.52900225",
"0.52878153",
"0.52803886",
"0.5278188",
"0.52775484"
] |
0.0
|
-1
|
POST /logincms POST /logincms.json
|
def create
@logincm = Logincm.new(logincm_params)
respond_to do |format|
if @logincm.save
format.html { redirect_to @logincm, notice: 'Logincm was successfully created.' }
format.json { render :show, status: :created, location: @logincm }
else
format.html { render :new }
format.json { render json: @logincm.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def logincm_params\n params.require(:logincm).permit(:content)\n end",
"def login\n @rest.headers[:content_type] = \"application/json\"\n\n response = api_request { @rest[\"login\"].post({:username => @username, :password => @password}) }\n\n @rest.headers[:x_opsview_token] = response[:token]\n @rest.headers[:x_opsview_username] = @username\n\n response\n end",
"def auto_login\n render json: @user\n end",
"def login(email, password)\n post api_v1_user_session_path, \n headers: { 'CONTENT_TYPE' => 'application/json', 'ACCEPT' => 'application/json' },\n params: { email: email, password: password }.to_json\nend",
"def auto_login\n render json: @user\n end",
"def auto_login\n render json: @user\n end",
"def create\n @admin_login = Login.new(admin_login_params)\n\n respond_to do |format|\n if @admin_login.save\n format.html { redirect_to admin_login_path(@admin_login), notice: 'Login was successfully created.' }\n format.json { render :show, status: :created, location: @admin_login }\n else\n format.html { render :new }\n format.json { render json: @admin_login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def login\n admin = Admin.find_by(email: params[:email])\n puts admin\n if admin && admin.authenticate(params[:password])\n token = encode_token({admin_id: admin.id})\n render json: {admin: admin, token: token} \n else\n render json: {errors: \"Invalid email/password combination\"}\n end\n end",
"def login\n user = User.last\n login!(user)\n ses = session[:session_token]\n render json: {\"ses\": ses}\n end",
"def new\n\n respond_to do |format|\n format.html\n format.json {render json: 'login'}\n end\n end",
"def new\n\n respond_to do |format|\n format.html\n format.json {render json: 'login'}\n end\n end",
"def create\n @login = Login.new(params[:login])\n\n respond_to do |format|\n if @login.save\n format.html { redirect_to @login, notice: 'Login criado com sucesso!' }\n format.json { render json: @login, status: :created, location: @login }\n else\n format.html { render action: \"new\" }\n format.json { render json: @login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def auto_login\n render json: @user\n end",
"def login\n response = @session.create\n @auth_token = response[\"token\"]\n @rest.default_headers = { 'Content-Type' => 'application/json', 'Auth-Token' => @auth_token }\n response\n end",
"def login_request(username, password)\n post(data['hosts']['auth'] + '/login', {\n headers: {\n 'Content-Type' => 'application/json'\n },\n body: {\n username: username,\n password: password\n }\n })\nend",
"def create\n @login = Login.new(login_params)\n\n respond_to do |format|\n if @login.save\n format.html { redirect_to @login, notice: 'Login was successfully created.' }\n format.json { render :show, status: :created, location: @login }\n else\n format.html { render :new }\n format.json { render json: @login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @login = Login.new(login_params)\n\n respond_to do |format|\n if @login.save\n format.html { redirect_to @login, notice: 'Login was successfully created.' }\n format.json { render :show, status: :created, location: @login }\n else\n format.html { render :new }\n format.json { render json: @login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @logincms = Logincm.all\n end",
"def login_for_test\n create_user_for_test\n post \"/api/v1/auth/login\",\n { username: \"TestUser\",\n email: \"test@gmail.com\",\n password: \"password\" }.to_json,\n \"Accept\" => Mime::JSON, \n \"Content-Type\" => Mime::JSON.to_s\n token = JSON.parse(response.body)\n token[\"auth_token\"]\n end",
"def login(user)\n post '/api/v1/login', params: {email: user.email, password: user.password}\n return json['auth_token']\n end",
"def login\n #handle unexpected error with status code 500\n begin\n if request.env['CONTENT_TYPE'].include?('application/json') \n @client = Client.new\n errCode = @client.login(params[:user], params[:password])\n if errCode > 0\n dic = {:errCode => 1, :count => errCode}\n respond_to do |format|\n format.json { render json: dic, :status => 200 }\n end\n else\n dic = {:errCode => errCode}\n respond_to do |format|\n format.json { render json: dic, :status => 200 }\n end\n end\n else\n render :json => { :errors => \"Wrong Content-Type on Request'\" }, :status => 500\n end\n rescue\n render :json => { :errors => \"Unknown Errors\" }, :status => 500\n end\n end",
"def auto_login\n render json: logged_in_user\n end",
"def process_login\n user = User.where(login: params[:user][:login], password: params[:user][:password]).first\n respond_with :api, json:!user.nil?\n end",
"def create\n @cms_user = User.new(cms_user_params)\n\n respond_to do |format|\n if @cms_user.save\n format.html { redirect_to @cms_user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @cms_user }\n else\n format.html { render :new }\n format.json { render json: @cms_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def login\r\n return set_test_site if params[:id] == 'test'\r\n\r\n session[:edit_mode] = 0 if !params[:ok]\r\n render action: 'login', layout: 'cms'\r\nend",
"def new\n @login = Login.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @login }\n end\n end",
"def create\n @user_login = UserLogin.new(user_login_params)\n\n respond_to do |format|\n if @user_login.save\n format.html { redirect_to @user_login, notice: 'User login was successfully created.' }\n format.json { render :show, status: :created, location: @user_login }\n else\n format.html { render :new }\n format.json { render json: @user_login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def login\n pp \"1\"\n if request.post?\n pp admin = params[:admin]\n admins = Admin.where(\"login = ? and password = ? and deleted_at is null\",admin[\"login\"],admin[\"password\"]).first\n if admins.present?\n session[:admin] = admins\n redirect_to \"/shops\"\n else\n @login = params[:admin][\"login\"];@pwd = params[:admin][\"password\"]\n if @login.blank? || @pwd.blank?\n flash[:error]='用戶名或密碼不能為空。'\n else\n flash[:error]='用戶名或密碼不正確。'\n end\n return\n end\n end\n end",
"def loginAdmin\n params.permit(:email_administrateur, :motDePasse_administrateur)\n login = AdministrateurService.instance.loginAdmin(params[:email_administrateur], params[:motDePasse_administrateur])\n (login != nil) ? (render json: login, status: :ok) : (render json: nil, status: :not_found)\n end",
"def login\r\n session[:edit_mode] = 0 unless params[:ok]\r\n render action: 'login', layout: 'cms'\r\nend",
"def login\n if @user\n render_json 'Signed in Successfully', true, @user, :ok, [:api_v1, user]\n else\n render_json 'Unable to Signed in: wrong email or password', false, {}, :unauthorized\n end\n end",
"def check_sign\n user = @current_user\n render :json => { login:true , admin: user.admin, user: {login:user.login, type:user.user_type, id: user.id}}\n end",
"def cms_user_params\n params.require(:cms_user).permit(:new, :create, :index, :edit, :update, :destroy)\n end",
"def login\n user = User.find_by(username: auth_params[:username])\n if user && user.authenticate(auth_params[:password])\n payload = {user_id: user.id}\n token = encode_token(payload)\n render json: {jwt: token, userid: user.id, admin: user.admin}\n else\n render json: {failure: \"login failed\"}\n end\n end",
"def login\n user = User.find_by(email: user_login_params[:email])\n\n if user && user.authenticate(user_login_params[:password])\n token = create_token(user.id)\n render json: {\n user: user.attributes.except(\"password_digest\"),\n token: token,\n }, status: :ok\n else\n render json: {error: \"unauthorized\"}, status: :unauthorized\n end\n end",
"def login\n user = User.find_by(email: user_login_params[:email])\n\n if user && user.authenticate(user_login_params[:password])\n token = create_token(user.id)\n render json: {\n user: user.attributes.except(\"password_digest\"),\n token: token,\n }, status: :ok\n else\n render json: {error: \"unauthorized\"}, status: :unauthorized\n end\n end",
"def api_login\n creator = Creator.find_by(name: request.headers['name'])\n if creator && creator.authenticate(request.headers['password'])\n encode = encodeJWT(creator)\n selected_format({jwt: encode,creator_id: creator.id,name: creator.name,submits:creator.submits},:ok)\n else\n selected_format({ error: 'Invalid username or password' },:unauthorized)\n end\n end",
"def login\n\t\trespond_to do |format|\n\t\t\tformat.js {}\n\t\tend\n\tend",
"def mob_login\n token_manager = API::Concerns::TokenManager.new(params[:email], params[:password], params[:access_token])\n current_user = token_manager.current_user\n if !current_user.nil?\n render json: JSON.parse(current_user.to_json).except('id', 'password', 'pass_salt', 'updated_at')\n else\n render json: JSON.parse(token_manager.token.to_json)\n end\n end",
"def login\n Socky.send( {:action => \"login\", \n :user => params[:user],\n :channel => params[:channel]}.to_json,\n :to => { :channels => params[:channel] })\n render :text => \"ok\"\n end",
"def login()\n uri = URI('http://54.252.241.122:8000/users/authenticate')\n http = Net::HTTP.new(uri.host, uri.port)\n req = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json')\n req.body = {email: 'demo1@g.com', password: '*********'}.to_json\n res = http.request(req)\n tkn=JSON.parse(res.body)\n return tkn['result']['token']\nend",
"def sign_in\n login = params['login']\n password = params['password']\n type = (params['type'] || 'standard').to_sym\n\n if login.nil? || password.nil?\n render :json => {error:'please enter params'}\n return\n end\n\n if type == :standard\n user = User.where(login:login,password:password,user_type:type).first\n if user.nil?\n render :json => { login:false , error: 'Invalid credentials' }\n return\n else\n raw_token = {login: user.login , password: password , type:user.user_type }\n token = JsonWebToken.encode(raw_token)\n render :json => { login:true , token: token , admin:user.admin , user: {login:user.login, type:user.user_type, id: user.id} }\n return\n end\n end\n if type == :ldap\n sing_in_ldap({login:login, password:password})\n\n end\n end",
"def make_login user, password\n server = Configuration.SERVER\n addr = Configuration.CLIOWL_ADDRESS\n \n HttpHelper.post \"http://#{server}#{addr}/login\", { 'user' => user, 'password' => password }\n end",
"def login=(new_login)\n @json['user']['content']['login'] = new_login\n end",
"def login\n\n end",
"def login\n\n end",
"def login\n @user = users(:user1)\n post user_session_path, params: { 'user[email]' => @user.email, 'user[password]' => 'password' }\n end",
"def request_login(http)\r\n login_post = construct_login_request\r\n login_response = http.request(login_post)\r\n logger.debug \"Login response: #{login_response.code}, Message: #{login_response.message}, Body: #{login_response.body}\"\r\n\r\n if login_response.code == '200'\r\n logger.debug 'Successfully logged in.'\r\n\r\n json_resp = JSON.parse(login_response.body)\r\n json_resp['auth_token']\r\n else\r\n logger.debug 'Failed log in.'\r\n nil\r\n end\r\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def getTokenLogin( portal_name, language, flatpack_id, multipack_id)\n params = Hash.new\n params['portal_name'] = portal_name\n params['language'] = language\n params['flatpack_id'] = flatpack_id\n params['multipack_id'] = multipack_id\n return doCurl(\"get\",\"/token/login\",params)\n end",
"def form_login(user, password)\n post '/goldberg/auth/login', :login => {\n :name => user,\n :password => password\n }\n end",
"def sign_as_admin\n post mock_login_url, params: {registration: \"1\", admin: true}\n end",
"def login\n RestClient.post(\"#{base_url}/j_spring_security_check\", {:j_username => username, :j_password => password}) do |response, request, result, &block|\n @cookies = response.cookies\n @cookies.delete('Path')\n if [301, 302, 307].include? response.code\n response\n else\n response.return!(request, result, &block)\n end\n end\n end",
"def login\n user = User.find_by(email: params[:email])\n return render json: { message: ['Email does not exist'] }, status: 422 unless user\n return render json: { message: ['Password not valid'] }, status: 422 unless user.valid_password?(params[:password])\n\n token = user.tokens.create\n render json: { auth_token: token.auth_token }, status: :ok\n end",
"def login\n puts '--- LOGIN ---'\n puts username: params[:user][:username]\n puts password: params[:user][:password]\n # = 'escape'\n user = User.find_by(username: params[:user][:username])\n if user && user.authenticate(params[:user][:password])\n token = create_token(user.id, user.username)\n render json: {status: 200, token: token, user: user}\n else\n render json: {status: 401, message: \"Unauthorized - Login\"}\n end\n end",
"def create\n if @user = login(params[:email], params[:password], params[:remember])\n render json: {:ok => true, :user => {:id => @user.id, :username => @user.username, :email => @user.email}}\n else\n render json: {:ok => false}, status: :unprocessable_entity\n end\n end",
"def login\n @users = User.all\n render json: User.all\n end",
"def sing_in_ldap(args)\n login = args[:login]\n password = args[:password]\n ldap = User.ldapCheckUser({login:login, password:password})\n if ldap[:bind] == false\n render :json => { login: false , error:ldap[:error]}\n return\n else\n userObj = {login:login , user_type: :ldap}\n user = User.where(userObj).first_or_create\n raw_token = {login: user.login , password: password , type:user.user_type }\n token = JsonWebToken.encode(raw_token)\n\n render :json => { login: true , token: token , admin: user.admin, user: {login:user.login, type:user.user_type, id: user.id} }\n return\n end\n end",
"def login\n end",
"def new\n if(params[\"session\"] == 'nil')\n session[:mailid] = nil\n end\n @loginuser = Loginuser.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @loginuser }\n end\n \n end",
"def login\n @user = User.authenticate credentials[:email], credentials[:password]\n if @user # serializer makes it easier to return json, in this case the token\n render json: @user, serializer: LoginUserSerializer, root: 'user'\n else\n head :unauthorized # if authentication case this is executed\n end\n end",
"def login_params\n params.require(:login).permit(:user_login, :password)\n end",
"def login_params\n params.require(:login).permit(:login)\n end",
"def login \n user = User.find_by(username: params[:formData][:username])\n if user && user.authenticate(params[:formData][:password])\n wristband = encode_token({user_id: user.id})\n render json: {user: UserSerializer.new(user), token: wristband}\n else\n render json: {error: \"incorrect username or password\"}\n end\n end",
"def create\n user = User.find_by(email: login_params[:email])\n if user && user.authenticate(login_params[:password])\n session[:user_id] = user.id\n render json: { logged_in: true, user: UserSerializer.new(user) }, status: 200\n else\n \n render json: {errors: ['invalid email or password']}, status: 401\n end\n end",
"def login\n\n=begin\n :: Expected Params ::\n\n Constants::REQUEST_PARAM_USERNAME => Username\n Constants::REQUEST_PARAM_USERPASSWORD => UserPassword\n\n=end\n\n # Look up for User in database\n find_user\n\n if @user\n @user.signin!(request)\n\n render json: {status: status_code(:ok), message: '', data: @user.as_signin_json}\n \n end\n\n end",
"def login \n render json: User.first\n end",
"def login\n # @user = User.find_by(username: params[:username])\n @user = User.find_by(email: params[:email])\n\n if @user && @user.authenticate(params[:password])\n token = encode_token({user_id: @user.id})\n render json: {user: @user, token: token}\n else\n render json: {error: \"Invalid username or password\"}\n end\n end",
"def create\n @session_login = current_user.session_logins.build(session_login_params)\n respond_to do |format|\n if @session_login.save\n format.html { redirect_to @session_login, notice: \"Session login was successfully created.\" }\n format.json { render :show, status: :created, location: @session_login }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @session_login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def login_for_second_test\n create_user_for_test\n post \"/api/v1/auth/login\",\n { username: \"SecondTestUser\",\n email: \"Secondtest@gmail.com\",\n password: \"secondpassword\" }.to_json,\n \"Accept\" => Mime::JSON,\n \"Content-Type\" => Mime::JSON.to_s\n token = JSON.parse(response.body)\n token[\"auth_token\"]\n end",
"def test_post_login\n\t\tpost \"/login\"\n\t\tassert_equal 200, last_response.status\n\tend",
"def login; end",
"def login \n isPasswordCorrect = AuthenticationHelper::Auth.instance.checkPassword( request.body )\n params = JSON.parse( request.body.read )\n emailParams = params[\"email\"]\n \n if ( isPasswordCorrect )\n token = AuthenticationHelper::Auth.instance.generateJWT( emailParams )\n render json: token, status: :ok\n else \n render json: :nothing, status: :not_found\n end\n end",
"def create\n user=ApiM8::Client::Account::Users.instance.login(params[:login], params[:password])\n puts user.current_user\n\n if user\n session[:current_user_id]=user.id\n redirect_to role_super_admin_dashboards_url, :notice => \"Logged in as #{params[:login]}!\"\n else\n flash[:danger] = 'Invalid email/password combination' # Not quite right!\n render \"new\"\n end\n\n\n end",
"def login\n email = request.POST[:email]\n password = request.POST[:password]\n \n w = Walker.where(:email => email).first\n if w.nil? # walker with this email not found\n render :json => {:success => false}\n else\n bcrypt = ::BCrypt::Password.new(w.encrypted_password)\n password = ::BCrypt::Engine.hash_secret(password, bcrypt.salt)\n\n if w.encrypted_password == password\n render :json => {:success => true,\n :id => w.id,\n :name => w.name,\n :surname => w.surname,\n :vokativ => w.vokativ}\n else\n render :json => {:success => false}\n end\n end\n end",
"def login #i guess with an iPhone app you never really have to log in because your app \n\t\t\t #maintains state and logins in at every call\n\t\t#@user = \"if you can see this you called the login action\"\n\t\t#render :json => @user\n\t\trender \"login\"\n\tend",
"def create\n @login_page = LoginPage.new(login_page_params)\n\n respond_to do |format|\n if @login_page.save\n format.html { redirect_to @login_page, notice: 'Login page was successfully created.' }\n format.json { render :show, status: :created, location: @login_page }\n else\n format.html { render :new }\n format.json { render json: @login_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def login\n @user = User.find_by_username(params[:username])\n if @user&.authenticate(params[:password])\n token = JsonWebToken.encode(id: @user.id)\n time = Time.now #+ 24.hours.to_i\n render json: { token: token, last_login_time: time.strftime(\"%m-%d-%Y %H:%M\"),\n user: @user}, status: :ok\n # comment: @user.comment şu şekilde diğerleride çağrılabilir.\n else\n render json: { error: 'Login Unsuccessfull(Invalid username / password)' }, status: :unauthorized\n end\n end",
"def sign_in_admin\n get \"/en/users/sign_in\"\n post '/en/users/sign_in', 'user[email]' => 'admin@test.com', 'user[password]' => '12345678'\n follow_redirect!\n end",
"def login_form_post\n begin\n params = {'image' => Base64.encode64(open(user_params[:image].tempfile.path) { |io| io.read }),\n 'email' => user_params[:email]}\n parsed_uri = URI.parse(request.base_url + '/rest/login/')\n resp = Net::HTTP.post_form(parsed_uri, params)\n rescue => e\n Rails.logger.debug(e)\n ensure\n redirect_to root_path\n end\n end",
"def call_rest_login\n print \"validating credentials...\" \n @uri.path = \"/nitro/v1/config/login/\"\n @request = Net::HTTP::Post.new(@uri)\n @request.add_field('Content-Type', 'application/vnd.com.citrix.netscaler.login+json')\n @request.body = { :login => { :username => \"#{@username}\", :password => \"#{@password}\" } }.to_json \n\n Net::HTTP.start(@uri.host, @uri.port) { |http|\n response = http.request(@request)\n if response.code == \"201\"\n print \"success!\\n\"\n else\n print \"fail!\\n\"\n print JSON.parse(response.body), \"\\n\"\n abort()\n end\n }\n end",
"def auto_login\n @token = params[:token]\n # byebug\n user = User.find(JWT.decode(@token, \"put your secret password here\", true, algorithm: 'HS256')[0][\"user_id\"])\n render json: user\n end",
"def session_login_params\n params.require(:session_login).permit(:title, :content)\n end",
"def create\n @loginuser = Loginuser.new(params[:loginuser])\n\n respond_to do |format|\n if @loginuser.save\n format.html { redirect_to @loginuser, notice: 'Loginuser was successfully created.' }\n format.json { render json: @loginuser, status: :created, location: @loginuser }\n else\n format.html { render action: \"new\" }\n format.json { render json: @loginuser.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(user_params)\n if @user.save\n login(@user)\n render :show\n else\n render json: @user.errors.full_messages, status: 422\n end\n\n end",
"def request_spec_login(user)\n login_params = {user: {email: user.email, password: user.password}}\n post \"/users/sign_in\", login_params\n end",
"def request_spec_login(user)\n login_params = {user: {email: user.email, password: user.password}}\n post \"/users/sign_in\", login_params\n end",
"def login\n user = User.find_by(username: params[:user][:username])\n # authenticate method from has_secure_password in user model\n if user && user.authenticate(params[:user][:password])\n token = create_token(user.id, user.username)\n render json: {status: 200, token: token, user: user}\n else\n render json: {status: 401, message: \"Unauthorized\"}\n end\n end",
"def auth_post(client_login, client_password, expiration_minutes = 60 * 24 * 30)\n begin\n path = \"/#{VERSION}/authentication\"\n request = Net::HTTP::Post.new(path, initheader = {'Content-Type' =>'application/json'})\n auth_data = {\n \"Login\" => client_login,\n \"Password\" => client_password,\n \"TokenExpirationInMinutes\" => expiration_minutes\n }.delete_if{|_,v| v.nil? }.to_json\n request.body = auth_data\n response = http_connection.request(request)\n result = JSON.parse(response.body)\n return result\n rescue => e\n puts 'Error Authenticating: ' + e.message\n end\n end",
"def submit_login\n\n @@agent.get \"#{BASE_URL}/divanet/\"\n @@agent.page.form_with(name: 'loginActionForm') do |form|\n form.field_with(name: 'accessCode').value = @user.access_code #Setting.login_id\n form.field_with(name: 'password').value = @user.password #Setting.login_password\n form.click_button\n end\n\n # # ログインに成功してたらログアウトが存在するはず\n # puts true if @@agent.page.body =~ /divanet/logout/\n end",
"def login\n\tend",
"def create\n self.resource = warden.authenticate!(auth_options)\n sign_in(resource_name, resource)\n respond_to do |format|\n format.json {\n render :json => {\n :user => Api::V1::LoginUserSerializer.new(current_user, root: false),\n :status => :ok,\n :authentication_token => current_user.authentication_token\n }\n }\n end\n end"
] |
[
"0.6122274",
"0.60951006",
"0.6030115",
"0.6030039",
"0.60276663",
"0.60276663",
"0.6020652",
"0.597549",
"0.5950285",
"0.5947875",
"0.5947875",
"0.5901616",
"0.5900529",
"0.5899142",
"0.58969116",
"0.58904505",
"0.58904505",
"0.5859339",
"0.5847378",
"0.58425814",
"0.5826458",
"0.5817489",
"0.5815834",
"0.58120304",
"0.5800191",
"0.5790716",
"0.5786105",
"0.5785355",
"0.5784732",
"0.5784181",
"0.5781356",
"0.57614255",
"0.5756535",
"0.5753371",
"0.5750608",
"0.5750608",
"0.5738985",
"0.57228154",
"0.5708523",
"0.5691213",
"0.5680141",
"0.56698817",
"0.56675655",
"0.5661101",
"0.56595516",
"0.56595516",
"0.5659175",
"0.5647755",
"0.5644954",
"0.5644954",
"0.5644954",
"0.5644954",
"0.5644954",
"0.5644954",
"0.5644954",
"0.5644954",
"0.5644954",
"0.56369877",
"0.563604",
"0.56298053",
"0.5628755",
"0.56258124",
"0.56230915",
"0.5621391",
"0.5620589",
"0.5619114",
"0.56115645",
"0.55953974",
"0.55947286",
"0.55765486",
"0.55711657",
"0.55612683",
"0.55531806",
"0.5541602",
"0.5534504",
"0.5521969",
"0.551704",
"0.55164754",
"0.55082893",
"0.55057865",
"0.5501639",
"0.54979724",
"0.54841423",
"0.5482537",
"0.5477542",
"0.54711217",
"0.5467883",
"0.54672664",
"0.54477805",
"0.54421616",
"0.54331595",
"0.54307175",
"0.54274845",
"0.5410505",
"0.5410505",
"0.540988",
"0.5405791",
"0.54018176",
"0.5401643",
"0.54008794"
] |
0.62735856
|
0
|
PATCH/PUT /logincms/1 PATCH/PUT /logincms/1.json
|
def update
respond_to do |format|
if @logincm.update(logincm_params)
format.html { redirect_to @logincm, notice: 'Logincm was successfully updated.' }
format.json { render :show, status: :ok, location: @logincm }
else
format.html { render :edit }
format.json { render json: @logincm.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_current_logged_in_users_password(args = {}) \n put(\"/users.json/current/password\", args)\nend",
"def update\n @login = Login.find(params[:id])\n\n respond_to do |format|\n if @login.update_attributes(params[:login])\n format.html { redirect_to @login, notice: 'Login alterado com sucesso!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_login.update(permitir)\n format.html { redirect_to admin_login_path(@admin_login), notice: 'Login was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_login }\n else\n format.html { render :edit }\n format.json { render json: @admin_login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_current_logged_in_user(args = {}) \n put(\"/users.json/current\", args)\nend",
"def update_current_logged_in_users_password(args = {}) \n id = args['id']\n temp_path = \"/users.json/current/password\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"userId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n respond_to do |format|\n if @login.update(login_params)\n format.html { redirect_to @login, notice: 'Login was successfully updated.' }\n format.json { render :show, status: :ok, location: @login }\n else\n format.html { render :edit }\n format.json { render json: @login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @login.update(login_params)\n format.html { redirect_to @login, notice: 'Login was successfully updated.' }\n format.json { render :show, status: :ok, location: @login }\n else\n format.html { render :edit }\n format.json { render json: @login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @login.update(login_params)\n format.html { redirect_to @login, notice: 'Login was successfully updated.' }\n format.json { render :show, status: :ok, location: @login }\n else\n format.html { render :edit }\n format.json { render json: @login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @loginuser = Loginuser.find(params[:id])\n\n respond_to do |format|\n if @loginuser.update_attributes(params[:loginuser])\n format.html { redirect_to @loginuser, notice: 'Loginuser was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @loginuser.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n verify_post_request\n access_denied unless has_role?(:admin)\n require_parameters :login\n\n user = User.find_active_by_login(params[:login])\n\n if user.nil?\n render_bad_request(\"Could not find user with login #{params[:login]}\")\n elsif user.update_attributes!(params)\n hash = user.to_hash\n respond_to do |format|\n format.json { render :json => jsonp(hash) }\n format.xml { render :xml => hash.to_xml(:skip_types => true, :root => 'users') }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_login.update(user_login_params)\n format.html { redirect_to @user_login, notice: 'User login was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_login }\n else\n format.html { render :edit }\n format.json { render json: @user_login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cms_user.update(cms_user_params)\n format.html { redirect_to @cms_user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @cms_user }\n else\n format.html { render :edit }\n format.json { render json: @cms_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @user = User.find(params[:id])\n @user = current_user # makes our views \"cleaner\" and more consistent\n params[:user][:existing_identity_attrs] ||= {}\n unless configatron.user_can_change_login\n params[:user].delete(:login)\n @user_login_is_readonly = true\n end\n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = \"Account updated!\"\n format.html { redirect_to account_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @login_key = LoginKey.find(params[:id])\n\n respond_to do |format|\n if @login_key.update_attributes(params[:login_key])\n format.html { redirect_to @login_key, notice: 'Login key was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @login_key.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n head :unauthorized\n end",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def patch!\n request! :patch\n end",
"def update\n respond_to do |format|\n if @login_request.update(login_request_params)\n format.html { redirect_to @login_request, notice: 'Login request was successfully updated.' }\n format.json { render :show, status: :ok, location: @login_request }\n else\n format.html { render :edit }\n format.json { render json: @login_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cms_role.update(cms_role_params)\n format.html { redirect_to @cms_role, notice: 'Role was successfully updated.' }\n format.json { render :show, status: :ok, location: @cms_role }\n else\n format.html { render :edit }\n format.json { render json: @cms_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n format.html { redirect_to controller: \"sites\", action: \"checklists_manager\" }\n format.json { head :no_content }\n end\n end",
"def update_current_logged_in_user(args = {}) \n id = args['id']\n temp_path = \"/users.json/current\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"userId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n respond_to do |format|\n if @rcadmin_login_log.update(rcadmin_login_log_params)\n format.html { redirect_to @rcadmin_login_log, notice: 'Login log was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rcadmin_login_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n login = user_params[:login]\n\n raise \"not authorized\" unless is_admin || is_me(login)\n\n LDAP::User.update(login, user_params)\n render json: LDAP::User.find(login)\n rescue => e\n render_failure(e.message)\n end",
"def update\n @login = Login.find(params[:id])\n\n respond_to do |format|\n if @login.update_attributes(params[:login])\n flash[:notice] = 'Login was successfully updated.'\n format.html { redirect_to(@login) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @login.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\t\tget_current_user\n\t\t@user = User.find(params[:id])\n\n\t\treturn (render json: {errors: [\"Je bent niet geauthoriseerd om dit te doen\"]}, status: :unprocessable_entity) unless (@current_user.isAdmin || @current_user.id == @user.id)\n\n\t respond_to do |format|\n\t if @user.update_attributes(params[:user])\n\t \tnew_remember_token(@user) if @current_user.isStudent\n\t format.json { head :no_content }\n\t else\n\t format.json { render json: {errors: @user.errors.full_messages}, status: :unprocessable_entity }\n\t end\n\t end\n\tend",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n login_id = params[:manager].delete(:login_id)\n gender_id = params[:manager].delete(:gender_id)\n clinic_id = params[:manager].delete(:clinic_id)\n @manager = Manager.find(params[:id])\n\n @manager.login_id = login_id\n @manager.gender_id = gender_id\n @manager.clinic_id = clinic_id\n\n respond_to do |format|\n if @manager.update_attributes(params[:manager])\n format.html { redirect_to @manager, notice: 'Manager was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @manager.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tbl_login.update(tbl_login_params)\n format.html { redirect_to @tbl_login, notice: 'Tbl login was successfully updated.' }\n format.json { render :show, status: :ok, location: @tbl_login }\n else\n format.html { render :edit }\n format.json { render json: @tbl_login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n change = false\n user = User.find(params[:id])\n if not params[\"first_name\"].nil? and !params[\"first_name\"].blank?\n change = true\n user.login.update(first_name: params[\"first_name\"])\n end\n if not params[\"last_name\"].nil? and !params[\"last_name\"].blank?\n change = true\n user.login.update(last_name: params[\"last_name\"])\n end\n if not params[\"password\"].nil? and !params[\"password\"].blank?\n change = true\n user.login.update(password: params[\"password\"])\n end\n if not params[\"middle_initial\"].nil? and !params[\"middle_initial\"].blank?\n change = true\n user.login.update(middle_initial: params[\"middle_initial\"])\n end\n if not params[\"login_type\"].nil? and !params[\"login_type\"].blank?\n change = true\n user.login.update(login_type: params[\"login_type\"].to_i)\n end\n if not params[\"username\"].nil? and !params[\"username\"].blank?\n change = true\n user.login.update(username: params[\"username\"])\n end\n if not params[\"email\"].nil? and !params[\"email\"].blank?\n change = true\n user.login.update(email: params[\"email\"])\n end\n if not params[\"login_type\"].nil? and !params[\"login_type\"].blank?\n change = true\n user.login.update(login_type: params[\"login_type\"])\n end\n #@user.login.update(updated_at: DateTime.now)\n\n if not params[\"program\"].nil? and !params[\"program\"].blank?\n change = true\n user.update(program: params[\"program\"])\n end\n if not params[\"status\"].nil? and !params[\"status\"].blank?\n change = true\n user.update(status: params[\"status\"])\n end\n if change\n respond_to do |format|\n format.html { redirect_to user, notice: 'User was updated successfully.' }\n end\n end\n end",
"def update_by_ajax\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n cat_h = {:desktop => User::AUTH_DESKTOP, :user => User::AUTH_USER, :log => User::AUTH_LOG}\n\n yaml = ApplicationHelper.get_config_yaml\n\n cat_h.keys.each do |cat|\n\n next if params[cat].blank?\n\n unless @login_user.admin?(cat_h[cat])\n render(:text => t('msg.need_to_be_admin'))\n return\n end\n\n yaml[cat] ||= {}\n\n params[cat].each do |key, val|\n yaml[cat][key] = val\n end\n end\n\n ApplicationHelper.save_config_yaml(yaml)\n\n render(:text => '')\n end",
"def update\n respond_to do |format|\n if params[:user][:password].present? ? @user.update_attributes(params[:user]) : @user.update_without_password(params[:user])\n flash[:notice] = 'User was successfully updated.'\n @changed << @user.id\n \n sign_in @user, bypass: true if current_user.id == @user.id\n\n format.html { redirect_to :back }\n format.js { render 'shared/index'; flash.discard }\n format.json { head :no_content }\n else\n @edited << @user.id\n @expanded << @user.id\n\n format.html { render action: 'edit', template: 'shared/edit' }\n format.js { render 'user' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = get_user(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to root_url, notice: \"User #{@user.login_name} was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @migrations_lock.update(migrations_lock_params)\n format.html { redirect_to @migrations_lock, notice: 'Migrations lock was successfully updated.' }\n format.json { render :show, status: :ok, location: @migrations_lock }\n else\n format.html { render :edit }\n format.json { render json: @migrations_lock.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n account = current_organization.accounts.find(params[:id])\n return forbidden unless account && current_account.allowed_to_edit_account?(account, current_organization)\n return json(account) unless account.update_attributes pick(params, :first_name, :last_name, :email,:language, :document_language)\n\n role = pick(params, :role)\n #account.update_attributes(role) if !role.empty? && current_account.admin?\n membership = current_organization.role_of(account)\n membership.update_attributes(role) if !role.empty? && current_account.admin?\n password = pick(params, :password)[:password]\n if (current_account.id == account.id) && password\n account.update(password: password)\n end\n json account.canonical(membership: membership)\n end",
"def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"def update\n @identity = Identity.find(params[:id])\n\n if @identity.update(identity_params)\n head :no_content\n else\n render json: @identity.errors, status: :unprocessable_entity\n end\n end",
"def update\n customer = Customer.find_by_authentication_token(params[:token])\n pwd = 111111 #SecureRandom.hex(4)\n if customer.blank?\n render json: {\n message: \"Impossible d'activer ce badge\"\n }\n else\n #on met à jour les informations\n query = customer.update(\n name: params[:name],\n second_name: params[:second_name],\n cni: params[:cni],\n phone: params[:phone],\n sexe: params[:sexe],\n two_fa: params[:authenticated],\n password: pwd\n )\n\n #verification de la mise a jour\n Sms.new(params[:phone], \"Votre mot de passe est #{pwd}, conservez en toute securité\")\n end\n end",
"def update\n @operations_check = OperationsCheck.find(params[:id])\n\n respond_to do |format|\n if @operations_check.update_attributes(operations_check_params)\n format.html { redirect_to @operations_check, \n notice: 'Operations check was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @operations_check.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin.update(admin_params)\n format.html do \n sign_in @admin.user\n redirect_to @admin, notice: 'Admin was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @admin }\n else\n format.html { render :edit }\n format.json { render json: @admin.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @caso.update_attributes(caso_params)\n format.html { redirect_to @caso, notice: 'Caso was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @caso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n puts \"current user\"\n puts @user.id\n puts current_user.id\n if current_user.admin || @user.id == current_user.id\n if user_params['is_disabled']\n @user.tokens = nil\n end\n if @user.update(user_params)\n render json: @user\n else\n puts @user.errors.full_messages\n render json: @user.errors, status: :unprocessable_entity\n end\n else\n render json: @user.errors, status: :bad_request\n end\n end",
"def update\n @login = Login.find(params[:id])\n\n #Test for save successful and react\n if @login.update(login_params.to_h.deep_reject { |k, v| ['password', 'password_confirmation'].include?(k) && v.blank? })\n flash[:success] = \"Account updated\"\n redirect_to :back\n else\n flash[:alert] = \"Account NOT updated\"\n render 'edit'\n end\n end",
"def update\n @user = User.find(params[:id])\n\n force_log_out = false\n should_go_to_root = false\n admin_count = User.where(\"role = ?\", \"admin\").count\n if @user.role == \"admin\" && params[:user][:role] != \"admin\"\n if admin_count <= 1\n redirect_to :back, notice: 'user.no_admins'\n return\n else\n force_log_out = true if @user.id == current_user.id\n end\n end\n\n # current admin changed its password, need to logout and should go to root.\n if @user.id == current_user.id and !params[:user][:password].empty?\n should_go_to_root = true\n end\n\n # don't change password if it is empty\n params[:user].delete :password if params[:user][:password].empty?\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n if force_log_out\n sign_out current_user\n format.html { redirect_to root_path, notice: 'user.no_longer_admin' }\n else\n if should_go_to_root\n format.html { redirect_to root_path, notice: 'user.updated' }\n else\n format.html { redirect_to @user, notice: 'user.updated' }\n end\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def login=(new_login)\n @json['user']['content']['login'] = new_login\n end",
"def update\n authorize! :update, @admin_system_admin\n respond_to do |format|\n if @admin_system_admin.update(admin_system_admin_params)\n format.html { redirect_to @admin_system_admin, notice: 'System admin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_system_admin.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @minor.update(minor_params)\n format.html { redirect_to :show, notice: 'Minor was successfully updated.' }\n format.json { render :show, status: :ok, location: @minor }\n else\n format.html { render :edit }\n format.json { render json: @minor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(cms_site_params)\n\n format.html { redirect_to cms.sites_url, notice: '站点已修改.' }\n format.json { head :no_content }\n else\n @cms_theme = Cms::Theme.all\n format.html { render action: 'edit' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update_almacen,Sigesp::Solicitud\n if @sigesp_solicitud.update(sigesp_solicitud_alamcen_params)\n return render json: { url: sigesp_solicitudsalmacen_path(@sigesp_solicitud)} \n else\n return render json:@sigesp_solicitud.errors ,status: :unprocessable_entity\n end \n end",
"def update\n # render json:params\n # return \n\n\n respond_to do |format|\n if @manage_section.update(manage_section_params)\n format.html { redirect_to manage_compete_url(@compete), notice: 'Section was successfully updated.' }\n format.json { render :show, status: :ok, location: @manage_section }\n else\n format.html { render :edit }\n format.json { render json: @manage_section.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\n end\n end",
"def update\n respond_to do |format|\n if @user.password_changed?\n sign_in(@user, :bypass => true)\n else\n if @user.update(user_params)\n format.html { redirect_to \"/\", notice: t('success_update') }\n format.json { render :show, status: :ok, location: \"/\" }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end\nend",
"def update_user_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/users/{userId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n @user = User.find(params[:id])\n ####\n @user.status = params[:user][:status] if is_admin?\n params[:user].delete(:status )\n #pp = params[:user].merge(:password => '1' )\n \n logger.info(params[:user])\n #####\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @account_login.update(account_login_params)\n format.html { redirect_to @account_login, notice: 'Account login was successfully updated.' }\n format.json { render :show, status: :ok, location: @account_login }\n else\n format.html { render :edit }\n format.json { render json: @account_login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :edit, @questionnaire\n\n @questionnaire.load_JSON(params[:questionnaire], current_user)\n\n respond_to do |format|\n# if @questionnaire.update_attributes(params[:questionnaire])\n format.html { redirect_to @questionnaire, notice: 'Kysymyslomakkeen muokkaaminen onnistui.' }\n format.json { head :no_content }\n# else\n# format.html { render action: \"edit\" }\n# format.json { render json: @questionnaire.errors, status: :unprocessable_entity }\n# end\n\n end\n end",
"def update\n respond_to do |format|\n if @major.update(major_params)\n format.html { redirect_to @major, notice: 'Major was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @major.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @api_v1_user.update(api_v1_user_params)\n head :no_content\n else\n render json: @api_v1_user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @complaint = Complaint.find(params[:id])\n\n if @complaint.update_attributes(params[:complaint])\n head :no_content\n else\n render json: @complaint.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n @user.name = params[:name]\n @user.email = params[:email]\n @user.password = params[:password]\n @user.photo = params[:photo]\n @user.role = params[:type]\n @user.save\n render json:@user\n end",
"def update\n respond_to do |format|\n if @payment_site_master.update(payment_site_master_params)\n format.html { redirect_to @payment_site_master, notice: 'Payment site master was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render 'edit' }\n format.json { render json: @payment_site_master.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @login_page.update(login_page_params)\n format.html { redirect_to @login_page, notice: 'Login page was successfully updated.' }\n format.json { render :show, status: :ok, location: @login_page }\n else\n format.html { render :edit }\n format.json { render json: @login_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"def update\n respond_to do |format|\n if @joseph_memo.update(joseph_memo_params)\n format.html { redirect_to @joseph_memo, notice: 'Joseph memo was successfully updated.' }\n format.json { render :show, status: :ok, location: @joseph_memo }\n else\n format.html { render :edit }\n format.json { render json: @joseph_memo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if is_me? params[:id] || is_admin?\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, :notice => 'User was successfully updated.' }\n #format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n #format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n else\n redirect_to :root\n end\n end",
"def update_mod\n if params[:title] != nil && params[:content] != nil\n @question.title = params[:title]\n @question.content = params[:content]\n\n question_json = @question.to_h.to_json\n\n url = @httpIp+'/pet.com/api/question/updateQuestion'\n uri = URI(url)\n res = Net::HTTP.post(uri, question_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully updated\"\n redirect_to questions_path\n end\n end",
"def update\n @user = User.find(params[:id])\n @profile = Profile.find @user.profile.id\n\n if @user.mooveit? && !params[:is_admin].nil?\n @user.role = Role.find_by_name Role::ADMIN_ROLE\n end\n\n if @user.admin? && params[:is_admin].nil?\n @user.role = Role.find_by_name Role::MOOVEIT_ROLE\n end\n\n\n respond_to do |format|\n if @user.update_without_password(params[:user]) && @profile.update_attributes(params[:profile])\n #format.html { redirect_to @user, notice: 'User was successfully updated.' }\n #format.json { head :no_content }\n @users = User.all\n format.js { render action: \"index\" }\n else\n #format.html { render action: \"edit\" }\n format.js { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(args)\n builder.update_rest(type, ref, args, username, password)\n self.elements(true)\n end",
"def update\n #Finding the specific chore where the id matches the one we pass in with the body\n @v1_chore = Chore.where(id: params[:id]).first\n #Here we're checking if we have user_id in our body, and if we do, we'll change the selected chore's properties\n #with the parameters of the body, we go through the specific group to our specific chore with the path\n if v1_chore_params[:user_id]\n @v1_chore.user_id = params[:user_id]\n @v1_chore.assigned = true\n if @v1_chore.save\n render :show, status: :ok\n end\n else\n render json: @v1_chore.errors, status: :unprocessable_entity\n end\n end",
"def update\n if params[:admin][:password].blank?\n [:password,:password_confirmation,:current_password].collect{|p| params[:admin].delete(p) }\n else\n @admin.errors[:base] << \"El password que has ingresado es incorrecto\" unless @admin.valid_password?(params[:admin][:current_password])\n end\n \n respond_to do |format|\n if @admin.errors[:base].empty? and @admin.update_attributes(params[:admin])\n flash[:notice] = \"Tu cuenta ha sido actualizada\"\n format.json { render :json => @admin.to_json, :status => 200 }\n format.xml { head :ok }\n format.html { render :action => :edit }\n else\n format.json { render :text => \"No se puede actualizar Admin\", :status => :unprocessable_entity } #placeholder\n format.xml { render :xml => @admin.errors, :status => :unprocessable_entity }\n format.html { render :action => :edit, :status => :unprocessable_entity }\n end\n end\n \n rescue ActiveRecord::RecordNotFound\n respond_to_not_found(:js, :xml, :html)\n end",
"def update\n @admin = Admin.find(params[:id])\n\n if @admin.update(admin_params)\n head :no_content\n else\n render json: @admin.errors, status: :unprocessable_entity\n end\n end",
"def update_users_password_by_e_mail(args = {}) \n put(\"/users.json/backoffice/email/#{args[:email]}/password/#{args[:password]}\", args)\nend",
"def update_users_password_by_e_mail(args = {}) \n put(\"/users.json/backoffice/email/#{args[:email]}/password/#{args[:password]}\", args)\nend",
"def update\n @sistema = Sistema.find(params[:id])\n\n respond_to do |format|\n if @sistema.update_attributes(params[:sistema])\n format.html { redirect_to @sistema, notice: 'Sistema was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sistema.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if (params[:user][:password].blank?)\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n\n end\n\n if !current_user.super_admin?\n params[:user].delete(:username)\n end\n\n if unauthorized_access(!current_user.nil? && (current_user.id == @user.id || can?(:edit, \"User\".constantize)))\n return\n end\n\n if (@user.super_admin? && !current_user.super_admin?)\n return unauthorized_access(false)\n end\n\n user_redirect = admin_users_path\n redirect_options = { notice: 'Usuário foi atualizado com sucesso.' }\n\n respond_to do |format|\n @user.password_string = @user.password\n if verify_super_admin(@user) && @user.update(params[:user])\n if !params[:user][:password].blank?\n Devise::LDAP::Adapter.update_password(@user.username, params[:user][:password])\n end\n\n if current_user.id == @user.id\n flash[:notice] = 'Usuário foi atualizado com sucesso. Para ter acesso ao sistema, é preciso se logar novamente com seus dados de acesso atualizados.'\n sign_out_and_redirect(@user)\n return\n end\n format.html { redirect_to user_redirect, redirect_options }\n format.json { head :no_content }\n else\n if current_user.local_access?\n @uos = {current_user.uo.nome => current_user.uo.id}\n else\n @uos = Uo.order(\"nome ASC\").all.collect {|uo| [uo.nome, uo.id]}\n end\n @roles = Role.order(\"nome ASC\").all.collect { |role| [role.nome, role.id] }\n if !verify_super_admin(@user)\n flash.now[:error] = \"Apenas um usuário com papel de SuperAdmin pode criar outro usuário SuperAdmin\"\n end\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ministerios = Ministerios.find(params[:id])\n @title = \"Edição do Ministério: \" + @ministerios.nome\n respond_to do |format|\n if @ministerios.update_attributes(params[:ministerios])\n Ministerios.update(@ministerios.id, :respmod => self.current_usuarios.login.upcase)\n \tflash[:notice] = 'Ministerios was successfully updated.'\n format.html { redirect_to(ministerios_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ministerios.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mysite.update(mysite_params)\n format.html { redirect_to @mysite, notice: 'Mysite was successfully updated.' }\n format.json { render :show, status: :ok, location: @mysite }\n else\n format.html { render :edit }\n format.json { render json: @mysite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @usuario = Usuario.find(params[:id])\n\n if @usuario.update(usuario_params)\n head :no_content\n else\n render json: @usuario.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n unless User.admin_by_token?(request.cookies[\"token\"])\n render json: { error: \"invalid_token\" }, status: :unauthorized\n return\n end\n\n if @resource.update(resource_params)\n render json: @resource, status: :ok\n else\n render json: @resource.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n @identity = Identity.find(params[:id])\n if UnixCrypt.valid?(params[:identity][:token], @identity.token)\n params[:identity][:token] = @identity.token\n if @identity.update(identity_params)\n url = \"/identities/s/\"+@identity['uuid']\n format.html { redirect_to url, notice: \"Identity was successfully updated.\" }\n format.json { render :show, status: :ok, location: @identity }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @identity.errors, status: :unprocessable_entity }\n end\n else\n url = \"/identities/s/\"+@identity['uuid']\n format.html { redirect_to url, notice: \"Invalid token.\" }\n format.json { render json: @identity.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_ministerio.update(sivic_ministerio_params)\r\n format.html { redirect_to @sivic_ministerio, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_ministerio.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update(request)\n end",
"def update(request)\n end",
"def update\n @sproject = current_user.sprojects.find(params[:id])\n\n respond_to do |format|\n if @sproject.update_attributes(params[:sproject])\n format.html { redirect_to @sproject, notice: 'Sproject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sproject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n if current_user.admin? && params[:password].present?\n @user.password = params[:password]\n end\n if @user != current_user && !current_user.admin?\n render json: ['Not authorized for that action'], status: :unauthorized\n elsif @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n # login_id = params[:neuropsychologist].delete(:login_id)\n # clinic_id = params[:neuropsychologist].delete(:clinic_id)\n # gender_id = params[:neuropsychologist].delete(:gender_id)\n @neuropsychologist = Neuropsychologist.find(params[:id])\n\n # @neuropsychologist.login_id = login_id\n # @neuropsychologist.clinic_id = clinic_id\n # @neuropsychologist.gender_id = gender_id\n\n respond_to do |format|\n if @neuropsychologist.update_attributes(params[:neuropsychologist])\n format.html { redirect_to @neuropsychologist, notice: 'Neuropsicologo editado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @neuropsychologist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @metodologia.update(metodologia_params)\n format.html { redirect_to @metodologia, notice: 'Metodologia was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @metodologia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cas_user.update(cas_user_params)\n format.html { redirect_to @cas_user, notice: 'Cas user was successfully updated.' }\n format.json { render :show, status: :ok, location: @cas_user }\n else\n format.html { render :edit }\n format.json { render json: @cas_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @system_info = SystemInfo.find(params[:id])\n @system_info.updated_user = current_user.login_name\n \n respond_to do |format|\n if @system_info.update_attributes(params[:system_info])\n format.html { redirect_to maint_index_path, notice: 'System info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @system_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session_login.update(session_login_params)\n format.html { redirect_to @session_login, notice: \"Session login was successfully updated.\" }\n format.json { render :show, status: :ok, location: @session_login }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @session_login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n if(params[:usertype] != nil and params[:usertype] != 2)\n params[:sistema] = nil # TODO isso nao funfa\n end\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to root_url, notice: 'Usuario foi atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @login_user = args[:login_user] if args.key?(:login_user)\n end",
"def update!(**args)\n @login_user = args[:login_user] if args.key?(:login_user)\n end",
"def update\n @go_slim = GoSlim.find(params[:id])\n\n respond_to do |format|\n if @go_slim.update_attributes(params[:go_slim])\n format.html { redirect_to @go_slim, notice: 'Go slim was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @go_slim.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update \n user = User.find(params[:id])\n # byebug\n user.update(user_params)\n\n render json: user\n end",
"def update\n if params[:user][:password].blank?\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n end\n\n @user = User.find(params[:id])\n @user.attributes = params[:user]\n respond_to do |format|\n if @user.save\n format.html { redirect_to users_path(), notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n @permissions = Permission.all()\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meteorite.update(meteorite_params)\n format.html { redirect_to @meteorite, notice: 'Meteorite was successfully updated.' }\n format.json { render :show, status: :ok, location: @meteorite }\n else\n format.html { render :edit }\n format.json { render json: @meteorite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @sys_check = SysCheck.find(params[:id])\n\n respond_to do |format|\n if @sys_check.update_attributes(params[:sys_check])\n format.html { redirect_to @sys_check, notice: 'Sys check was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sys_check.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6281074",
"0.6264895",
"0.61071366",
"0.60869557",
"0.6045298",
"0.6028609",
"0.6028609",
"0.6028609",
"0.5985509",
"0.59574085",
"0.59443176",
"0.59024346",
"0.58505386",
"0.58505046",
"0.5846989",
"0.5846014",
"0.5846014",
"0.5803889",
"0.5761116",
"0.57595867",
"0.57572776",
"0.5749768",
"0.5715294",
"0.57144094",
"0.5695084",
"0.56924057",
"0.56869876",
"0.564406",
"0.56354654",
"0.5634626",
"0.55679786",
"0.55665404",
"0.5545834",
"0.5538382",
"0.55322605",
"0.55299723",
"0.5528698",
"0.5521952",
"0.5512225",
"0.55044514",
"0.5497029",
"0.5471694",
"0.54716474",
"0.5468956",
"0.5459173",
"0.5457687",
"0.54528755",
"0.5448209",
"0.54452723",
"0.5443951",
"0.5431374",
"0.54286915",
"0.54233104",
"0.5422052",
"0.5416538",
"0.5414212",
"0.5413267",
"0.5413124",
"0.54102623",
"0.5406061",
"0.54055154",
"0.54002243",
"0.54001987",
"0.5399449",
"0.5396119",
"0.53862846",
"0.5370331",
"0.5367105",
"0.53652036",
"0.53642654",
"0.5361734",
"0.5361521",
"0.5361521",
"0.5355016",
"0.5351777",
"0.5349655",
"0.5348208",
"0.53437185",
"0.5343268",
"0.5343268",
"0.53425145",
"0.53405905",
"0.53387535",
"0.5334473",
"0.5334473",
"0.5329343",
"0.5327327",
"0.53267884",
"0.53239137",
"0.5321436",
"0.5320758",
"0.531801",
"0.5312584",
"0.5301534",
"0.5301534",
"0.53014964",
"0.5299491",
"0.52980316",
"0.52965856",
"0.52943027"
] |
0.6159547
|
2
|
DELETE /logincms/1 DELETE /logincms/1.json
|
def destroy
@logincm.destroy
respond_to do |format|
format.html { redirect_to logincms_url, notice: 'Logincm was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def deleteLogin( login_id)\n params = Hash.new\n params['login_id'] = login_id\n return doCurl(\"delete\",\"/login\",params)\n end",
"def destroy\n @cm = Cm.find(params[:id])\n @cm.destroy\n\n respond_to do |format|\n format.html { redirect_to cms_url }\n format.json { head :no_content }\n end\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @login = Login.find(params[:id])\n @login.destroy\n\n respond_to do |format|\n format.html { redirect_to login_index_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_login.destroy\n respond_to do |format|\n format.html { redirect_to admin_logins_url, notice: 'Login was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rcadmin_login_log.destroy\n respond_to do |format|\n format.html { redirect_to rcadmin_login_logs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin.destroy\n\n render json: { operation: 'OK' }, status: :ok\n end",
"def destroy\n @adminmatrixgenu.destroy\n respond_to do |format|\n format.html { redirect_to adminmatrixgenus_url }\n format.json { head :no_content }\n end\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def destroy\n # return if need_login true, true\n @site = Site.find params[:id]\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @cms_page.destroy\n respond_to do |format|\n format.html { redirect_to cms_pages_url, notice: \"#{@cms_page.title} has been deleted.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cpanel_mall.destroy\n respond_to do |format|\n format.html { redirect_to cpanel_malls_url }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n repository = path.split(/\\//)[2]\n objectid = path.split(/\\//)[3]\n if storage_fetch(repository, objectid) && storage_delete(repository, objectid)\n ['200', {}, []]\n else\n ['404', {}, [\"Repository #{repository} or ObjectID #{objectid} not found: #{path}\"]]\n end\n end",
"def destroy\n @admin = Admin.find(params[:id])\n @admin.destroy\n\n render json: {:ok => true}\n end",
"def destroy\n @curso.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @mysite.destroy\n respond_to do |format|\n format.html { redirect_to mysites_url, notice: 'Mysite was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cms_page.destroy\n respond_to do |format|\n format.html { redirect_to cms_pages_url, notice: 'Cms page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @go_slim = GoSlim.find(params[:id])\n @go_slim.destroy\n\n respond_to do |format|\n format.html { redirect_to go_slims_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@static_content = StaticContent.find(params[:id])\n #@static_content.destroy\n #\n #respond_to do |format|\n # format.html { redirect_to static_contents_url }\n # format.json { head :no_content }\n #end\n end",
"def destroy\n @login.destroy\n respond_to do |format|\n format.html { redirect_to logins_url, notice: 'Login was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @login.destroy\n respond_to do |format|\n format.html { redirect_to logins_url, notice: 'Login was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @login.destroy\n respond_to do |format|\n format.html { redirect_to logins_url, notice: 'Login was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cms_user.destroy\n respond_to do |format|\n format.html { redirect_to cms_users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @database = Database.find(params[:id])\n path = @database.path\n delete = %x[rm -R #{path}]\n @database.destroy\n\n respond_to do |format|\n format.html { redirect_to databases_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cms_page.destroy\n respond_to do |format|\n format.html { redirect_to cms_pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @login_key = LoginKey.find(params[:id])\n @login_key.destroy\n\n respond_to do |format|\n format.html { redirect_to login_keys_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cms_role.destroy\n respond_to do |format|\n format.html { redirect_to cms_roles_url, notice: 'Role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @operations_check = OperationsCheck.find(params[:id])\n @operations_check.destroy\n\n respond_to do |format|\n format.html { redirect_to operations_checks_url }\n format.json { head :no_content }\n end\n end",
"def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end",
"def delete\n render json: Alien.delete(params[\"id\"])\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy\n @box_login.destroy\n respond_to do |format|\n format.html { redirect_to box_logins_url, notice: 'Box login was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n request(:delete)\n end",
"def destroy\n @sitemenu.destroy\n respond_to do |format|\n format.html { redirect_to sitemenus_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @payment_site_master.destroy\n respond_to do |format|\n format.html { redirect_to payment_site_masters_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n logout\n render json: {:ok => true}\n end",
"def destroy\n @adminabout.destroy\n respond_to do |format|\n format.html { redirect_to adminabouts_path, notice: 'Test was successfully destroyed.' }\n format.json { head :no_adminabout }\n end\n end",
"def delete\n delete_from_server single_url\n end",
"def destroy\n @license.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Запись о лицензии удалена.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @caso.destroy\n respond_to do |format|\n format.html { redirect_to casos_url }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def destroy\n @orbituarysite = Orbituarysite.find(params[:id])\n @orbituarysite.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin.destroy\n\n head :no_content\n end",
"def destroy\n if @short_url.destroy\n render json: { status: \"Deleted\" }\n else\n render json: { head: \"no content\" }\n end \n end",
"def destroy\n @sesh.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site_editorial.destroy\n respond_to do |format|\n format.html { redirect_to site_editorials_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admins_news.destroy\n respond_to do |format|\n format.html { redirect_to admins_news_index_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @loginuser = Loginuser.find(params[:id])\n @loginuser.destroy\n\n respond_to do |format|\n format.html { redirect_to loginusers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ca.destroy\n respond_to do |format|\n format.html { redirect_to cas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @adminmatrixstorageform.destroy\n respond_to do |format|\n format.html { redirect_to adminmatrixstorageforms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin.destroy\n respond_to do |format|\n format.html { redirect_to admins_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def destroy\r\n @sivic_ministerio.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_ministerios_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @api_v1_menu.destroy\n render json: {message: 'deletado com sucesso'}\n end",
"def destroy\n @access.destroy\n respond_to do |format|\n format.html { redirect_to accesses_url }\n format.json { head :no_content }\n end\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def destroy\n @cso = Cso.find(params[:id])\n @cso.destroy\n\n respond_to do |format|\n format.html { redirect_to csos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @jakeslink = Jakeslink.find(params[:id])\n @jakeslink.destroy\n\n respond_to do |format|\n format.html { redirect_to jakeslinks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company_news.destroy\n respond_to do |format|\n format.html { redirect_to company_news_index_url, notice: 'Новость была удалена' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @midia.destroy\n\n respond_to do |format|\n format.html { redirect_to midias_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_about = About.find(params[:id])\n @admin_about.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_abouts_url }\n format.json { head :no_content }\n end\n end",
"def delete(path, data = {})\n self.class.delete path, :body => data.merge(:u => access_token)\n end",
"def delete\n render json: Company.delete(params[\"id\"])\n end",
"def destroy\n @microsite.destroy\n respond_to do |format|\n format.html { redirect_to microsites_url }\n format.json { head :no_content }\n end\n end",
"def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"def destroy\n @server.destroy\n respond_to do |format|\n format.html { redirect_to [:admin, @site] }\n format.json { head :no_content }\n end\n end",
"def destroy\n @content_manager = BigCms::ContentManager.find(params[:id])\n @content_manager.destroy\n\n respond_to do |format|\n format.html { redirect_to(big_cms_content_managers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @content_condo = ContentCondo.find(params[:id])\n @content_condo.destroy\n\n respond_to do |format|\n format.html { redirect_to content_condos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site_admin.destroy\n respond_to do |format|\n format.html { redirect_to site_admins_url, notice: 'Site admin was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n Break.end\n respond_to do |format|\n format.html { redirect_to admin_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sys_check = SysCheck.find(params[:id])\n @sys_check.destroy\n\n respond_to do |format|\n format.html { redirect_to sys_checks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @storage = @client.storages.find(params[:id])\n @storage.destroy\n\n respond_to do |format|\n format.html { redirect_to client_url(@client) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @my_studio_client = MyStudio::Client.find(params[:id])\n @my_studio_client.destroy\n\n respond_to do |format|\n format.html { redirect_to my_studio_clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @seguidore = Seguidore.find(params[:id])\n @seguidore.destroy\n\n respond_to do |format|\n format.html { redirect_to seguidores_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @sistema = Sistema.find(params[:id])\n @sistema.destroy\n\n respond_to do |format|\n format.html { redirect_to sistemas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site = Site.find(id_from_params)\n\n respond_to do |format|\n if current_user.account.sites.delete(@site)\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end\n end",
"def delete(options={})\n connection.delete(\"/\", @name)\n end",
"def destroy\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_site_structure.destroy\n respond_to do |format|\n format.html { redirect_to admin_site_structures_url, notice: 'Site structure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin = Admin.find(params[:id])\n @admin.destroy\n\n respond_to do |format|\n format.html { redirect_to admins_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @identity.destroy\n\n head :no_content\n end",
"def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n @ministorage.destroy\n respond_to do |format|\n format.html { redirect_to admin_ministorages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @news.destroy\n respond_to do |format|\n format.html { redirect_to admin_news_index_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin.destroy\n respond_to do |format|\n format.html { redirect_to admins_sys_admins_url }\n format.json { render json: { status: 200 } }\n end\n end",
"def destroy\n @anatomic_site.destroy\n respond_to do |format|\n format.html { redirect_to anatomic_sites_url, notice: 'Anatomic site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_item.destroy\n render json: {message: 'deletado com sucesso'}\n end",
"def delete(path)\n\t\trequest(path, :delete)\n\tend",
"def destroy\n @cms_page_section.destroy\n respond_to do |format|\n format.html { redirect_to cms_page_sections_url, notice: 'Page section was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete!\n request! :delete\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end"
] |
[
"0.6961133",
"0.6807306",
"0.67606527",
"0.671734",
"0.66927934",
"0.66713095",
"0.6598289",
"0.65765536",
"0.6546038",
"0.65314114",
"0.65314114",
"0.65314114",
"0.65314114",
"0.6528346",
"0.6521348",
"0.6506641",
"0.65030587",
"0.64994496",
"0.6493587",
"0.6491942",
"0.6472556",
"0.6464697",
"0.64553154",
"0.64499027",
"0.64499027",
"0.64499027",
"0.64433944",
"0.6440909",
"0.64371854",
"0.64286536",
"0.64252514",
"0.64189136",
"0.6418659",
"0.6406853",
"0.6397023",
"0.6395643",
"0.63847464",
"0.6384428",
"0.63838285",
"0.63763446",
"0.6375827",
"0.63745683",
"0.6373655",
"0.6369385",
"0.6367987",
"0.6361827",
"0.6353323",
"0.63457394",
"0.6340469",
"0.63339317",
"0.63302416",
"0.6321609",
"0.6321102",
"0.63206214",
"0.631422",
"0.6310592",
"0.63084245",
"0.6303343",
"0.63024235",
"0.63014024",
"0.6301092",
"0.62964803",
"0.62928206",
"0.6292271",
"0.62901324",
"0.6289465",
"0.62871486",
"0.6285395",
"0.6285044",
"0.62825495",
"0.628238",
"0.6279366",
"0.6279302",
"0.6276661",
"0.6275754",
"0.62714416",
"0.62706876",
"0.62705976",
"0.6268712",
"0.62666434",
"0.6264352",
"0.62594366",
"0.6258901",
"0.625867",
"0.62574965",
"0.6255885",
"0.6255885",
"0.6255885",
"0.6255885",
"0.6255885",
"0.6254442",
"0.6253757",
"0.6251776",
"0.6251015",
"0.62467974",
"0.6246237",
"0.62450916",
"0.6242219",
"0.6240237",
"0.6240237"
] |
0.6756537
|
3
|
Use callbacks to share common setup or constraints between actions.
|
def set_logincm
@logincm = Logincm.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_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"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.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def logincm_params
params.require(:logincm).permit(:content)
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 end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"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.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
GET /consultationcharges/1 GET /consultationcharges/1.xml
|
def show
@consultationcharge = Consultationcharge.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @consultationcharge }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @diabetes_consultation = DiabetesConsultation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @diabetes_consultation }\n end\n end",
"def show\n @consultation = Consultation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @consultation }\n end\n end",
"def show\n @pfs_consultation = PfsConsultation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pfs_consultation }\n end\n end",
"def index\n @title=\"Listing Discharges\"\n @discharges = Discharge.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @discharges }\n end\n end",
"def show\n vc = VariableCharge.find_all_by_reservation_id(params[:id])\n @taxes = Taxrate.active\n @variable_charges = vc.paginate :page => params[:page], :per_page => @option.disp_rows\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @variable_charge }\n end\n end",
"def show\n @referral_charge = ReferralCharge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @referral_charge }\n end\n end",
"def show\n @title='Show Discharges'\n @discharge = Discharge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @discharge }\n end\n end",
"def show\n @charge_transaction = ChargeTransaction.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @charge_transaction.to_xml }\n end\n end",
"def new\n @consultationcharge = Consultationcharge.new\n @doctormasters = Doctormaster.find(:all)\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consultationcharge }\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @consulta }\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @consulta }\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @consulta }\n end\n end",
"def show\n @bank_reconciliations = AccountingBankReconciliations.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bank_reconciliations }\n end\n end",
"def show\n @services_charger = ServicesCharger.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @services_charger }\n end\n end",
"def new\n @consultation = Consultation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consultation }\n end\n end",
"def new\n @pfs_consultation = PfsConsultation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pfs_consultation }\n end\n end",
"def new\n @diabetes_consultation = DiabetesConsultation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @diabetes_consultation }\n end\n end",
"def show\n @contract_cost = ContractCost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @contract_cost }\n end\n end",
"def show\n @daily_grr = DailyGrr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @daily_grr }\n end\n end",
"def show\n @dbs_deposit = DbsDeposit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @dbs_deposit }\n end\n end",
"def show\n @concert = Concert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @concert }\n end\n end",
"def show\n @reconciliation_detail = AccountingReconciliationDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @reconciliation_detail }\n end\n end",
"def show\n @donation = Donation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @donation }\n end\n end",
"def show\n @renewal = Renewal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @renewal }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cost_center }\n end\n end",
"def show\n @cost = Cost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cost }\n end\n\n end",
"def show\n @derivative = Derivative.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @derivative }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @fund_request }\n end\n end",
"def show\n @respuestum = Respuestum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @respuestum }\n end\n end",
"def show\n @donation_request = DonationRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @donation_request }\n end\n end",
"def show\n @ward_cost = WardCost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ward_cost }\n end\n end",
"def show\n @transferencia_contas_detalhe = TransferenciaContasDetalhe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @transferencia_contas_detalhe }\n end\n end",
"def index\n\t\t@charges = Charge.all\n\tend",
"def show\n @warranty = Warranty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @warranty }\n end\n end",
"def show\n @discount = Discount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @discount }\n end\n end",
"def show\n @recommand = Recommand.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @recommand }\n end\n end",
"def new\n @referral_charge = ReferralCharge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @referral_charge }\n end\n end",
"def retrieve(params = {})\n req = WebPay::ChargeIdRequest.create(params)\n raw_response = @client._request(:get, 'charges' + '/' + req.id.to_s, req)\n WebPay::ChargeResponse.new(raw_response)\n end",
"def new\n @title='Discharge patient'\n @discharge = Discharge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @discharge }\n end\n end",
"def show\n @calification = Calification.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @calification }\n end\n end",
"def index\n @charges = Charge.all\n end",
"def show\n @depositocaucion = Depositocaucion.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @depositocaucion }\n end\n end",
"def show\n @costing = Costing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @costing }\n end\n end",
"def show\n @congressman = Congressman.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @congressman }\n end\n end",
"def show\n @diaper_change = DiaperChange.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @diaper_change }\n end\n end",
"def show\n @dosage = Dosage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @dosage }\n end\n end",
"def show\n @feria2010observacion = Feria2010observacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feria2010observacion }\n end\n end",
"def show\n @religion = Religion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @religion }\n end\n end",
"def charges(company_number, items_per_page = nil, start_index = nil)\n params = {}\n if items_per_page\n params[:items_per_page] = items_per_page\n end\n if start_index\n params[:start_index] = start_index\n end\n client.get(\"company/#{company_number}/charges/\", params)\n end",
"def show\n @payments_ach = PaymentsAch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @payments_ach }\n end\n end",
"def show\n @fixed_deposit = FixedDeposit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @fixed_deposit }\n end\n end",
"def show\n @ref = Ref.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ref }\n end\n end",
"def index\n @feria2010beneficiarios = Feria2010beneficiario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @feria2010beneficiarios }\n end\n end",
"def show\n @rede = Rede.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rede }\n end\n end",
"def show\n @visarequest = Visarequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @visarequest }\n end\n end",
"def show\n @accident_vehicle_expense = AccidentVehicleExpense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @accident_vehicle_expense }\n end\n end",
"def index\n @dosages = @drug.dosages\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @dosages }\n end\n end",
"def by_saison\n @saison = Saison.find_by_year(params[:id])\n respond_to do |format|\n format.xml\n end\n end",
"def show\n @regroupement = Regroupement.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @regroupement.to_xml }\n end\n end",
"def index\n @project_costs = ProjectCost.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @project_costs }\n end\n end",
"def show\n @goods_cost = GoodsCost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @goods_cost }\n end\n end",
"def show\n @adicional_desconto = AdicionalDesconto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @adicional_desconto }\n end\n end",
"def show\n @supplier_payment = SupplierPayment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @supplier_payment }\n end\n end",
"def show\n @deposit_threshold = DepositThreshold.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @deposit_threshold }\n end\n end",
"def show\n @feria2010beneficiario = Feria2010beneficiario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feria2010beneficiario }\n end\n end",
"def show\n @labor_cost_line = LaborCostLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @labor_cost_line }\n end\n end",
"def show\n @desasignado = Desasignado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @desasignado }\n end\n end",
"def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @expense.to_xml }\n end\n end",
"def destroy\n @consultationcharge = Consultationcharge.find(params[:id])\n @consultationcharge.destroy\n\n respond_to do |format|\n format.html { redirect_to(consultationcharges_url) }\n format.xml { head :ok }\n end\n end",
"def index\n @fixed_deposits = FixedDeposit.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @fixed_deposits }\n end\n end",
"def show\n @direccion = Direccion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @direccion }\n end\n end",
"def show\n @revenu = @foyer.revenus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @revenu }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @recurring }\n end\n end",
"def index\n @personals = Personal.all\n\n cadena = getpersonals(@personals)\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => cadena }\n end\n end",
"def new\n @consulta = Consulta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consulta }\n end\n end",
"def new\n @consulta = Consulta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consulta }\n end\n end",
"def index\n @revenus = @foyer.revenus\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @revenus }\n end\n end",
"def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @requisition }\n end\n end",
"def show\n @agenciamadre = Agenciamadre.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @agenciamadre }\n end\n end",
"def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @expense }\n end\n end",
"def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @expense }\n end\n end",
"def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @expense }\n end\n end",
"def index\n @commission_days = CommissionDay.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @commission_days }\n end\n end",
"def show\n @consultant = Consultant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consultant }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @calibration }\n end\n end",
"def show\n @customer_payment = CustomerPayment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @customer_payment }\n end\n end",
"def show\n @dial_result = DialResult.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @dial_result }\n end\n end",
"def show\n @contract = Contract.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @contract }\n end\n end",
"def show\n @contract = Contract.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @contract }\n end\n end",
"def get_consulta\n @consulta = Consulta.find(params[:consulta_id])\n end",
"def show\n @fee_std = FeeStd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @fee_std }\n end\n end",
"def show\n @payment = Payment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @payment }\n end\n end",
"def show\n @payment = Payment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @payment }\n end\n end",
"def show\n @gtfs_agency = GtfsAgency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @gtfs_agency }\n end\n end",
"def index\n @cuentas = Cuenta.all\n\n @cadena = getcuentasxml\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @cadena }\n end\n end",
"def show\n @debt = Debt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @debt }\n end\n end",
"def index\n @charges = Charge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @charges }\n end\n end",
"def index\n @payment_informations = PaymentInformation.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @payment_informations }\n end\n end",
"def index\n @feria2010observaciones = Feria2010observacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @feria2010observaciones }\n end\n end",
"def show\n @patient_vaccination = PatientVaccination.find(params[:id]) \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @patient_vaccination }\n end\n end"
] |
[
"0.67220753",
"0.671936",
"0.6691476",
"0.6628015",
"0.6534748",
"0.6488349",
"0.64504176",
"0.6445887",
"0.62742025",
"0.6259485",
"0.6259485",
"0.6259485",
"0.6177886",
"0.6176701",
"0.61440873",
"0.61200315",
"0.61176187",
"0.6111644",
"0.61042196",
"0.6098044",
"0.6094731",
"0.6051944",
"0.60417753",
"0.603613",
"0.6035934",
"0.6027863",
"0.6022634",
"0.6014268",
"0.60088867",
"0.5988488",
"0.5970765",
"0.5957734",
"0.59382886",
"0.5938278",
"0.59285086",
"0.59262323",
"0.59253424",
"0.5916154",
"0.5913856",
"0.5902297",
"0.5896748",
"0.5893095",
"0.58898073",
"0.5880371",
"0.5880025",
"0.5879022",
"0.5869608",
"0.5868577",
"0.5864932",
"0.5859951",
"0.5858485",
"0.58554226",
"0.5855133",
"0.5853772",
"0.5849209",
"0.58482957",
"0.58448166",
"0.5843736",
"0.58420396",
"0.58406925",
"0.5833216",
"0.58324975",
"0.58266675",
"0.5823632",
"0.5816823",
"0.58112615",
"0.5807321",
"0.58042365",
"0.58027303",
"0.57958937",
"0.5792476",
"0.57890606",
"0.57886463",
"0.5787312",
"0.5786745",
"0.5786745",
"0.5786149",
"0.578119",
"0.5780351",
"0.57777005",
"0.57777005",
"0.57777005",
"0.57757026",
"0.5773122",
"0.5770311",
"0.57638454",
"0.5763633",
"0.57586825",
"0.57586825",
"0.5753444",
"0.5752651",
"0.575041",
"0.575041",
"0.5747363",
"0.57462466",
"0.5745938",
"0.5744617",
"0.5744585",
"0.57412565",
"0.5737768"
] |
0.7296233
|
0
|
GET /consultationcharges/new GET /consultationcharges/new.xml
|
def new
@consultationcharge = Consultationcharge.new
@doctormasters = Doctormaster.find(:all)
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @consultationcharge }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @consultation = Consultation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consultation }\n end\n end",
"def new\n @pfs_consultation = PfsConsultation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pfs_consultation }\n end\n end",
"def new\n @diabetes_consultation = DiabetesConsultation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @diabetes_consultation }\n end\n end",
"def new\n @variable_charge = VariableCharge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @variable_charge }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fund_request }\n end\n end",
"def new\n @consulta = Consulta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consulta }\n end\n end",
"def new\n @consulta = Consulta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consulta }\n end\n end",
"def new\n @title='Discharge patient'\n @discharge = Discharge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @discharge }\n end\n end",
"def new\n @renewal = Renewal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @renewal }\n end\n end",
"def new\n @referral_charge = ReferralCharge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @referral_charge }\n end\n end",
"def new\n @patron = Patron.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @patron }\n end\n end",
"def new\n @fixed_deposit = FixedDeposit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fixed_deposit }\n end\n end",
"def new\n @fundation = Fundation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fundation }\n end\n end",
"def new\n @dbs_deposit = DbsDeposit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dbs_deposit }\n end\n end",
"def new\n @costing = Costing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @costing }\n end\n end",
"def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end",
"def new\n @depositocaucion = Depositocaucion.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @depositocaucion }\n end\n end",
"def new\n @ref = Ref.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ref }\n end\n end",
"def create\n @consultationcharge = Consultationcharge.new(params[:consultationcharge])\n\n respond_to do |format|\n if @consultationcharge.save\n format.html { redirect_to(@consultationcharge, :notice => 'Consultationcharge was successfully created.') }\n format.xml { render :xml => @consultationcharge, :status => :created, :location => @consultationcharge }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @consultationcharge.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @deposit_threshold = DepositThreshold.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @deposit_threshold }\n end\n end",
"def new\n @calification = Calification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @calification }\n end\n end",
"def new\n @services_charger = ServicesCharger.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @services_charger }\n end\n end",
"def new\n @donation_request = DonationRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @donation_request }\n end\n end",
"def new\n\t\tPesqSecDep()\n\t\t@cliente = Cliente.new\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml {render :xml => @cliente}\n\t\tend\n\tend",
"def new\n @derivative = Derivative.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @derivative }\n end\n end",
"def new\n \n @donation = Donation.new(:transaction_id => params[:transaction_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @donation }\n end\n end",
"def new_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end",
"def new\n @payment = Payment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @payment }\n end\n end",
"def new\n @dossier = Dossier.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dossier }\n end\n end",
"def new\n @contract = Contract.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contract }\n end\n end",
"def new\n @contract = Contract.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contract }\n end\n end",
"def new\n @balance = Balance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @balance }\n end\n end",
"def new\n @provision = Provision.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provision }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @vip_programmer_certification }\n end\n end",
"def new\n @visarequest = Visarequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @visarequest }\n end\n end",
"def new\n @consulta = Consulta.nueva(params)\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consulta }\n end\n end",
"def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recurso }\n end\n end",
"def new_rest\n @entry_instrument = EntryInstrument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_instrument }\n end\n end",
"def new\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end",
"def new\n @discount = Discount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @discount }\n end\n end",
"def new\n @loan = Loan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @loan }\n end\n end",
"def new\n @convenio = Convenio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @convenio }\n end\n end",
"def new\n @amount = Amount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @amount }\n end\n end",
"def new\n @congressman = Congressman.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @congressman }\n end\n end",
"def new\n @expense = Expense.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @expense }\n end\n end",
"def new\n @expense = Expense.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @expense }\n end\n end",
"def new\n @cost_type = CostType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cost_type }\n end\n end",
"def new\n @diaper_change = DiaperChange.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @diaper_change }\n end\n end",
"def new\n @transferencia_contas_detalhe = TransferenciaContasDetalhe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @transferencia_contas_detalhe }\n end\n end",
"def new\n @incentive = Incentive.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @incentive }\n end\n end",
"def new\n @reconciliation_detail = AccountingReconciliationDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reconciliation_detail }\n end\n end",
"def new\n @ward_cost = WardCost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ward_cost }\n end\n end",
"def new\n @lease = Lease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lease }\n end\n end",
"def new\n @commission_day = CommissionDay.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @commission_day }\n end\n end",
"def new\n @feria2010observacion = Feria2010observacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feria2010observacion }\n end\n end",
"def new\n @prd_etc = PrdEtc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prd_etc }\n end\n end",
"def new\n @progre = Progre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @progre }\n end\n end",
"def new\n @resource_allocation = ResourceAllocation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource_allocation }\n end\n end",
"def new_rest\n @item_usage = ItemUsage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item_usage }\n end\n end",
"def new\n @daily_grr = DailyGrr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @daily_grr }\n end\n end",
"def new\n @shipping_cost = ShippingCost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @shipping_cost }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n @contribution = Contribution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contribution }\n end\n end",
"def new\n @contribution = Contribution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contribution }\n end\n end",
"def new\n @ponto = Ponto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ponto }\n end\n end",
"def new\n @periode = Periode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @periode }\n end\n end",
"def new\n @goods_cost = GoodsCost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @goods_cost }\n end\n end",
"def new\n @payment_information = PaymentInformation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @payment_information }\n end\n end",
"def new\n @fee_record = FeeRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fee_record }\n end\n end",
"def new\n @requisition = Requisition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @requisition }\n end\n end",
"def new\n @fixed_expense = FixedExpense.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fixed_expense }\n end\n end",
"def new\n @capitalrecovery = Capitalrecovery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @capitalrecovery }\n end\n end",
"def new\n @charge = Charge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @charge }\n end\n end",
"def new\n @cost = Cost.new(:date => params[:date],\n :user_id => current_user.id)\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cost }\n end\n end",
"def new\n @users = User.find(:all)\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end",
"def new\n @lookup_demographicrelativerelationship = LookupDemographicrelativerelationship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_demographicrelativerelationship }\n end\n end",
"def new\n @domino = Domino.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @domino }\n end\n end",
"def new\n @deposit_template = DepositTemplate.new(:user => current_user)\n @deposit_template.init_all_fund_percentages\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @deposit_template }\n end\n end",
"def new\n @shipment = Shipment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @shipment }\n end\n end",
"def new\n @nota_fiscal = NotaFiscal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota_fiscal }\n end\n end",
"def new\n @nota_fiscal = NotaFiscal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota_fiscal }\n end\n end",
"def new\n @plantilla = Plantilla.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @plantilla }\n end\n end",
"def new\n @bill = Bill.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bill }\n end\n end",
"def new\n logger.debug 'new_some interesting information'\n @comdty = Comdty.new\n setvariables\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @comdty }\n end\n end",
"def new\n @planodepagamento = Planodepagamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @planodepagamento }\n end\n end",
"def new\n @regiment = Regiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @regiment }\n end\n end",
"def new\n @shipping_fee = ShippingFee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @shipping_fee }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @franchise }\n end\n end",
"def new\n @pagare = Pagare.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pagare }\n end\n end",
"def new\n @ingredience = Ingredience.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ingredience }\n end\n end",
"def new\n @rede = Rede.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rede }\n end\n end",
"def new\n @pay_period = PayPeriod.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pay_period }\n end\n end",
"def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @withdrawal = Withdrawal.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @withdrawal }\n end\n end",
"def new\n @scan_procedure = ScanProcedure.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @scan_procedure }\n end\n end",
"def new\n @correspondenciasasignada = Correspondenciasasignada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @correspondenciasasignada }\n end\n end",
"def new\n @receita = Receita.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @receita }\n end\n end",
"def new\n @docent = Docent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @docent }\n end\n end",
"def new\n @cost_center = CostCenter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cost_center }\n end\n end",
"def new\n @pdig = Pdig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pdig }\n end\n end"
] |
[
"0.7425562",
"0.7412985",
"0.7143969",
"0.7136843",
"0.713356",
"0.70367885",
"0.70367885",
"0.70361596",
"0.7020366",
"0.7018939",
"0.70175475",
"0.6998301",
"0.69875675",
"0.6929025",
"0.6909028",
"0.6881998",
"0.6880217",
"0.68776387",
"0.68712234",
"0.6860995",
"0.6858003",
"0.68523246",
"0.68504375",
"0.6848411",
"0.68457615",
"0.68369853",
"0.68327355",
"0.6831564",
"0.68081534",
"0.68056184",
"0.68056184",
"0.680079",
"0.67988265",
"0.6790892",
"0.67892385",
"0.67824006",
"0.677999",
"0.6762923",
"0.6762256",
"0.67544776",
"0.6748525",
"0.67439944",
"0.6739342",
"0.6735771",
"0.6734453",
"0.6734453",
"0.6731593",
"0.6720279",
"0.67179275",
"0.67168355",
"0.67145705",
"0.67093575",
"0.6708553",
"0.6703845",
"0.6698244",
"0.66969544",
"0.66940093",
"0.6690245",
"0.6686593",
"0.6685685",
"0.66849184",
"0.66840965",
"0.6682436",
"0.6682436",
"0.6680598",
"0.6680498",
"0.66764516",
"0.6676166",
"0.66736597",
"0.6671935",
"0.66716444",
"0.66623074",
"0.6661221",
"0.6661178",
"0.6657087",
"0.6651207",
"0.664969",
"0.6648372",
"0.6647749",
"0.66416365",
"0.66416365",
"0.66404635",
"0.6636856",
"0.6635571",
"0.66345733",
"0.6634464",
"0.6628023",
"0.66274023",
"0.66268504",
"0.6625608",
"0.6624771",
"0.66226625",
"0.6617316",
"0.6615252",
"0.6613378",
"0.661311",
"0.66125125",
"0.6610385",
"0.66101074",
"0.66038495"
] |
0.7220086
|
2
|
POST /consultationcharges POST /consultationcharges.xml
|
def create
@consultationcharge = Consultationcharge.new(params[:consultationcharge])
respond_to do |format|
if @consultationcharge.save
format.html { redirect_to(@consultationcharge, :notice => 'Consultationcharge was successfully created.') }
format.xml { render :xml => @consultationcharge, :status => :created, :location => @consultationcharge }
else
format.html { render :action => "new" }
format.xml { render :xml => @consultationcharge.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def charge(attrs = {})\n post :charges, {}, attrs.to_xml(:root => :charge)\n end",
"def create\n @consultation = Consultation.new(params[:consultation])\n\n respond_to do |format|\n if @consultation.save\n format.html { redirect_to(@consultation, :notice => t(\"flash.notices.model.consultation.created\")) }\n format.xml { render :xml => @consultation, :status => :created, :location => @consultation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @consultation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @pfs_consultation = PfsConsultation.new(params[:pfs_consultation])\n\n respond_to do |format|\n if @pfs_consultation.save\n format.html { redirect_to(@pfs_consultation, :notice => 'Pfs consultation was successfully created.') }\n format.xml { render :xml => @pfs_consultation, :status => :created, :location => @pfs_consultation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @pfs_consultation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @discharge = Discharge.new(params[:discharge])\n\n respond_to do |format|\n if @discharge.save\n flash[:notice] = 'Discharge was successfully created.'\n format.html { redirect_to(@discharge) }\n format.xml { render :xml => @discharge, :status => :created, :location => @discharge }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @discharge.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @consultation = current_user.consultations.new(consultation_params)\n\n respond_to do |format|\n if @consultation.save\n format.html { redirect_to @consultation, notice: 'Consulta criada com sucesso.' }\n format.json { render :show, status: :created, location: @consultation }\n else\n format.html { render :new }\n format.json { render json: @consultation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gnc_charge = GncCharge.new(gnc_charge_params)\n\n respond_to do |format|\n if @gnc_charge.save\n format.html { redirect_to @gnc_charge, notice: \"Gnc charge was successfully created.\" }\n format.json { render :show, status: :created, location: @gnc_charge }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @gnc_charge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @diabetes_consultation = DiabetesConsultation.new(params[:diabetes_consultation])\n\n respond_to do |format|\n if @diabetes_consultation.save\n format.html { redirect_to(@diabetes_consultation, :notice => 'Diabetes consultation was successfully created.') }\n format.xml { render :xml => @diabetes_consultation, :status => :created, :location => @diabetes_consultation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @diabetes_consultation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def consultation_params\n params.require(:consultation).permit(:description, :dates, :consultants, :minutes, :consultation_category_id, :ccrc_id)\n end",
"def post\n begin\n charge = Stripe::Charge.create({\n amount: params[:amount],\n currency: 'sgd',\n customer: params[:customer_id],\n source: params[:card_id]\n })\n\n json_response(charge, :created)\n\n rescue Stripe::InvalidRequestError => exception\n response = Hash.new\n response[:error] = exception.message\n\n json_response(response, :bad_request)\n end\n end",
"def create\n @patient_charge = PatientCharge.new(params[:patient_charge])\n @patient = Patient.find params[:patient_charge][:patient_id]\n @patient_charge.amount = @patient.cost\n @patient_charge.liquidated = \"no\"\n @patient_charge.date = Time.now\n @patient_charge.patient_id = @patient.id\n\n respond_to do |format|\n if @patient_charge.save\n format.html { redirect_to people_charges_path(@patient_charge.patient.person), notice: 'Cargo de Sesion Guardado Correctamente' }\n format.json { render json: @patient_charge, status: :created, location: @patient_charge }\n else\n format.html { redirect_to people_charges_path(@patient_charge.patient.person), notice: 'No se guardo cargo!' }\n format.json { render json: @patient_charge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @donation_form = DonationForm.new(donation_params)\n @product = Donation.find(donation_params[:donation_id])\n\n payment = PagSeguro::CreditCardTransactionRequest.new\n payment.notification_url = notifications_url\n # payment.notification_url = \"\"\n payment.payment_mode = \"default\"\n\n # Aqui vão os itens que serão cobrados na transação, caso você tenha multiplos itens\n # em um carrinho altere aqui para incluir sua lista de itens\n payment.items << {\n id: @product.id,\n description: @product.description,\n amount: @product.price,\n weight: 0\n }\n\n # Criando uma referencia para a nossa ORDER\n reference = \"REF_#{(0...8).map { (65 + rand(26)).chr }.join}_#{@product.id}\"\n payment.reference = reference\n payment.sender = {\n hash: donation_params[:sender_hash],\n name: donation_params[:name],\n email: donation_params[:email],\n cpf: donation_params[:cpf],\n document: { type: \"CPF\", value: donation_params[:cpf] },\n phone: {\n area_code: donation_params[:phone_code],\n number: donation_params[:phone_number]\n }\n }\n\n shipping_address = {\n type_name: ENV['DEV_SHIPPING_TYPE'],\n address: {\n street: ENV['DEV_SHIPPING_STREET'],\n number: ENV['DEV_SHIPPING_NUMBER'],\n complement: ENV['DEV_SHIPPING_COMPLEMENT'],\n city: ENV['DEV_SHIPPING_CITY'],\n state: ENV['DEV_SHIPPING_STATE'],\n district: ENV['DEV_SHIPPING_DISTRICT'],\n postal_code: ENV['DEV_SHIPPING_POSTAL_CODE']\n }\n }\n\n payment.shipping = shipping_address\n payment.billing_address = shipping_address[:address]\n\n payment.credit_card_token = donation_params[:card_token]\n payment.holder = {\n name: donation_params[:card_name],\n birth_date: donation_params[:birthday],\n document: {\n type: \"CPF\",\n value: donation_params[:cpf]\n },\n phone: {\n area_code: donation_params[:phone_code],\n number: donation_params[:phone_number]\n }\n }\n\n payment.installment = {\n value: donation_params[:card_installment_value],\n quantity: donation_params[:card_options].to_i\n }\n\n # payment.extra_params << { shippingAddressRequired: 'false' }\n\n puts \"=> REQUEST\"\n puts PagSeguro::TransactionRequest::RequestSerializer.new(payment).to_params\n puts\n\n payment.create\n\n # Cria uma Order para registro das transações\n if @donation_form.valid? && payment.errors.empty?\n Order.create(donation_id: @product.id, buyer_name: donation_params[:name], reference: reference, status: 'pending')\n\n redirect_to wedding_supports_path,\n flash: { notice: 'Obrigado. Sua doação foi realizada com sucesso!' }\n else\n @donation_form.payment_errors = payment.errors\n puts \"Payment Errors:\"\n puts payment.errors.join(\"\\n\")\n puts @donation_form.errors.messages\n @donation = @product\n @session_id = (PagSeguro::Session.create).id\n render :new and return\n end\n end",
"def create\n\n @recharge = Recharge.recharge_by_credit_card(user: current_user, recharge: recharge_params)\n\n respond_to do |format|\n if @recharge.save\n\n # create recharge\n receipt = Receipt.create({user_id: @recharge.user.id, agent_id: @recharge.agent.id, amount: @recharge.amount, ip_address: request.remote_ip})\n receipt.save\n\n format.html { redirect_to @recharge, notice: 'Recharge was successfully created.' }\n else\n format.html { render action: 'new' }\n end\n end\n end",
"def new\n @consultationcharge = Consultationcharge.new\n @doctormasters = Doctormaster.find(:all)\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consultationcharge }\n end\n end",
"def create\n @consultum = Consultum.new(consultum_params)\n\n respond_to do |format|\n if @consultum.save\n format.html { redirect_to @consultum, notice: 'Sua solicitação foi realizada com sucesso. Entraremos em coontato por email.' }\n # format.json { render :show, status: :created, location: @consultum }\n else\n format.html { render :new }\n format.json { render json: @consultum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @charge_transaction = ChargeTransaction.new(params[:charge_transaction])\n if params[:transaction]\n # they used the form on main/index\n t = params[:transaction]\n \n @charge_transaction.description = t[:description]\n \n amount = Money.new(t[:amount].to_f * 100)\n t[:other_people].each do |p|\n other = Housemate.find p\n charge = Charge.new\n if t[:is_creditor] == '0'\n charge.debtor = current_housemate\n charge.creditor = other\n elsif t[:is_creditor] == '1'\n charge.creditor = current_housemate\n charge.debtor = other\n else\n flash[:error_messages] = [\"You must select who paid in the transaction.\"]\n return redirect_to(:controller => :main, :action => :index)\n end\n \n charge.amount = amount / (t[:other_people].length)\n charge.save\n @charge_transaction.charges.push charge\n end\n \n @charge_transaction.save\n end\n\n respond_to do |format|\n if @charge_transaction.save\n flash[:notice] = 'ChargeTransaction was successfully created.'\n format.html { redirect_to :controller => \"main\", :action => \"index\" }\n format.xml { head :created, :location => charge_transaction_url(@charge_transaction) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @charge_transaction.errors.to_xml }\n end\n end\n end",
"def destroy\n @consultationcharge = Consultationcharge.find(params[:id])\n @consultationcharge.destroy\n\n respond_to do |format|\n format.html { redirect_to(consultationcharges_url) }\n format.xml { head :ok }\n end\n end",
"def recharge_params\n params.require(:recharge).permit(:user_id, :agent_id, :last4, :card_type, :paid, :amount, :currency, :refunded, :fee, :captured, :failure_message, :failure_code, :amount_refunded, :customer, :invoice, :description, :dispute, :number, :card_name, :exp_month, :exp_year, :cvc)\n end",
"def create\n @consultum = Consultum.new(params[:consultum])\n\n respond_to do |format|\n if @consultum.save\n format.html { redirect_to @consultum, notice: 'Consultum was successfully created.' }\n format.json { render json: @consultum, status: :created, location: @consultum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @consultum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def sendclaim\n require 'net/http'\n require 'uri'\n\n @visit = Visit.find(params[:id])\n @patient = Patient.find(@visit.patient_id)\n @patient.fname = @patient.full_sex unless @patient.fname.present?\n @doctor = Doctor.find(@visit.doc_id)\n @xml = render_to_string \"show.xml\"\n\n uri = URI.parse(CABMDURL)\n http= Net::HTTP.new(uri.host,uri.port)\n http.use_ssl = true\n \n req = Net::HTTP::Post.new(uri.request_uri, {'Content-Type' => 'application/xml'})\n req.body = @xml\n\n res = http.request(req)\n @xmlhash = JSON.parse(res.body)\n# {\"success\"=>true, \"errors\"=>[], \"messages\"=>[], \"reference_id\"=>\"332933\", \"accounting_number\"=>\"0004MZ4Z\"}\n \n if @xmlhash['success'] \n\t acc_num = @xmlhash['accounting_number']\n flash[:info] = \"Claim #{acc_num} sent to cab.md \" \n @visit.update_attribute(:status, BILLED)\n @visit.update_attribute(:billing_ref, acc_num)\n else\n\t errors = @xmlhash['errors']\n\t messages = @xmlhash['messages']\n\t flash[:danger] = \"Error sending claim : #{@xmlhash}\"\n @visit.update_attribute(:status, READY)\n\t @visit.update_attribute(:billing_ref, errors.join(',')) if errors.present?\n end\n\n respond_to(:html)\n redirect_to patient_visit_path\n end",
"def create\n @accommodation_charge = AccommodationCharge.new(accommodation_charge_params)\n\n respond_to do |format|\n if @accommodation_charge.save\n format.html { redirect_to @accommodation_charge, notice: 'Accommodation charge was successfully created.' }\n format.json { render action: 'show', status: :created, location: @accommodation_charge }\n else\n format.html { render action: 'new' }\n format.json { render json: @accommodation_charge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @charge = Charge.new\n respond_to do |format|\n if @charge.save\n format.html { redirect_to @charge, notice: 'Charge was successfully created.' }\n format.json { render :show, status: :created, location: @charge }\n else\n format.html { render :new }\n format.json { render json: @charge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @pfs_consultation = PfsConsultation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pfs_consultation }\n end\n end",
"def create\n @organization_charge = OrganizationCharge.new(organization_charge_params)\n\n respond_to do |format|\n if @organization_charge.save\n format.html { redirect_to @organization_charge, notice: 'Organization charge was successfully created.' }\n format.json { render :show, status: :created, location: @organization_charge }\n else\n format.html { render :new }\n format.json { render json: @organization_charge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @charge = Charge.new(params[:charge])\n @charge.charged_at = Date.today\n\n respond_to do |format|\n if @charge.save\n format.html { redirect_to @charge, notice: 'Charge was successfully created.' }\n format.json { render json: @charge, status: :created, location: @charge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @charge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def discharge_params\n params.require(:discharge).permit(:discharge_date,:final_diagnoses,:visit_id,:reason_for_addmission)\n end",
"def charge_params\n params.require(:charge).permit(:amount, :charged_id, :charged_type, :is_registration_fee, :is_donation, :stripeEmail, :stripeToken, :email)\n end",
"def create\n p \"*\" * 50\n p params\n p \"*\" * 50\n @consulta = @paciente.consultas.new(consulta_params)\n\n respond_to do |format|\n if @consulta.save\n format.html { redirect_to pacientes_path, notice: 'Consulta foi criado com sucesso.' }\n format.json { render :show, status: :created, location: @paciente_consultas }\n else\n format.html { render :new }\n format.json { render json: @paciente_consultas.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @referral_charge = ReferralCharge.new(params[:referral_charge])\n\n respond_to do |format|\n if @referral_charge.save\n format.html { redirect_to(@referral_charge, :notice => 'ReferralCharge was successfully created.') }\n format.xml { render :xml => @referral_charge, :status => :created, :location => @referral_charge }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @referral_charge.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @final_bill = FinalBill.new\n\t#Get the org_code and org_location in people table based on user id.\n\t@session_id=session[:id]\n\t@session = Session.find(session[:id])\n\t@person = Person.find(@session.person_id)\n\t@org_code=@person.org_code\n\t@org_location=@person.org_location\n\t10.times{ @final_bill.final_charges.build }\n\t\n\t@charge=ChargeMaster.all(:conditions => \"service_group='GeneralServices'\")\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @final_bill }\n end\n end",
"def create\n @variable_charge = VariableCharge.new(params[:variable_charge])\n\n respond_to do |format|\n if @variable_charge.save\n format.html { redirect_to(@variable_charge, :notice => 'VariableCharge was successfully created.') }\n format.xml { render :xml => @variable_charge, :status => :created, :location => @variable_charge }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @variable_charge.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n #Take amount from the right place\n\n if params[:amount_entry] == \"\"\n amount = params[:amount_select]\n else\n amount = params[:amount_entry]\n end\n\n #Charge Stripe fees to customer\n\n final_float = amount.to_i + (amount.to_i * 0.029) + 30\n final_amount = final_float.round\n\n @transaction = Transaction.new(user_id: current_user.id, event_id: params[:event_id], amount: final_amount, support: params[:support])\n\n #Create the charge with Stripe\n\n charge = Stripe::Charge.create({\n :amount => final_amount,\n :currency => \"usd\",\n :customer => get_stripe_customer_id,\n :description => \"Tally Contribution\",\n :application_fee => 100\n },\n Pac.find(params[:pac_id]).stripe_secret_key\n )\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"def charges_params\n \tparams.require(:charges).permit(\n \t\t:stripeToken,:stripeEmail,\n \t\t:stripeShippingName,:stripeShippingAddressLine1,:stripeShippingAddressLine2,:stripeShippingAddressZip,:stripeShippingAddressState,:stripeShippingAddressCity,:stripeShippingAddressCountry\n \t\t)\n end",
"def charge_params\n params.require(:charge).permit(:amount, :paid, :refunded, :customer_id, :amount_currency)\n end",
"def create\n @garantor = Garantor.new(garantor_params)\n\n respond_to do |format|\n if @garantor.save\n bank_acount = BankAccount.new\n bank_acount.date = DateTime.now\n bank_acount.balance = @garantor.value_tranfer\n bank_acount.save\n\n format.html { redirect_to @garantor, notice: 'Garantor was successfully created.' }\n format.json { render :show, status: :created, location: @garantor }\n else\n format.html { render :new }\n format.json { render json: @garantor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consulta = Consulta.new(params[:consulta])\n\n respond_to do |format|\n if @consulta.save\n format.html { redirect_to(@consulta, :notice => 'Consulta was successfully created.') }\n format.xml { render :xml => @consulta, :status => :created, :location => @consulta }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @consulta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\n params[:refill_type] = params[:refill_type].to_i\n params[:status] = params[:status].to_i\n params[:cost_basis] = params[:cost_basis].to_i\n params[:other_coverage_code] = params[:other_coverage_code].to_i\n params[:reason_for_delay] = params[:reason_for_delay].to_i\n params[:partial_fill_status] = params[:partial_fill_status].to_i\n params[:reported_to_pmp] = params[:reported_to_pmp].to_i\n\n @dispense = Dispense.new(dispense_params)\n\n respond_to do |format|\n if @dispense.save\n format.html { redirect_to @dispense, notice: 'Dispense was successfully created.' }\n format.json { render :show, status: :created, location: @dispense }\n else\n format.html { render :new }\n format.json { render json: @dispense.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_charge\n end",
"def create\n if @current_user.has_privilege?('charges', 'insert')\n @charge = Charge.new(params[:charge])\n if @charge.save\n redirect_to(charges_path, :notice => '新建收费项目成功.')\n else\n render :action => \"new\"\n\n end\n else\n flash[:notice] = \"你没有新建收费项目的权限,请联系管理员\"\n render_403\n end\n\n end",
"def fractionate\n # Set active_tab to use in view filters\n session[:active_tab] = \"pendings-tab\"\n\n # Params\n invoice_ids = params[:instalment][:invoices_ids].split(\",\")\n number_quotas = params[:instalment][:number_inst].to_i\n amount_first = params[:instalment][:amount_first].to_d\n charge = params[:instalment][:charge].to_d\n payment_method_id = params[:instalment][:payment_method_id]\n redirect_to client_payments_path + \"#tab_pendings\", alert: I18n.t(\"ag2_gest.client_payments.generate_error_payment\") and return if payment_method_id.blank?\n created_by = current_user.id if !current_user.nil?\n\n # Check that all invoices are from the same client\n clients = Client.joins(bills: :invoices).where('invoices.id IN (?)', invoice_ids).select('clients.id').group('clients.id').to_a\n if clients.count > 1\n redirect_to client_payments_path + \"#tab_pendings\", alert: \"Imposible aplazar facturas de varios clientes a la vez.\" and return\n end\n client_id = clients.first.id\n\n # Check that all invoices are from the same subscriber\n subscribers = Subscriber.joins(bills: :invoices).where('invoices.id IN (?)', invoice_ids).select('subscribers.id').group('subscribers.id').to_a\n subscriber_id = nil\n if subscribers.count == 1\n subscriber_id = subscribers.first.id if !subscribers.first.blank?\n end\n\n # Initialize invoices dataset\n invoices = Invoice.where(id: invoice_ids).joins(:bill, 'LEFT JOIN client_payments ON invoices.id=client_payments.invoice_id') \\\n .select('invoices.*, bills.client_id, bills.subscriber_id, COALESCE(sum(client_payments.amount),0) AS payments, invoices.receivables-COALESCE(sum(client_payments.amount),0) AS debts') \\\n .order('invoices.created_at') \\\n .group('invoices.id')\n organization_id = invoices.first.organization_id\n\n # Calcs\n invoice_debts = 0\n amount_first_surcharge = 0\n invoices.each { |i| invoice_debts += i.debts }\n invoice_debts_surcharge = invoice_debts * (charge / 100)\n if amount_first > 0\n number_quotas -= 1\n amount_first_surcharge = (amount_first * (charge / 100)).round(4)\n invoice_debts -= amount_first\n invoice_debts_surcharge -= amount_first_surcharge\n end\n each_instalment_amount = (invoice_debts / number_quotas).round(4)\n each_instalment_surcharge = (invoice_debts_surcharge / number_quotas).round(4)\n\n # Instalment plan No.\n client_id = invoices.first.client.id\n instalment_no = instalment_plan_next_no(client_id) || '0000000000000000000000'\n\n # Begin the creation transaction\n begin\n ActiveRecord::Base.transaction do\n ### Create plan ###\n plan = InstalmentPlan.create( instalment_no: instalment_no,\n instalment_date: Date.today,\n payment_method_id: payment_method_id,\n client_id: client_id,\n subscriber_id: subscriber_id,\n surcharge_pct: charge,\n created_by: created_by,\n organization_id: organization_id )\n ### Create instalments ###\n # Instalment 0\n if amount_first > 0\n Instalment.create( instalment_plan_id: plan.id,\n instalment: 0,\n payday_limit: Date.today,\n amount: amount_first,\n surcharge: amount_first_surcharge,\n created_by: created_by )\n end\n # Next instalments\n (1..number_quotas).each do |q|\n Instalment.create( instalment_plan_id: plan.id,\n instalment: q,\n payday_limit: Date.today + q.month,\n amount: each_instalment_amount,\n surcharge: each_instalment_surcharge,\n created_by: created_by )\n end\n ### Create deferred invoices ###\n i = 0\n instalment_id = 0\n instalment_balance = 0\n invoice = []\n amount = 0\n debt = 0\n new_debt = 0\n plan.instalments.each do |q|\n instalment_id = q.id\n instalment_balance = q.amount\n # Loop thru invoices\n while instalment_balance > 0.0001\n if i > invoices.size\n break\n end\n invoice = invoices[i]\n debt = new_debt > 0 ? new_debt : invoice.debts\n amount = debt > instalment_balance ? instalment_balance : debt\n new_debt = (debt - amount).round(4)\n instalment_balance = (instalment_balance - amount).round(4)\n InstalmentInvoice.create( instalment_id: instalment_id,\n bill_id: invoice.bill_id,\n invoice_id: invoice.id,\n debt: debt,\n amount: amount )\n i += 1 if new_debt <= 0.0001\n end\n end\n\n # Update invoice statuses\n invoices.each do |j|\n j.invoice_status_id = InvoiceStatus::FRACTIONATED\n j.save\n end\n end # ActiveRecord::Base.transaction\n redirect_to client_payments_path + \"#tab_pendings\", notice: I18n.t('ag2_gest.client_payments.fractionate_ok', var: instalment_no)\n rescue ActiveRecord::RecordInvalid\n redirect_to client_payments_path + \"#tab_pendings\", alert: I18n.t(:transaction_error, var: \"fractionate\") and return\n end # begin\n\n # Generic method rescue\n # rescue\n # redirect_to client_payments_path, alert: I18n.t('ag2_gest.client_payments.fractionate_error')\n end",
"def create\n fax_request = FaxRequest.new(fax_params)\n fax_request.client_receipt_date = Time.now\n fax_request.save!\n response = send_fax(fax_params)\n update_fax_request(fax_request,response)\n end",
"def donation_params\n params.require(:donation).permit(:amount, :donation_date, :contact_id, :payment_purpose_id, :payment_mode_id, :currency_id, :event_id, :bank_name, :cheque_number)\n end",
"def create\n\n amount = params[:amount].to_i\n charity = params[:charity]\n\n\n\t customer = Stripe::Customer.create(\n\t :email => params[:stripeEmail],\n\t :card => params[:stripeToken]\n\t )\n\n\t charge = Stripe::Charge.create(\n\t :customer => customer.id,\n\t :amount => amount,\n\t :description => 'Easy Giving Customer',\n\t :currency => 'usd'\n\t )\n\n new_donation= Donation.create(\n amount: amount,\n charity_name: charity\n )\n\n new_donation.user = current_user\n new_donation.save\n\n @donation = new_donation\n redirect_to donation_path(@donation) #donation show\n\n #if there's a processing error, show error,redirect to make a new donation\n rescue Stripe::CardError => e\n flash[:error] = e.message\n redirect_to new_donation_path\n\tend",
"def consultation_params\n params[:consultation]\n end",
"def create\n\n @charge = Charge.new(charge_params)\n \n customer = StripeTool.create_customer(email: params[:stripeEmail], \n stripe_token: params[:stripeToken])\n\n charge = StripeTool.create_charge(customer_id: customer.id, \n amount: (@charge.amount*100).to_i,\n description: @charge.topic)\n\n @charge.stripe_id = customer.id\n \n\n respond_to do |format|\n if @charge.save\n if @charge.owner_type == \"User\"\n format.html { redirect_to user_path(:id => @charge.owner_id, :topic => \"personen_charges\"), notice: (I18n.t :thxpayment) }\n end\n if @charge.owner_type == \"Company\"\n format.html { redirect_to company_path(:id => @charge.owner_id, :topic => \"institutionen_charges\"), notice: 'Charge was successfully created.' }\n end\n format.json { render :show, status: :created, location: @charge }\n else\n format.html { render :new }\n format.json { render json: @charge.errors, status: :unprocessable_entity }\n end\n end\n\n rescue Stripe::CardError => e\n flash[:error] = e.message\n redirect_to user_path(:id => @charge.owner_id, :topic => \"personen_charges\"), notice: (:I18n.t :nopayment)\n \n end",
"def new\n @diabetes_consultation = DiabetesConsultation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @diabetes_consultation }\n end\n end",
"def removalcharge_params\n params.require(:charge).permit(:charge)\n end",
"def create\n @ward_cost = WardCost.new(params[:ward_cost])\n\n respond_to do |format|\n if @ward_cost.save\n format.html { redirect_to(@ward_cost, :notice => 'WardCost was successfully created.') }\n format.xml { render :xml => @ward_cost, :status => :created, :location => @ward_cost }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ward_cost.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @charge_master = ChargeMaster.new(params[:charge_master])\n @session_id=session[:id]\n\t@session = Session.find(session[:id])\n\t@person = Person.find(@session.person_id)\n respond_to do |format|\n if @charge_master.save\n format.html { redirect_to(\"/charge_masters/new\", :notice => 'ChargeMaster was successfully created.') }\n format.xml { render :xml => @charge_master, :status => :created, :location => @charge_master }\n else\n\t\t @insurance=InsuranceMaster.find(:all,:conditions => \"org_code = '#{@charge_master.org_code}'\")\n\t\t\tj=0\n\t\t\t@insurance.length.times{\n\t\t\t\tcharge_master=@charge_master.charge_master_children.build\n\t\t\t\tcharge_master.reg_type=\"Insurance\"\t\n\t\t\t\tcharge_master.name=@insurance[j].company_name\n\t\t\t\tcharge_master.discount_price=0\n\t\t\t\tcharge_master.discount_persentage=0\n\t\t\t\tcharge_master.amount=0\n\t\t\t\tj+=1\n\t\t\t}\t\n format.html { render :action => \"new\" }\n format.xml { render :xml => @charge_master.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @consultation = Consultation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consultation }\n end\n end",
"def create\n @taxfree = Taxfree.new(taxfree_params)\n\n respond_to do |format|\n if @taxfree.save\n format.html { redirect_to @taxfree, notice: 'Taxfree was successfully created.' }\n format.json { render :show, status: :created, location: @taxfree }\n else\n format.html { render :new }\n format.json { render json: @taxfree.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(resource, params)\n case resource\n when \"pedidos\", \"place_order\", \"new_order\" then url = \"/pedidos\"\n when \"envios\", \"shipping\" then url = \"/envios\"\n else url = \"/#{resource}\"\n end\n\n post_request(url, params)\n end",
"def create\n if not params[:stripeToken].present?\n charge_record = Charge.create!(charge_params)\n DonationMailer.donation_notification(charge_record).deliver_later\n redirect_to(:back)\n elsif params[:stripeToken].present?\n # determine if the charge is a donation or registration fee\n @description = \"\"\n if params[:is_donation].present?\n @description = \"Wake \\'N Shake Donation\"\n elsif params[:is_registration_fee].present?\n @description = \"Wake \\'N Shake Registration Fee\"\n end\n\n # registration fee amount - $20\n @amount = 20\n\n # if not registration fee, set donation amount\n if params[:donation_amount].present?\n @amount = params[:donation_amount].to_i\n end\n\n customer = Stripe::Customer.create(\n email: params[:stripeEmail],\n source: params[:stripeToken]\n )\n\n charge = Stripe::Charge.create(\n customer: customer.id,\n amount: @amount*100,\n description: @description,\n currency: 'usd'\n )\n\n # associate the charge to a team or dancer\n if params[:charge_type] == \"Dancer\"\n @dancer = Dancer.find(params[:dancer_id])\n charge_record = @dancer.charges.new(amount: @amount, email: params[:stripeEmail])\n if params[:is_donation].present?\n charge_record.is_donation = true\n charge_record.save\n elsif params[:is_registration_fee].present?\n charge_record.is_registration_fee = true\n charge_record.save\n end\n elsif params[:charge_type] == \"Team\"\n @team = Team.find(params[:team_id])\n charge_record = @team.charges.new(amount: @amount, email: params[:stripeEmail], is_donation: true)\n elsif params[:charge_type] == \"All\"\n charge_record = Charge.new(amount: @amount, email: params[:stripeEmail], is_donation: true)\n end\n\n if charge_record.save\n if charge_record.is_registration_fee.present?\n redirect_to dancer_path(@dancer)\n elsif charge_record.is_donation.present?\n DonationMailer.donation_notification(charge_record).deliver_later\n redirect_to charge_record\n end\n end\n else\n redirect_to root_path\n end\n rescue Stripe::CardError => e\n logger.debug e.message\n redirect_to :back, flash: { error:\"#{e.message} Please try again or try another card.\" }\n end",
"def consultation_params\n params.fetch(:consultation, {}).permit(:id, :subject, :importance, :category, :body, :city, :skype, :email, :phone, :contact, :archive, :age, :gender, :last_name, :first_name, :patronymic_name, :chronic_diseases)\n end",
"def charge_params\n params.require(:charge).permit(:txn_id, :source, :amount, :app_id)\n end",
"def postEntityFax( entity_id, number, description)\n params = Hash.new\n params['entity_id'] = entity_id\n params['number'] = number\n params['description'] = description\n return doCurl(\"post\",\"/entity/fax\",params)\n end",
"def create\n @resultadoconsultum = Resultadoconsultum.new(resultadoconsultum_params)\n\t\n\n\trequire 'nokogiri'\n\t\n\t@doc = Nokogiri::XML(File.open(\"exemplos/emplo.xml\"))\n\n\tcar_tires = @doc.xpath(\"//firstname\")\n\t\n\tdoc = Nokogiri::XML(File.open(\"emplo.xml\"))\n\tdoc.xpath('firstname').each do\n\t\tcar_tires\n\tend\n\n\t \n respond_to do |format|\n if @resultadoconsultum.save\n format.html { redirect_to @resultadoconsultum, notice: car_tires }\n format.json { render :show, status: :created, location: @resultadoconsultum }\n else\n format.html { render :new }\n format.json { render json: @resultadoconsultum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @donation = Donation.new(donation_params)\n @donation.donation_date = Date.today()\n @payment_purposes = PaymentPurpose.all_active\n @events = Event.all_active\n @currencies = Currency.all_active\n @payment_modes = PaymentMode.all_active\n respond_to do |format|\n if @donation.save\n format.html { redirect_to @donation, notice: 'Donation was successfully created.' }\n format.json { render :show, status: :created, location: @donation }\n else\n format.html { render :new }\n format.json { render json: @donation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def charge_reservation (amount_fee, token, currency_type, stripe_user_id)\n charge = Stripe::Charge.create({\n amount: amount_fee,\n source: token,\n currency: currency_type\n },\n stripe_account: stripe_user_id\n )\n end",
"def create\n @selecciones = Seleccion.where(\"cliente_id = ?\",usuario_actual.id)\n @peso_total = Seleccion.peso_total(usuario_actual.id)\n @precio_total = Seleccion.precio_total(usuario_actual.id)\n @tarjetas = usuario_actual.tdc\n \n #Cobro en el banco\n client = Savon::Client.new(\"http://localhost:3001/servicios/wsdl\")\n tdc = Tarjeta.where(\"id = ? AND cliente_id = ?\",params[:orden][:tarjeta_id],usuario_actual.id)\n total_pagar = params[:orden][:total]\n pago = '<Message>\n <Request>\n <numero_tdc>'+tdc.numero+'</numero_tdc>\n <nombre_tarjetahabiente>'+tdc.tarjetahabiente+'</nombre_tarjetahabiente>\n <fecha_vencimiento>'+tdc.mes_vencimiento+'/'+tdc.ano_vencimiento+'</fecha_vencimiento>\n <codigo_seguridad>'+tdc.codigo+'</codigo_seguridad>\n <tipo_tarjeta>'+tdc.tipo+'</tipo_tarjeta>\n <direccion_cobro>'+tdc.direccion+'</direccion_cobro>\n <total_pagar>'+total_pagar+'</total_pagar>\n <cuenta_receptora>'+cuenta_receptora+'</cuenta_receptora>\n </Request>\n </Message>'\n #response = client.request :verificar_pago, body: { \"value\" => pago } \n #if response.success?\n # data = response.to_hash[:verificar_pago_response][:value][:response].first\n # @respuesta = XmlSimple.xml_in(data)\n #end\n\n #NAMESPACE = 'pagotdc'\n #URL = 'http://localhost:8080/'\n #banco = SOAP::RPC::Driver.new(URL, NAMESPACE)\n #banco.add_method('verificar_pago', 'numero_tdc', 'nombre_tarjetahabiente', 'fecha_vencimiento', 'codigo_seguridad', 'tipo_tarjeta', 'direccion_cobro', 'total_pagar', 'cuenta_receptora')\n #\n \n #respuesta = banco.verificar_pago(tdc.numero, tdc.tarjetahabiente, tdc.mes_vencimiento.to_s+'/'+tdc.ano_vencimiento.to_s, tdc.codigo, tdc.tipo, params[:orden][:total], tdc.direccion)\n \n if true #respuesta.ack.eql?(0)\n params[:orden][:cliente_id] = usuario_actual.id\n params[:orden][:total] = Seleccion.precio_total(usuario_actual.id)\n params[:orden][:fecha_entrega] = \"0000-00-00\"\n @orden = Orden.new(params[:orden])\n \n if @orden.save\n @selecciones = Seleccion.where(\"cliente_id = ?\",usuario_actual.id)\n @selecciones.each do |seleccion|\n p = Producto.find(seleccion.producto_id)\n @venta = Venta.new(:producto_id=>p.id, \n :orden_id=>@orden.id,\n :categoria_id=>p.categoria_id, \n :cantidad=>seleccion.cantidad,\n :costo=>p.precio)\n @venta.save\n end\n \n Seleccion.vaciar_carro(usuario_actual.id)\n respond_to do |format|\n format.html { redirect_to ver_ordenes_path, notice: 'Orden generada correctamente.' }\n end\n else\n respond_to do |format|\n format.html { render action: \"new\" }\n end\n end\n else\n respond_to do |format|\n format.html { render action: \"new\", notice: respuesta.mensaje }\n end\n end\n end",
"def gnc_charge_params\n params.require(:gnc_charge).permit(:charge_moment, :weather, :celsius_temperature, :cost_on_argentinian_pesos, :car_id, :service_station_id, :client_id)\n end",
"def consultation_params\n params.require(:consultation).permit(:user_id, :legislation_id)\n end",
"def agreement_renewal_params\n params.require(:agreement_renewal).permit! #(:franchisee_id, :renewed_date, :franchisee_document_id)\n end",
"def create\n # raise donation_record_actual_fund_params.inspect\n @donation_record_actual_fund = DonationRecord::ActualFund.new(donation_record_actual_fund_params)\n @donation_record_actual_fund.donation_record = @donation_record\n respond_to do |format|\n if @donation_record_actual_fund.save\n format.html { redirect_to @donation_record }\n format.json { render :show, status: :created, location: @donation_record_actual_fund }\n else\n format.html { render :new }\n format.json { render json: @donation_record_actual_fund.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n p params\n donation = Donation.new(\n amount: params[:amount],\n frequency: params[:frequency])\n # save the information from user input to create a new donation.\n donation.save!\n if donation.save!\n render json: donation.as_json\n else\n render json: {errors: donation.errors.full_messages}\n end\n end",
"def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end",
"def create\n @charge = Charge.new(params[:charge])\n if @charge.save\n redirect_to @charge, notice: 'Charge was successfully created.' \n else\n render action: \"new\"\n end\n end",
"def charge_params\n params[:charge].permit(:reward_id, :token)\n end",
"def create\n @consultorio_n = ConsultorioN.new(consultorio_n_params)\n\n respond_to do |format|\n if @consultorio_n.save\n format.html { redirect_to @consultorio_n, notice: 'Consultorio n was successfully created.' }\n format.json { render :show, status: :created, location: @consultorio_n }\n else\n format.html { render :new }\n format.json { render json: @consultorio_n.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create \n\t\t# amoutn in cents \n\t\t#@amount = 500 \n\n\t\tcustomer = Stripe::Customer.create(\n\t\t\t:email => 'example@stripe.com',\n\t\t\t:card => params[:stripeToken]\n\t\t\t)\t\n\n\t\tcharge = Stripe::Charge.create(\n\t\t\t:customer => customer.id,\n\t\t\t:amount => @amount,\n\t\t\t:description => 'Rails Stripe customer',\n\t\t\t:currency => 'usd'\n\t\t\t)\n\n\trescue Stripe::CardError => e\n\t\tflash[:error] = e.message\n\t\tredirect_to charges_path \n\tend",
"def charge_params\n params.require(:charge).permit(:owner_id, :owner_type, :stripe_id, :appparam_id, :date_from, :date_to, :amount, :plan)\n end",
"def create\n @donation_request = DonationRequest.new(params[:donation_request])\n\n respond_to do |format|\n if @donation_request.save\n format.html { redirect_to(@donation_request, :notice => 'Donation request was successfully created.') }\n format.xml { render :xml => @donation_request, :status => :created, :location => @donation_request }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @donation_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @credit_card_charge = CreditCardCharge.new(credit_card_charge_params)\n\n respond_to do |format|\n if @credit_card_charge.save\n format.html { redirect_to @credit_card_charge, notice: 'Credit card charge was successfully created.' }\n format.json { render :show, status: :created, location: @credit_card_charge }\n else\n format.html { render :new }\n format.json { render json: @credit_card_charge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n valor1 = customer_invoice_params[\"invoice_value\"].gsub('$','').gsub(',','')\n params[\"invoice_value\"] = valor1\n\n @customer_invoice = CustomerInvoice.create(customer_invoice_params)\n\n if @customer_invoice.save\n recalculate_cost_center(@customer_invoice.sales_order.cost_center_id)\n render :json => {\n message: \"¡El Registro fue creado con exito!\",\n register: @customer_invoice,\n type: \"success\"\n }\n else\n render :json => {\n message: \"¡El Registro no fue creado!\",\n type: \"error\",\n message_error: @customer_invoice.errors.full_messages\n }\n end\n \t\n end",
"def new\n @variable_charge = VariableCharge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @variable_charge }\n end\n end",
"def create\n @dbs_deposit = DbsDeposit.new(params[:dbs_deposit])\n\n respond_to do |format|\n if @dbs_deposit.save\n format.html { redirect_to(@dbs_deposit, :notice => 'DbsDeposit was successfully created.') }\n format.xml { render :xml => @dbs_deposit, :status => :created, :location => @dbs_deposit }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @dbs_deposit.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @franchisee_royalty = FranchiseeRoyalty.new(franchisee_royalty_params)\n\n respond_to do |format|\n if @franchisee_royalty.save\n format.html { redirect_to @franchisee_royalty, notice: 'Franchisee royalty was successfully created.' }\n format.json { render :show, status: :created, location: @franchisee_royalty }\n else\n format.html { render :new }\n format.json { render json: @franchisee_royalty.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @data = params[:investment]\n @investment= DraftInvestment.find(:all, :conditions => [\"company_id = ? AND funding_type = ?\",@data[:company_id], @data[:funding_type]])\n if @investment.to_s != \"\"\n @invest = DraftInvestment.find(@investment[0][:id])\n\t @invest.update_attributes({\"agency\" => @investment[0][\"agency\"] + \", \" + @data[:agency],\"funding_amount\" => (@data[\"funding_amount\"].to_i + @investment[0][\"funding_amount\"]).to_s})\n respond_to do |format|\n format.xml \n\t\tend \n\t \n else\n\n @investment = DraftInvestment.new(params[:investment])\n respond_to do |format|\n if @investment.save\n flash[:notice] = 'Investment was successfully created.'\n\n format.xml { render :xml => @investment, :status => :created, :location => @investment }\n else\n\n format.xml { render :xml => @investment.errors, :status => :unprocessable_entity }\n end\n end\n \n end\n\n end",
"def create\n @incrustation = Incrustation.new(incrustation_params)\n\n respond_to do |format|\n if @incrustation.save\n record_activity(@incrustation)\n format.html { redirect_to admin_incrustations_path, notice: 'Вставка была успешно создана.' }\n format.json { render :show, status: :created, location: @incrustation }\n else\n format.html { render :new }\n format.json { render json: @incrustation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @fixed_deposit = FixedDeposit.new(params[:fixed_deposit])\n\n respond_to do |format|\n if @fixed_deposit.save\n flash[:notice] = 'FixedDeposit was successfully created.'\n format.html { redirect_to(@fixed_deposit) }\n format.xml { render :xml => @fixed_deposit, :status => :created, :location => @fixed_deposit }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @fixed_deposit.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @consulta_procedimento = ConsultaProcedimento.new(consulta_procedimento_params)\n respond_to do |format|\n if @consulta_procedimento.save\n if params[:consulta_procedimento][:adicionar_a_fatura]\n @consulta_procedimento.consulta.fatura.descritivo_fatura.create!(:descricao => @consulta_procedimento.procedimento.nome, :valor => @consulta_procedimento.valor, :clinica_id => session[:clinica_id])\n end\n format.html { redirect_to @consulta_procedimento, notice: 'Consulta procedimento was successfully created.' }\n format.json { render action: 'show', status: :created, location: @consulta_procedimento }\n else\n format.html { render action: 'new' }\n format.json { render json: @consulta_procedimento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.find(params[:invoice][:project_id])\n @invoice = Invoice.new(params[:invoice])\n @invoice.remaining_sum=@invoice.total_sum\n @invoice.invoice_num=@invoice.create_invoice_num\n @invoice.invoice_ref=@invoice.create_invoice_ref\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to(@invoice, :notice => 'Facture créé avec succes.') }\n format.xml { render :xml => @invoice, :status => :created, :location => @invoice }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @freind = Freind.new(freind_params)\n\n respond_to do |format|\n if @freind.save\n format.html { redirect_to @freind, notice: \"Freind was successfully created.\" }\n format.json { render :show, status: :created, location: @freind }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @freind.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n nonce_from_the_client = params[:payment_method_nonce]\n # Use payment method nonce here...\n result = Braintree::Transaction.sale(\n :amount => params[:total_cost],\n :payment_method_nonce => nonce_from_the_client,\n :options => {\n :submit_for_settlement => true\n }\n )\n\n if result.success?\n flash[:notice] = \"success!: #{result.transaction.id}\"\n new_payment = Payment.create(\n total_cost: params[:total_cost])\n\n new_payment.save\n main_reservation = Reservation.find(params[:reservation_id])\n reservation = Reservation.where(check_in_date: main_reservation.check_in_date, user_id: main_reservation.user_id)\n reservation.each do |ind_record|\n ind_record.payment_id = new_payment.id\n ind_record.save\n end\n elsif result.transaction\n flash[:notice] = \"Error processing transaction:\"\n puts \" code: #{result.transaction.processor_response_code}\"\n puts \" text: #{result.transaction.processor_response_text}\"\n else\n flash[:notice] = result.errors\n end\n end",
"def create\n @pay_agreement = @fee.pay_agreements.build(pay_agreement_params)\n\n respond_to do |format|\n if @pay_agreement.save\n format.html { redirect_to @pay_agreement, notice: 'Pay agreement was successfully created.' }\n format.json { render :show, status: :created, location: @pay_agreement }\n format.js { }\n else\n format.html { render :new }\n format.json { render json: @pay_agreement.errors, status: :unprocessable_entity }\n format.js { render layout: false, content_type: 'text/javascript' }\n end\n end\n end",
"def index\n @charge = Charge.new\n respond_to do |format|\n if @charge.save\n format.html { redirect_to user_path(:id => $stripe_customer.id), notice: 'Payment was succesfull.' }\n format.json { render :show, status: :created, location: @charge }\n else\n format.html { render :new }\n format.json { render json: @charge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def generate_xml_request\n tax_receipt = generate_tax_receipt\n @certificate.certifica tax_receipt\n @key.sella tax_receipt\n tax_receipt.to_xml\n end",
"def stripe_charge\n donation = Donation.create(user_id: current_user.id, disaster_id: params[:disaster_id], charity_id: params[:id], amount: params[:donation_amount])\n\n Stripe.api_key = ENV['STRIPE_SECRET']\n token = params[:stripeToken]\n\n customer = Stripe::Customer.create(\n :source => token,\n :description => \"Example customer\"\n )\n # current_user.token = customer //save user token\n begin\n charge = Stripe::Charge.create(\n :amount => donation.amount, # in cents\n :currency => \"usd\",\n :customer => customer.id\n )\n flash[:good] = \"Thanks for donating!\"\n rescue Stripe::CardError => e\n flash[:problem] = e.message\n end\n redirect_to root_path\n\n end",
"def create\n @account_transaction = AccountTransaction.new(params[:account_transaction])\n\n respond_to do |format|\n if @account_transaction.save\n flash[:notice] = 'AccountTransaction was successfully created.'\n @account_transaction.deliver_credit_notification! if !@account_transaction.debit\n format.html { redirect_to :action => \"index\", :member_id => params[:member_id], :farm_id => params[:farm_id] }\n format.xml { render :xml => @account_transaction, :status => :created, :location => @account_transaction }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @account_transaction.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n recurring = params[:expense].delete(:recurring)\n statement = Statement.find(params[:statement_id])\n @expense = Expense.new(params[:expense])\n @expense.statement = statement\n @expense.recurring = recurring\n\n respond_to do |format|\n if @expense.save\n format.html { redirect_to @expense.statement, notice: 'Statement expense was successfully created.' }\n format.json { render json: @expense, status: :created, location: @expense }\n else\n format.html { render action: \"new\" }\n format.json { render json: @expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @expense = Expense.new(expense_params)\n @gastos = Gasto.all \n @documents = Document.all\n \n respond_to do |format|\n if @expense.save\n @expense.correlativo\n \n format.html { redirect_to @expense, notice: 'Expense was successfully created.' }\n format.json { render :show, status: :created, location: @expense }\n else\n format.html { render :new }\n format.json { render json: @expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @donation = Donation.new(params[:donation])\n\n respond_to do |format|\n if @donation.save\n flash[:notice] = 'Donation was successfully created.'\n format.html { redirect_to(@donation) }\n format.xml { render :xml => @donation, :status => :created, :location => @donation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @donation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @consultationcharge = Consultationcharge.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @consultationcharge }\n end\n end",
"def consultation_params\n params.require(:business_consultation).permit(:lead_id, :date, :cancelled, :no_show, :cost, :physician_id)\n end",
"def create\n # Each shop can have only one recurring charge per app. When a new recurring application charge is activated for a shop\n # that already has one, the existing recurring charge is canceled and replaced by the new charge.\n # The new recurring charge is then activated.\n\n plan_info = @subscriptions_info[params[:subscription_type]]\n local_charge = @shop.charges.create\n\n shopify_charge = ShopifyAPI::RecurringApplicationCharge.new(\n name: plan_info[\"name\"],\n price: plan_info[\"price\"],\n return_url: \"#{ENV['APP_URL']}/charges/#{local_charge.id}/activate\",\n test: plan_info[\"test\"],\n capped_amount: plan_info[\"capped_amount\"],\n terms: plan_info[\"terms\"]\n )\n if shopify_charge.save\n fullpage_redirect_to shopify_charge.confirmation_url\n else\n # make sure this works\n local_charge.delete\n # recurring charge could not be created\n end\n end",
"def pay_agreement_params\n params.require(:pay_agreement).permit(:fee_id, :user_registration_id,\n :discount, :discount_in_percent, :comment, :slug, :version, { details: [:information]})\n end",
"def create\n @garrison = Garrison.new(garrison_params)\n @garrison.kingdom_id = current_user.current_kingdom.id\n @garrison.recruted = true\n\n respond_to do |format|\n if @garrison.save\n format.html { redirect_to @garrison, notice: 'Garrison was successfully created.' }\n format.json { render action: 'show', status: :created, location: @garrison }\n else\n format.html { render action: 'new' }\n format.json { render json: @garrison.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n\t\t# Get the credit card details submitted by the form\n\t\ttoken = params[:stripeToken]\n\n\t\t# Amount in cents\n\t\t@amount = 500\n\n\t\tcustomer = Stripe::Customer.create(\n\t\t\t:email => 'example@stripe.com',\n\t\t\t:card => params[:stripeToken]\n\t\t)\n\n\t\t# Create the charge on Stripe's servers - this will charge the user's card\n\t\tcharge = Stripe::Charge.create(\n\t\t\t:customer => customer.id,\n\t\t\t:amount => @amount,\n\t\t\t:description => 'Rails Stripe customer',\n\t\t\t:currency => 'usd',\n\t\t\t:card => token\n\t\t)\n\n\trescue Stripe::CardError => e\n\t flash[:error] = e.message\n\t redirect_to charges_path\n\tend",
"def create\n @advance_payment = AdvancePayment.new(params[:advance_payment])\n @session_id=session[:id]\n @session = Session.find(session[:id])\n @person = Person.find(@session.person_id)\n\t@advance_payment.already_paid_amount=@advance_payment.gross_amount.to_f+@advance_payment.already_paid_amount.to_f\n\n\n respond_to do |format|\n if @advance_payment.save\n\t # format.html { redirect_to(@advance_payment, :notice => 'advance payments was successfully created.') }\n\t format.html { redirect_to(\"/advance_payments/report_bill/#{@advance_payment.id}?print_type=original&format=pdf\", :notice => 'AdvancePayment was successfully created.') }\n format.xml { render :xml => @advance_payment, :status => :created, :location => @advance_payment }\n else\n\t\t@adm=Admission.find_by_admn_no(@advance_payment.admn_no)\nif(@adm)\n\t\t@patient_name=@adm.patient_name\n\t\t@ward=@adm.ward\n\t\t@room=@adm.room\n\t\t@floor=@adm.floor\n\t\t@bed=@adm.bed\nend\n format.html { render :action => \"new\" }\n format.xml { render :xml => @advance_payment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_charge\n customer = Stripe::Customer.create(\n :email => params[:stripeEmail],\n :card => params[:stripeToken]\n )\n\n charge = Stripe::Charge.create(\n :customer => customer.id,\n :amount => Deal.find(current_consumer.orders.last[:deal_id]).price.to_i * 100,\n :description => 'Prlayvous Ticket',\n :currency => 'usd'\n )\n\n #After paying with Stripe, consumers are prompt to confirm their shipping address.\n redirect_to edit_consumer_order_path(current_consumer, @order)\n\n rescue Stripe::CardError => e\n flash[:error] = e.message\n redirect_to charges_path\n end",
"def new\n @title='Discharge patient'\n @discharge = Discharge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @discharge }\n end\n end"
] |
[
"0.66658425",
"0.60315293",
"0.58918804",
"0.5879767",
"0.5838339",
"0.5794557",
"0.5782371",
"0.57703924",
"0.5766089",
"0.5759834",
"0.56913656",
"0.5675829",
"0.56500065",
"0.5647769",
"0.5589518",
"0.55893445",
"0.5588488",
"0.55737865",
"0.5572595",
"0.5501081",
"0.5494508",
"0.54913545",
"0.54907596",
"0.5488262",
"0.54873425",
"0.5459593",
"0.5459006",
"0.5458706",
"0.54487777",
"0.54308546",
"0.5422586",
"0.54116166",
"0.54030776",
"0.5402904",
"0.53792876",
"0.53727096",
"0.5372021",
"0.5367232",
"0.53647536",
"0.53641796",
"0.5356632",
"0.53539646",
"0.5343267",
"0.534137",
"0.5337691",
"0.5333919",
"0.532966",
"0.53290963",
"0.53240204",
"0.53122497",
"0.53086346",
"0.5296117",
"0.52943933",
"0.5286616",
"0.5284337",
"0.528349",
"0.526977",
"0.52679586",
"0.5265825",
"0.5258578",
"0.52583224",
"0.52537405",
"0.52523786",
"0.5250973",
"0.52501327",
"0.5242249",
"0.5238936",
"0.52389324",
"0.52345854",
"0.52325565",
"0.5232332",
"0.5230067",
"0.5227509",
"0.52274376",
"0.52259326",
"0.52244526",
"0.52178216",
"0.5216115",
"0.5213439",
"0.5212625",
"0.5206547",
"0.5205964",
"0.5204962",
"0.5196107",
"0.51949865",
"0.5194605",
"0.51904315",
"0.5189151",
"0.51856977",
"0.51767415",
"0.51644737",
"0.51627207",
"0.5162416",
"0.5161695",
"0.5161306",
"0.5160226",
"0.51597077",
"0.5159594",
"0.51584625",
"0.51551723"
] |
0.6697496
|
0
|
PUT /consultationcharges/1 PUT /consultationcharges/1.xml
|
def update
@consultationcharge = Consultationcharge.find(params[:id])
respond_to do |format|
if @consultationcharge.update_attributes(params[:consultationcharge])
format.html { redirect_to(@consultationcharge, :notice => 'Consultationcharge was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @consultationcharge.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @pfs_consultation = PfsConsultation.find(params[:id])\n\n respond_to do |format|\n if @pfs_consultation.update_attributes(params[:pfs_consultation])\n format.html { redirect_to(@pfs_consultation, :notice => 'Pfs consultation was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pfs_consultation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @consultation = Consultation.find(params[:id])\n\n respond_to do |format|\n if @consultation.update_attributes(params[:consultation])\n format.html { redirect_to(@consultation, :notice => t(\"flash.notices.model.consultation.updated\"))}\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @consultation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n resource.update(deposit_contract_params)\n respond_with client, resource\n end",
"def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"def update\n @variable_charge = VariableCharge.find(params[:id])\n\n respond_to do |format|\n if params[:taxes]\n params[:taxes].each do |t|\n\t tax = Taxrate.find_by_name t[0]\n\t # t is the key\n\t if t[1] == '1'\n\t @variable_charge.taxrates << tax unless @variable_charge.taxrates.exists?(tax)\n\t else\n\t @variable_charge.taxrates.delete(tax) if @variable_charge.taxrates.exists?(tax)\n\t end\n\tend\n end\n if @variable_charge.update_attributes(params[:variable_charge]) || params[:taxes]\n format.html { redirect_to(variable_charges_path, :notice => 'VariableCharge was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @variable_charge.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def update\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n if @consulta.update_attributes(params[:consulta])\n format.html { redirect_to(@consulta, :notice => 'Consulta was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @consulta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n if @consulta.update_attributes(params[:consulta])\n format.html { redirect_to(@consulta, :notice => 'Consulta was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @consulta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @consultum = Consultum.find(params[:id])\n\n respond_to do |format|\n if @consultum.update_attributes(params[:consultum])\n format.html { redirect_to @consultum, notice: 'Consultum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @consultum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consult.update(consult_params)\n format.html { redirect_to @consult, notice: 'Consult was successfully updated.' }\n format.json { render :show, status: :ok, location: @consult }\n else\n format.html { render :edit }\n format.json { render json: @consult.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @consultationcharge = Consultationcharge.find(params[:id])\n @consultationcharge.destroy\n\n respond_to do |format|\n format.html { redirect_to(consultationcharges_url) }\n format.xml { head :ok }\n end\n end",
"def update\n respond_to do |format|\n if @consultation.update(consultation_params)\n format.html { redirect_to @consultation, notice: 'Consulta atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @consultation }\n else\n format.html { render :edit }\n format.json { render json: @consultation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @diabetes_consultation = DiabetesConsultation.find(params[:id])\n\n respond_to do |format|\n if @diabetes_consultation.update_attributes(params[:diabetes_consultation])\n format.html { redirect_to(@diabetes_consultation, :notice => 'Diabetes consultation was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @diabetes_consultation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @discharge = Discharge.find(params[:id])\n\n respond_to do |format|\n if @discharge.update_attributes(params[:discharge])\n flash[:notice] = 'Discharge was successfully updated.'\n format.html { redirect_to(@discharge) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @discharge.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @fax_document = FaxDocument.find(params[:id])\n \n respond_to do |format|\n if @fax_document.update_attributes(params[:fax_document])\n format.html { redirect_to(@fax_document, :notice => t(:fax_document_updated)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fax_document.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n\n respond_to do |format|\n if @instrument_version.update_attributes(params[:instrument_version])\n flash[:notice] = 'InstrumentVersion was successfully updated.'\n format.html { redirect_to(@instrument_version) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument_version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @charge_transaction = ChargeTransaction.find(params[:id])\n\n respond_to do |format|\n if @charge_transaction.update_attributes(params[:charge_transaction])\n flash[:notice] = 'ChargeTransaction was successfully updated.'\n format.html { redirect_to charge_transaction_url(@charge_transaction) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @charge_transaction.errors.to_xml }\n end\n end\n end",
"def update\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n if @consulta.update_attributes(params[:consulta])\n flash[:notice] = 'Consulta atualizada com sucesso.'\n format.html { redirect_to(@consulta) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @consulta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consultum.update(consultum_params)\n format.html { redirect_to @consultum, notice: 'Consulta foi editada com sucesso.' }\n format.json { render :show, status: :ok, location: @consultum }\n else\n # format.html { render :edit }\n format.json { render json: @consultum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_put_expenses_1_xml\n @parameters = {:expense => {:description => 'NewDescription'}}\n if ActiveRecord::VERSION::MAJOR < 4\n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/expenses/1.xml',\n {:expense => {:description => 'NewDescription'}},\n {:success_code => :ok})\n end\n\n assert_no_difference('Expense.count') do\n put '/expenses/1.xml', @parameters, credentials('admin')\n end\n\n expense = Expense.find(1)\n assert_equal \"NewDescription\", expense.description\n end",
"def update_rest\n @entry_instrument = EntryInstrument.find(params[:id])\n\n respond_to do |format|\n if @entry_instrument.update_attributes(params[:entry_instrument])\n flash[:notice] = 'EntryInstrument was successfully updated.'\n format.html { redirect_to(@entry_instrument) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_instrument.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @inv_x_ref = InvXRef.find(params[:id])\n\n respond_to do |format|\n if @inv_x_ref.update_attributes(params[:inv_x_ref])\n format.html { redirect_to @inv_x_ref, notice: 'Inv x ref was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inv_x_ref.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consultationcharge = Consultationcharge.new(params[:consultationcharge])\n\n respond_to do |format|\n if @consultationcharge.save\n format.html { redirect_to(@consultationcharge, :notice => 'Consultationcharge was successfully created.') }\n format.xml { render :xml => @consultationcharge, :status => :created, :location => @consultationcharge }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @consultationcharge.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @draft_investment = DraftInvestment.find(params[:id])\n\n respond_to do |format|\n if @draft_investment.update_attributes(params[:investment])\n\n format.xml \n else\n\n format.xml { render :xml => @draft_investment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @consultationcharge = Consultationcharge.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @consultationcharge }\n end\n end",
"def update\n @invoice = Invoice.find(params[:id])\n @invoice.year = Date.today.year\n\n @invoice.client_id = params[:clients]\n @invoice.discount_id = params[:discount_id]\n @invoice.tax_id = params[:tax_id]\n\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_consultation\n @consultation = Business::Consultation.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @consultor.update(consultor_params)\n format.html { redirect_to @consultor, notice: 'Consultor was successfully updated.' }\n format.json { render :show, status: :ok, location: @consultor }\n else\n format.html { render :edit }\n format.json { render json: @consultor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n @invoice_item.update(@invoice_item)\n respond_with(@invoice)\n \n end",
"def update_rest\n @item_usage = ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @item_usage.update_attributes(params[:item_usage])\n flash[:notice] = 'ItemUsage was successfully updated.'\n format.html { redirect_to(@item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consultorio_n.update(consultorio_n_params)\n format.html { redirect_to @consultorio_n, notice: 'Consultorio n was successfully updated.' }\n format.json { render :show, status: :ok, location: @consultorio_n }\n else\n format.html { render :edit }\n format.json { render json: @consultorio_n.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @consulta = Consulta.find(params[:id])\n\n if @consulta.update(params[:consulta])\n head :no_content\n else\n render json: @consulta.errors, status: :unprocessable_entity\n end\n end",
"def update\n @charge = Charge.find(params[:id])\n\n respond_to do |format|\n if @charge.update_attributes(params[:charge])\n format.html { redirect_to @charge, notice: 'Charge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @charge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vdocs_requirement = VdocsRequirement.find(params[:id])\n\t@contract = @vdocs_requirement.contract\n\n respond_to do |format|\n if @vdocs_requirement.update_attributes(params[:vdocs_requirement])\n flash[:notice] = 'VdocsRequirement was successfully updated.'\n format.html { redirect_to(@vdocs_requirement) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vdocs_requirement.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend",
"def update\n @taxirequest = Taxirequest.find(params[:id])\n\n respond_to do |format|\n if @taxirequest.update_attributes(params[:taxirequest])\n format.html { redirect_to @taxirequest, notice: 'Taxirequest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @taxirequest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_consultation_request\n @consultation_request = ConsultationRequest.find(params[:id])\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n @consultant_master = ConsultantMaster.find(params[:id])\n\n respond_to do |format|\n if @consultant_master.update_attributes(params[:consultant_master])\n format.html { redirect_to @consultant_master, notice: 'Consultant master was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @consultant_master.errors, status: :unprocessable_entity }\n end\n end\n end",
"def charge(attrs = {})\n post :charges, {}, attrs.to_xml(:root => :charge)\n end",
"def set_consultation\n @consultation = Consultation.find(params[:consultation_id])\n end",
"def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Factura actualizada correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n flash[:notice] = 'Nota fiscal atualizada.'\n format.html { redirect_to(@invoice) }\n format.xml { head :ok }\n else\n default_data\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @referral_charge = ReferralCharge.find(params[:id])\n\n respond_to do |format|\n if @referral_charge.update_attributes(params[:referral_charge])\n format.html { redirect_to(@referral_charge, :notice => 'ReferralCharge was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @referral_charge.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @cost_center.update_attributes(params[:cost_center])\n format.html { redirect_to(@cost_center, :notice => 'Cost center was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cost_center.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @supplier_payment = SupplierPayment.find(params[:id])\n\n respond_to do |format|\n if @supplier_payment.update_attributes(params[:supplier_payment])\n format.html { redirect_to(@supplier_payment, :notice => 'Supplier Payment was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @supplier_payment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n @pfs_consultation = PfsConsultation.find(params[:id])\n @pfs_consultation.destroy\n\n respond_to do |format|\n format.html { redirect_to(pfs_consultations_url) }\n format.xml { head :ok }\n end\n end",
"def update\n @docent = Docent.find(params[:id])\n\n respond_to do |format|\n if @docent.update_attributes(params[:docent])\n format.html { redirect_to(@docent, :notice => 'Docent was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @docent.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @cost = Cost.find(params[:id])\n\n respond_to do |format|\n if @cost.update_attributes(params[:cost])\n format.html { redirect_to(@cost, :notice => 'Cost was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cost.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to(@invoice, :notice => 'Invoice was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @recharge.update(recharge_params)\n format.html { redirect_to @recharge, notice: 'Recharge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @recharge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_consultation\n @consultation = Consultation.find(params[:id])\n end",
"def set_consultation\n @consultation = Consultation.find(params[:id])\n end",
"def set_consultation\n @consultation = Consultation.find(params[:id])\n end",
"def update\n @carbontaxrefund = Carbontaxrefund.find(params[:id])\n\n respond_to do |format|\n if @carbontaxrefund.update_attributes(params[:carbontaxrefund])\n format.html { redirect_to @carbontaxrefund, notice: 'Carbontaxrefund was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @carbontaxrefund.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @feria2010observacion = Feria2010observacion.find(params[:id])\n\n respond_to do |format|\n if @feria2010observacion.update_attributes(params[:feria2010observacion])\n format.html { redirect_to(@feria2010observacion, :notice => 'Feria2010observacion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feria2010observacion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @taxfree.update(taxfree_params)\n format.html { redirect_to @taxfree, notice: 'Taxfree was successfully updated.' }\n format.json { render :show, status: :ok, location: @taxfree }\n else\n format.html { render :edit }\n format.json { render json: @taxfree.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consult.update(consult_params)\n format.html { redirect_to \"/admin/consults/#{@consult.id}?ud=#{@consult.user_id}\", notice: t('activerecord.models.consult')+'更新成功!' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @consult.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @contract = Contract.find(params[:id])\n\n respond_to do |format|\n if @contract.update_attributes(params[:contract])\n flash[:notice] = 'Contract was successfully updated.'\n format.html { redirect_to(@contract) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @contract.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @vendor_doc = VendorDoc.find(params[:id])\n\t@vdocs_requirement = @vendor_doc.vdocs_requirement\n\n respond_to do |format|\n if @vendor_doc.update_attributes(params[:vendor_doc])\n flash[:notice] = 'VendorDoc was successfully updated.'\n format.html { redirect_to(@vendor_doc) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vendor_doc.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @invoice = Invoice.find(params[:id])\n @invoice.timestamp = Time.now\n @invoice.update_totals\n\n\n# #if the invoice is paid, let's add them to the email marketing list\n# if @invoice.paid = true then\n# @cust = Customer.find_by_id(@invoice.customer_id)\n# url = \"http://allinnetworks.com/index.php?option=com_acymailing>ask=sub&task=optin&hiddenlists=1,8&user[email]=\" + @cust.email + \"&user[name]=\" + @cust.firstname + \" \" + @cust.lastname\n# @doc = Nokogiri::XML(open(url))\n# end\n\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to(invoice_path(@invoice.id), :notice => 'Invoice was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @envelope = Envelope.find(params[:id])\n\n respond_to do |format|\n if @envelope.update_attributes(params[:envelope])\n flash[:notice] = 'Envelope was successfully updated.'\n format.html { redirect_to(@envelope) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @envelope.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @orc_suplementacao = OrcSuplementacao.find(params[:id])\n\n respond_to do |format|\n if @orc_suplementacao.update_attributes(params[:orc_suplementacao])\n flash[:notice] = 'SALVO COM SUCESSO.'\n format.html { redirect_to(@orc_suplementacao) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @orc_suplementacao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n flash[:notice] = 'Invoice was successfully updated.'\n format.html { redirect_to(@invoice) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n flash[:notice] = 'Invoice was successfully updated.'\n format.html { redirect_to(@invoice) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n @consultation = Consultation.find(params[:id])\n @consultation.destroy\n\n respond_to do |format|\n format.html { redirect_to(consultations_url) }\n format.xml { head :ok }\n end\n end",
"def update\n @contract = Contract.find(params[:id])\n\n respond_to do |format|\n if @contract.update_attributes(params[:contract])\n format.html { redirect_to(\"/contractview\", :notice => 'Contract was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @contract.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to('/invoiceview', :notice => 'Invoice was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @provision = Provision.find(params[:id])\n\n respond_to do |format|\n if @provision.update_attributes(params[:provision])\n format.html { redirect_to(@provision, :notice => 'Provision was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @provision.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @ref = Ref.find(params[:id])\n\n respond_to do |format|\n if @ref.update_attributes(params[:ref])\n format.html { redirect_to(@ref, :notice => 'Ref was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ref.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @cash_invoice.update cash_invoice_params\n render 'action'\n end",
"def update\n @centro = Centro.find(params[:id])\n\n respond_to do |format|\n if @centro.update_attributes(params[:centro])\n format.html { redirect_to(@centro, :notice => 'Centro atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @centro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_consultant\r\n @consultant = Consultant.find(params[:id])\r\n end",
"def update\n respond_to do |format|\n if @consultant_customer_destination.update(consultant_customer_destination_params)\n format.html { redirect_to @consultant_customer_destination, notice: 'Consultant customer destination was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @consultant_customer_destination.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consulta.update(consulta_params)\n format.html { redirect_to paciente_consultas_path, notice: 'Consulta foi editada com sucesso.' }\n format.json { render :show, status: :ok, location: @consulta }\n else\n format.html { render :edit }\n format.json { render json: @consulta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @services_charger = ServicesCharger.find(params[:id])\n\n respond_to do |format|\n if @services_charger.update_attributes(params[:services_charger])\n format.html { redirect_to(@services_charger, :notice => 'ServicesCharger was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @services_charger.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @cost_sheet = CostSheet.find(params[:id])\n\n respond_to do |format|\n if @cost_sheet.update_attributes(params[:cost_sheet])\n format.html { redirect_to(@cost_sheet, :notice => 'Cost sheet was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cost_sheet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @invoice = Invoice.find(params[:id])\n @invoice.update_attributes(params[:invoice])\n @invoice.remaining_sum=@invoice.total_sum\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to(@invoice, :notice => 'Facture modifiée avec succes.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @supervisor_estagio = SupervisorEstagio.find(params[:id])\n\n respond_to do |format|\n if @supervisor_estagio.update_attributes(params[:supervisor_estagio])\n flash[:notice] = 'Supervisor de Estagio atualizado com sucesso.'\n format.html { redirect_to(@supervisor_estagio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @supervisor_estagio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def create\n @consultation = Consultation.new(params[:consultation])\n\n respond_to do |format|\n if @consultation.save\n format.html { redirect_to(@consultation, :notice => t(\"flash.notices.model.consultation.created\")) }\n format.xml { render :xml => @consultation, :status => :created, :location => @consultation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @consultation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @purchase_requisition = PurchaseRequisition.find(params[:id])\n\n respond_to do |format|\n if @purchase_requisition.update_attributes(params[:purchase_requisition])\n format.html { redirect_to(@purchase_requisition, :notice => 'Purchase Requisition was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @purchase_requisition.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @gtfs_agency = GtfsAgency.find(params[:id])\n\n respond_to do |format|\n if @gtfs_agency.update_attributes(params[:gtfs_agency])\n format.html { redirect_to(@gtfs_agency, :notice => 'Gtfs agency was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gtfs_agency.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consultor.update(consultor_params)\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @consultor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @doc.refused = false\n @doc.logs += \"Документ отредактирован #{DateTime.now}. <br> Документ повторно отправлен на подпись #{@doc.signer.name_with_initial}<br>\"\n respond_to do |format|\n if @doc.update(doc_params)\n format.html { redirect_to @doc, notice: 'Doc was successfully updated.' }\n format.json { render :show, status: :ok, location: @doc }\n else\n format.html { render :edit }\n format.json { render json: @doc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n params[:refill_type] = params[:refill_type].to_i\n params[:status] = params[:status].to_i\n params[:cost_basis] = params[:cost_basis].to_i\n params[:other_coverage_code] = params[:other_coverage_code].to_i\n params[:reason_for_delay] = params[:reason_for_delay].to_i\n params[:partial_fill_status] = params[:partial_fill_status].to_i\n params[:reported_to_pmp] = params[:reported_to_pmp].to_i\n\n respond_to do |format|\n if @dispense.update(dispense_params)\n format.html { redirect_to @dispense, notice: 'Dispense was successfully updated.' }\n format.json { render :show, status: :ok, location: @dispense }\n else\n format.html { render :edit }\n format.json { render json: @dispense.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @transaction_goods_taxis = Transaction::Goods::Taxe.find(params[:id])\n\n respond_to do |format|\n if @transaction_goods_taxis.update_attributes(params[:transaction_goods_taxis])\n format.html { redirect_to(@transaction_goods_taxis, :notice => 'Taxe was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @transaction_goods_taxis.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @frais_annex = FraisAnnex.find(params[:id])\n\n respond_to do |format|\n if @frais_annex.update_attributes(params[:frais_annex])\n format.html { redirect_to @frais_annex, :notice => 'Le frais annexe a bien été modifié' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @frais_annex.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Uw factuur is aangepast.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @pfs_consultation = PfsConsultation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pfs_consultation }\n end\n end",
"def update\n\n puts '>>>>>>>>>> ATUALIZANDO A PROMOCAO....'\n\n @client_id = params[:client_id]\n @promotion = Promotion.find(params[:id])\n\n @promotion.start_date = Date.today\n @promotion.finish_date = Date.today + 10\n\n \n\n respond_to do |format|\n if @promotion.update_attributes(params[:promotion])\n format.html { redirect_to(promotion_path(:client_id => @client_id), :notice => 'Promotion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @promotion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consultorio.update(consultorio_params)\n format.html { redirect_to @consultorio, notice: 'Consultorio actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @consultorio }\n else\n format.html { render :edit }\n format.json { render json: @consultorio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trein_consul_comercial.update(trein_consul_comercial_params)\n format.html { redirect_to @trein_consul_comercial, notice: 'Trein consul comercial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trein_consul_comercial.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dossier = Dossier.find(params[:id])\n\n respond_to do |format|\n if @dossier.update_attributes(params[:dossier])\n flash[:notice] = 'Dossier was successfully updated.'\n format.html { redirect_to(@dossier) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @dossier.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @depositocaucion = Depositocaucion.find(params[:id])\n respond_to do |format|\n if @depositocaucion.update_attributes(params[:depositocaucion])\n flash[:notice] = 'Depositocaucion was successfully updated.'\n format.html { redirect_to(@depositocaucion) }\n format.xml { head :ok }\n else \n format.html { render :action => \"edit\" }\n format.xml { render :xml => @depositocaucion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @incrustation.update(incrustation_params)\n record_activity(@incrustation)\n format.html { redirect_to admin_incrustations_path, notice: 'Вставка была успешно обновлена.' }\n format.json { render :show, status: :ok, location: @incrustation }\n else\n format.html { render :edit }\n format.json { render json: @incrustation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @patient_charge = PatientCharge.find(params[:id])\n\n respond_to do |format|\n if @patient_charge.update_attributes(params[:patient_charge])\n format.html { redirect_to @patient_charge, notice: 'Patient charge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient_charge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @settlement = @transaction.settlements.find(params[:id])\n\n respond_to do |format|\n if @settlement.update_attributes(params[:settlement])\n format.html { redirect_to(client_transaction_settlement_path(@client, @transaction, @settlement), :notice => 'Settlement was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @settlement.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @fund_request.update_attributes(params[:fund_request])\n flash[:notice] = 'Fund request was successfully updated.'\n format.html { redirect_to @fund_request }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fund_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @organization_charge.update(organization_charge_params)\n format.html { redirect_to @organization_charge, notice: 'Organization charge was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization_charge }\n else\n format.html { render :edit }\n format.json { render json: @organization_charge.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6245957",
"0.62359864",
"0.6153786",
"0.59262246",
"0.591418",
"0.58875775",
"0.5866888",
"0.5866888",
"0.58563316",
"0.58557457",
"0.57737565",
"0.5761195",
"0.573807",
"0.5726965",
"0.57141674",
"0.56835145",
"0.56654924",
"0.56565315",
"0.5629517",
"0.5614929",
"0.5610336",
"0.560281",
"0.55982995",
"0.5582481",
"0.5570557",
"0.55438256",
"0.55427676",
"0.5540998",
"0.554023",
"0.55333805",
"0.55209637",
"0.5513479",
"0.5493938",
"0.5483389",
"0.5479228",
"0.54756737",
"0.5469727",
"0.54683244",
"0.54553694",
"0.5449716",
"0.54429847",
"0.5441235",
"0.54371315",
"0.54326147",
"0.5428622",
"0.54171336",
"0.5408719",
"0.5403962",
"0.5399743",
"0.53919506",
"0.53917426",
"0.5391636",
"0.5391636",
"0.5391636",
"0.53863955",
"0.5386173",
"0.5383416",
"0.5378745",
"0.53772646",
"0.537099",
"0.5369407",
"0.5364225",
"0.5357286",
"0.53543824",
"0.53543824",
"0.5352281",
"0.53507286",
"0.5343603",
"0.5337023",
"0.53364825",
"0.5335561",
"0.5332875",
"0.53258663",
"0.5321609",
"0.5321511",
"0.5319769",
"0.53168356",
"0.5310481",
"0.53058916",
"0.53043985",
"0.5303595",
"0.53032297",
"0.53030145",
"0.53009135",
"0.53006727",
"0.5299541",
"0.5293136",
"0.5289389",
"0.52882004",
"0.52846885",
"0.5283341",
"0.52753675",
"0.5274875",
"0.5274208",
"0.5271836",
"0.52695584",
"0.5268636",
"0.5268445",
"0.52674365",
"0.5265719"
] |
0.6577601
|
0
|
DELETE /consultationcharges/1 DELETE /consultationcharges/1.xml
|
def destroy
@consultationcharge = Consultationcharge.find(params[:id])
@consultationcharge.destroy
respond_to do |format|
format.html { redirect_to(consultationcharges_url) }
format.xml { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def destroy\n @consultation = Consultation.find(params[:id])\n @consultation.destroy\n\n respond_to do |format|\n format.html { redirect_to(consultations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @pfs_consultation = PfsConsultation.find(params[:id])\n @pfs_consultation.destroy\n\n respond_to do |format|\n format.html { redirect_to(pfs_consultations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @diabetes_consultation = DiabetesConsultation.find(params[:id])\n @diabetes_consultation.destroy\n\n respond_to do |format|\n format.html { redirect_to(diabetes_consultations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @discharge = Discharge.find(params[:id])\n @discharge.destroy\n\n respond_to do |format|\n format.html { redirect_to(discharges_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @consulta = Consulta.find(params[:id])\n @consulta.destroy\n\n respond_to do |format|\n format.html { redirect_to(consultas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @consulta = Consulta.find(params[:id])\n @consulta.destroy\n\n respond_to do |format|\n format.html { redirect_to(consultas_url) }\n format.xml { head :ok }\n end\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @gstr_advance_receipts = GstrAdvanceReceipt.find_by_id_and_company_id(params[:id], @company.id)\n @gstr_advance_receipts.delete_gstr_one_entry \n @gstr_advance_receipts.delete\n respond_to do |format|\n @gstr_advance_receipts.register_delete_action(request.remote_ip, @current_user, 'deleted')\n format.html { redirect_to(gstr_advance_receipts_url, :notice =>\"Gstr Advance Receipt has been succesfully deleted\") }\n format.xml {head :ok}\n \n end\n end",
"def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @direccion = Direccion.find(params[:id])\n @direccion.destroy\n\n respond_to do |format|\n format.html { redirect_to(direccions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @charge_transaction = ChargeTransaction.find(params[:id])\n @charge_transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to charge_transactions_url }\n format.xml { head :ok }\n end\n end",
"def deleteEntityFax( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/fax\",params)\n end",
"def destroy\n @referral_charge = ReferralCharge.find(params[:id])\n @referral_charge.destroy\n\n respond_to do |format|\n format.html { redirect_to(referral_charges_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @variable_charge = VariableCharge.find(params[:id])\n @variable_charge.destroy\n\n respond_to do |format|\n format.html { redirect_to(variable_charges_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @fax_document = FaxDocument.find(params[:id])\n @fax_document.destroy\n \n respond_to do |format|\n format.html { redirect_to(fax_documents_url) }\n format.xml { head :ok }\n end\n end",
"def deleteResource(doc, msg_from)\n \n \n begin\n\n puts \"Deleting\"\n\n path = \"\"\n params = {}\n headers = {}\n \n context, path = findContext(doc, path) \n \n # Deleting member from group\n if context == :user_group_member\n params = {}\n else\n raise Exception.new(\"No context given!\")\n end\n \n httpAndNotify(path, params, msg_from, :delete)\n \n rescue Exception => e\n puts \"Problem in parsing data (CREATE) from xml or sending http request to the VR server: \" + e\n puts \" -- line: #{e.backtrace[0].to_s}\"\n end\n \n end",
"def destroy\n @dbs_deposit = DbsDeposit.find(params[:id])\n @dbs_deposit.destroy\n\n respond_to do |format|\n format.html { redirect_to(dbs_deposits_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dossier = Dossier.find(params[:id])\n @dossier.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/\") }\n format.xml { head :ok }\n end\n end",
"def destroy\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(config_xmls_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end",
"def destroy\n @bank_reconciliations = AccountingBankReconciliations.find(params[:id])\n @bank_reconciliations.destroy\n\n respond_to do |format|\n format.html { redirect_to(accounting_bank_reconciliations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @consulta = Consulta.find(params[:id])\n @consulta.destroy\n\n head :no_content\n end",
"def destroy\n @charge_master = ChargeMaster.find(params[:id])\n @charge_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(charge_masters_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @reconciliation_detail = AccountingReconciliationDetail.find(params[:id])\n @reconciliation_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(accounting_reconciliation_details_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @consultation.destroy\n respond_to do |format|\n format.html { redirect_to consultations_url, notice: 'Consulta apagada' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consultum = Consultum.find(params[:id])\n @consultum.destroy\n\n respond_to do |format|\n format.html { redirect_to consulta_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @docent = Docent.find(params[:id])\n @docent.destroy\n\n respond_to do |format|\n format.html { redirect_to(docents_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @desasignado = Desasignado.find(params[:id])\n @desasignado.destroy\n\n respond_to do |format|\n format.html { redirect_to(desasignados_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @services_charger = ServicesCharger.find(params[:id])\n @services_charger.destroy\n\n respond_to do |format|\n format.html { redirect_to(services_chargers_url) }\n format.xml { head :ok }\n end\n end",
"def report_delete(id)\r\n\t\tpost= { \"token\" => @token, \"report\" => id } \r\n\t\tdocxml=nessus_request('report/delete', post)\r\n\t\treturn docxml\r\n\tend",
"def destroy\n @prd_etc = PrdEtc.find(params[:id])\n @prd_etc.destroy\n\n respond_to do |format|\n format.html { redirect_to(prd_etcs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @convenio = Convenio.find(params[:id])\n @convenio.destroy\n\n respond_to do |format|\n format.html { redirect_to(convenios_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @documento = @externo.documentos.find(params[:id])\n @documento.destroy\n\n respond_to do |format|\n format.html { redirect_to(documentos_url(@externo)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @deposit_threshold = DepositThreshold.find(params[:id])\n @deposit_threshold.destroy\n\n respond_to do |format|\n format.html { redirect_to(deposit_thresholds_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @correspondenciasasignada = Correspondenciasasignada.find(params[:id])\n @correspondenciasasignada.destroy\n\n respond_to do |format|\n format.html { redirect_to(correspondenciasasignadas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dossier = Dossier.find(params[:id])\n @dossier.destroy\n\n respond_to do |format|\n format.html { redirect_to(dossiers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @consult.destroy\n respond_to do |format|\n format.html { redirect_to admin_consults_url, notice: t('activerecord.models.consult')+'删除成功!' }\n format.json { head :no_content }\n end\n end",
"def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end",
"def destroy\n @genbank_file.destroy\n\n respond_to do |format|\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @feria2010observacion = Feria2010observacion.find(params[:id])\n @feria2010observacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(feria2010observaciones_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @incrustation_tmp = @incrustation.dup\n @incrustation.destroy\n record_activity(@incrustation_tmp)\n respond_to do |format|\n format.html { redirect_to admin_incrustations_url, notice: 'Вставка была успешно удалена.' }\n format.json { head :no_content }\n end\n end",
"def delete(id)\r\n connection.delete(\"/#{@doctype}[@ino:id=#{id}]\")\r\n end",
"def destroy\r\n @dcf = Dcf.find(params[:id])\r\n @dcf.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(dcfs_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\n @concert = Concert.find(params[:id])\n @concert.destroy\n\n respond_to do |format|\n format.html { redirect_to(concerts_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @rede = Rede.find(params[:id])\n @rede.destroy\n\n respond_to do |format|\n format.html { redirect_to(redes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @domino = Domino.find(params[:id])\n @domino.destroy\n\n respond_to do |format|\n format.html { redirect_to(dominos_url) }\n format.xml { head :ok }\n end\n end",
"def delete_data\n response = WebPay.client.delete([path, 'data'].join('/'))\n response['deleted']\n end",
"def destroy\n @designation.destroy\n\n respond_to do |format|\n format.html { redirect_to(designations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @derivative = Derivative.find(params[:id])\n @derivative.destroy\n\n respond_to do |format|\n format.html { redirect_to(derivatives_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @daily_grr = DailyGrr.find(params[:id])\n @daily_grr.destroy\n\n respond_to do |format|\n format.html { redirect_to(scaffold_daily_grrs_url) }\n format.xml { head :ok }\n end\n end",
"def maintenance_delete(statuspage_id, maintenance_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['maintenance_id'] = maintenance_id\n\n request :method => :post,\n :url => @url + 'maintenance/delete',\n :payload => data\n end",
"def destroy\n @transferencia_contas_detalhe = TransferenciaContasDetalhe.find(params[:id])\n @transferencia_contas_detalhe.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/transferencia_contas/#{@transferencia_contas_detalhe.transferencia_conta_id}\") }\n format.xml { head :ok }\n end\n end",
"def destroy\n @consultation.destroy\n respond_to do |format|\n format.html { redirect_to consultations_url, notice: 'Consultation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @revenu = @foyer.revenus.find(params[:id])\n @revenu.destroy\n\n respond_to do |format|\n format.html { redirect_to foyer_revenus_url(@foyer) }\n format.xml { head :ok }\n end\n end",
"def incident_delete(statuspage_id, incident_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['incident_id'] = incident_id\n\n request :method => :post,\n :url => @url + 'incident/delete',\n :payload => data\n end",
"def destroy\n @visarequest = Visarequest.find(params[:id])\n @visarequest.destroy\n\n respond_to do |format|\n format.html { redirect_to(visarequests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @helocagree = Helocagree.find(params[:id])\n @helocagree.destroy\n\n respond_to do |format|\n format.html { redirect_to(helocagrees_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @fixed_deposit = FixedDeposit.find(params[:id])\n @fixed_deposit.destroy\n\n respond_to do |format|\n format.html { redirect_to(fixed_deposits_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n request(:delete)\n end",
"def destroy\r\n @razdel1 = Razdel1.find(params[:id])\r\n @razdel1.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(razdel1s_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\n @concert = Concert.find(params[:id])\n @concert.destroy\n\n respond_to do |format|\n format.html { redirect_to(concerts_url, :notice=> 'Concert was deleted.') }\n format.xml { head :ok }\n end\n end",
"def destroy\r\n @asignacion = Asignacion.find(params[:id])\r\n @asignacion.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(asignacions_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\n @correspondence = Correspondence.find(params[:id])\n @correspondence.destroy\n\n respond_to do |format|\n format.html { redirect_to(correspondences_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @invier_acceso = InvierAcceso.find(params[:id])\n @invier_acceso.destroy\n\n respond_to do |format|\n format.html { redirect_to(invier_accesos_url) }\n format.xml { head :ok }\n end\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n @vendor_doc = VendorDoc.find(params[:id])\n @vendor_doc.destroy\n\n respond_to do |format|\n format.html { redirect_to(contract_vdocs_requirements_url(@vendor_doc.vdocs_requirement.contract)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @transaction_goods_taxis = Transaction::Goods::Taxe.find(params[:id])\n @transaction_goods_taxis.destroy\n\n respond_to do |format|\n format.html { redirect_to(transaction_goods_taxes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @feria2010beneficiario = Feria2010beneficiario.find(params[:id])\n @feria2010beneficiario.destroy\n\n respond_to do |format|\n format.html { redirect_to(feria2010beneficiarios_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @feefile = Feefile.find(params[:id])\n directory= \"uploads\"\n path =File.join(directory,@feefile.feefilename)\n File.delete(path)\n @feefile.destroy\n \n\n respond_to do |format|\n format.html { redirect_to(feefiles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @acre = Acre.find(params[:id])\n @acre.destroy\n\n respond_to do |format|\n format.html { redirect_to(acres_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dosage = Dosage.find(params[:id])\n @dosage.destroy\n\n respond_to do |format|\n format.html { redirect_to(dosages_url) }\n format.xml { head :ok }\n end\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def destroy\n @fee_record = FeeRecord.find(params[:id])\n @fee_record.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_fee_records_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @recommand = Recommand.find(params[:id])\n @recommand.destroy\n\n respond_to do |format|\n format.html { redirect_to(recommands_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @consult.destroy\n respond_to do |format|\n format.html { redirect_to consults_url, notice: 'Consult was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consult.destroy\n respond_to do |format|\n format.html { redirect_to consults_url, notice: 'Consult was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @recurso = Recurso.find(params[:id])\n @recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to(recursos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @certidao = Certidao.find(params[:id])\n @certidao.destroy\n\n respond_to do |format|\n format.html { redirect_to(certidaos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @donation_request = DonationRequest.find(params[:id])\n @donation_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(donation_requests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @invoice = Invoice.find(params[:id])\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoices_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @invoice = Invoice.find(params[:id])\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoices_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @invoice = Invoice.find(params[:id])\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoices_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @invoice = Invoice.find(params[:id])\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoices_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @invoice = Invoice.find(params[:id])\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoices_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @calidadtiposdocumento = Calidadtiposdocumento.find(params[:id])\n @calidadtiposdocumento.destroy\n\n respond_to do |format|\n format.html { redirect_to(calidadtiposdocumentos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @adjunto = Adjunto.find(params[:id])\n @adjunto.destroy\n\n respond_to do |format|\n format.html { redirect_to(adjuntos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @designationmaster = Designationmaster.find(params[:id])\n @designationmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(designationmasters_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @relatestagiario = Relatestagiario.find(params[:id])\n @relatestagiario.destroy\n\n respond_to do |format|\n format.html { redirect_to(relatestagiarios_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @upload_file = UploadFile.find(params[:id])\n doc_no=@upload_file.doc_no\n @upload_file.destroy\n\n respond_to do |format|\n format.html { redirect_to upload_files_url(:doc_no=>doc_no) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @religion = Religion.find(params[:id])\n @religion.destroy\n\n respond_to do |format|\n format.html { redirect_to(religions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\n @cita = Cita.find(params[:id])\n paciente_id=@cita.paciente_id\n Operation.delete_all \"cita_id = #{@cita.id}\"\n consulta=Consulta.find_by_cita_id(params[:id])\n consulta.update_attributes(:cita_id => nil)\n @cita.destroy\n \n respond_to do |format|\n format.html { redirect_to :controller => \"lab\",:action => \"crea_cita\",:id => paciente_id,:id_cons => consulta.id }\n format.xml { head :ok }\n end\n end",
"def destroy\n @consultum.destroy\n respond_to do |format|\n format.html { redirect_to consulta_url, notice: 'Consulta foi excluída com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @diagram = Diagram.find(params[:id])\n @diagram.destroy\n\n respond_to do |format|\n format.html { redirect_to(diagrams_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @recharge.destroy\n respond_to do |format|\n format.html { redirect_to recharges_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @feria2014beneficiario = Feria2014beneficiario.find(params[:id])\n @feria2014beneficiario.destroy\n\n respond_to do |format|\n format.html { redirect_to(feria2014beneficiarios_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @children_centre = ChildrenCentre.find(params[:id])\n @children_centre.destroy\n\n respond_to do |format|\n format.html { redirect_to(children_centres_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @arc = Arc.find(params[:id])\n @arc.destroy\n\n respond_to do |format|\n format.html { redirect_to(arcs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @donation = Donation.find(params[:id])\n @donation.destroy\n\n respond_to do |format|\n format.html { redirect_to(donations_url) }\n format.xml { head :ok }\n end\n end"
] |
[
"0.6980386",
"0.6904357",
"0.68982357",
"0.6822708",
"0.6690675",
"0.66335124",
"0.66335124",
"0.6594275",
"0.6512669",
"0.6512026",
"0.64318705",
"0.6375002",
"0.63468033",
"0.6345942",
"0.634269",
"0.633389",
"0.63335264",
"0.63291353",
"0.63254994",
"0.62756485",
"0.62653846",
"0.6253611",
"0.6221839",
"0.6218797",
"0.6214055",
"0.6212931",
"0.62115186",
"0.6193538",
"0.6192999",
"0.6192571",
"0.6192195",
"0.618776",
"0.6179506",
"0.6156791",
"0.61555755",
"0.61545384",
"0.61465406",
"0.61434937",
"0.6139115",
"0.61387646",
"0.6137969",
"0.6137442",
"0.6136636",
"0.6126802",
"0.6119988",
"0.6113575",
"0.6100602",
"0.6097904",
"0.6096215",
"0.60881686",
"0.6086197",
"0.60801",
"0.6077625",
"0.60729516",
"0.6069868",
"0.6069126",
"0.60664093",
"0.6064481",
"0.605322",
"0.60470086",
"0.6040402",
"0.6039863",
"0.60380185",
"0.60377824",
"0.60350055",
"0.60310614",
"0.60278827",
"0.6023989",
"0.60236895",
"0.6021172",
"0.60209405",
"0.60176736",
"0.6011977",
"0.60114175",
"0.6010376",
"0.6003157",
"0.5999378",
"0.5999378",
"0.5997939",
"0.5997931",
"0.59942937",
"0.599383",
"0.599383",
"0.599383",
"0.599383",
"0.599383",
"0.5993421",
"0.5989437",
"0.5985208",
"0.5981674",
"0.59794927",
"0.5969914",
"0.59697044",
"0.5968925",
"0.5967095",
"0.59639424",
"0.59600526",
"0.5954971",
"0.59533226",
"0.59531474"
] |
0.7276909
|
0
|
my_hash uses the literal constructor to create a hash that contains key/value pairs use the literal constructor to set the variable, my_hash, equal to a hash with key/value pairs of your choice.
|
def my_hash
my_name = {"name" => "Loren"}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def initialize hash\n @hash = hash\n end",
"def set_hash(hash, hash_type = 'SHA256')\n @hash = hash\n @hash_type = hash_type\n end",
"def initialize\n @h = new_hash\n end",
"def _hash=(_hash)\n if !_hash.nil? && _hash.to_s.length > 40\n fail ArgumentError, 'invalid value for \"_hash\", the character length must be smaller than or equal to 40.'\n end\n if !_hash.nil? && _hash.to_s.length < 40\n fail ArgumentError, 'invalid value for \"_hash\", the character length must be great than or equal to 40.'\n end\n @_hash = _hash\n end",
"def initialize(hash = nil)\n hash.each { |key, value| self[key] = value } if !hash.nil? && hash.is_a?(Hash)\n end",
"def hash=(_arg0); end",
"def initialize(hash)\n raise \"hash should be a Hash object #{hash.to_s}\" unless hash.is_a? Hash\n @hash = hash\n end",
"def initialize(a_hash)\n from_h(a_hash)\n end",
"def my_hash_creator(key, value)\n # return a hash that includes the key and value parameters passed into this method\n {key => value}\nend",
"def initialize\n @hash = {}\n end",
"def initialize\n @hash = {}\n end",
"def initialize(hash)\n @hash = hash\n @converted = {}\n end",
"def initialize(hash={})\n @hash = hash\n end",
"def new_hash(*args, &block)\n if block\n r = hash_class.new\n r.default = block\n r\n elsif args.size == 1\n value = args.first\n if value.is_a?(Hash) or value.is_a?(hash_class)\n r = hash_class.new\n r.putAll(value)\n r\n else\n r = hash_class.new\n r.default = value\n r\n end\n else\n r = hash_class.new\n args.each_slice(2) {|key,val| r.put(key,val)}\n r\n end\n end",
"def initialize( hash )\n\t\t\t@hash = hash.dup\n\t\t\t@dirty = false\n\t\tend",
"def initialize\n @hash_dict = {}\n end",
"def create_hash(&block); end",
"def create_hash(&block); end",
"def my_hash\n who_am_i = {\n name: \"Kelly\",\n age: \"31\",\n home: \"NYC\"\n }\nend",
"def initialize(hash)\n load_hash(hash)\n end",
"def test_hash_subclass\n h = MyHash.new\n h[:mine] = 'mine'\n custom_params = {:one => {:hash => {:a => :b}, :myhash => h}}\n nh = normalize_params(custom_params)\n myhash = custom_params[:one][:myhash]\n\n assert_equal MyHash, myhash.class\n myhash = nh[:one][:myhash]\n\n assert_equal Hash, myhash.class\n end",
"def initialize(initial_hash = {})\n # convert String keys to Symbol\n @object = {}\n initial_hash.each_pair do | key, value |\n if key.is_a?(String)\n @object[key.to_sym] = value\n else\n @object[key] = value\n end\n end\n end",
"def set hash\n hash.each_pair do |k,v|\n self.send(:\"#{k}=\", v)\n end\n \n self\n end",
"def initialize(hash={})\n @data = Hash.new\n hash.each do |key, value|\n self[key] = value\n end\n end",
"def new_hash\nHash.new\nend",
"def hash(key); end",
"def initialize(*args)\n @hash = HashWithIndifferentAccess.new(*args)\n end",
"def testResults(a_hash, name)\r\n\ta_hash[name] = Hash.new\r\n\ta_hash[name] = {\r\n\t\tmood: \"good\",\r\n\t\tloves: \"Mother\",\r\n\t\tage: \"24\",\r\n\t\tsmart: \"y\",\r\n\t\tmichael: \"y\",\r\n\t\tintrovert: \"extrovert\",\r\n\t\tcolor: \"green\",\r\n\t\tcandy: \"skittles\",\r\n\t\twants_candy: \"y\",\r\n\t\thappy: \"y\"\r\n\t}\r\nend",
"def initialize(hash, base_key, options_hash = {})\n self.options = options_hash\n\n @hash = hash\n @base_key = base_key\n end",
"def initialize(hash)\n @color = hash[:color]\n @scent = hash[:scent]\n end",
"def my_hash\n{:Artists => \"Beyonce\"}\nend",
"def this_hash(hash ={})\n puts \"The value is #{hash[:this_one]}\"\nend",
"def initialize(*args)\n super\n # hash = {}\n end",
"def cph(hash = nil, id = 'a')\n a = @store.new(PEROBS::Hash)\n a.replace(hash) unless hash.nil?\n @store[id] = a\n end",
"def initialize(hash, type, dump)\n self.hash = hash\n self.type = type.to_sym\n self.dump = dump\n end",
"def initialize(hash)\n hash.each do |k, v|\n self.send(\"#{k}=\", v) if self.respond_to?(\"#{k}=\")\n end\n @id = hash[\"id\"]\n end",
"def will_create_new_hash(**hash)\n hash[:x] = 10 # Change\n p hash\n p hash.object_id \nend",
"def new_from_hash(hash)\n if hash == nil\n self.class.new.assign(self)\n else\n hash_obj = hash\n if hash.instance_of?(Hash)\n hash_obj = self.class.new\n merge_hash_into_object(hash, hash_obj)\n end\n instance = self.class.new\n object_assign(instance, hash_obj)\n end\n end",
"def initialize(hash)\n @short_code = hash[\"short_code\"]\n @name = hash[\"name\"]\n @id = hash[\"id\"]\n end",
"def initialize(raw_hash)\n raise Errors::InvalidHash, 'invalid hash' unless valid_hash?(raw_hash)\n\n replace(raw_hash)\n\n @cost, @salt, @digest = split_hash(to_s)\n end",
"def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @cost, @salt, @digest = split_hash(self.to_s)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end",
"def hash(*) end",
"def initialize(hash)\n @hash = hash.dup\n @escape_asterisks = !@hash.delete(:*)\n end",
"def initialize(hash=nil)\n @table = HashWithIndifferentAccess.new\n\n for k,v in hash\n @table[k] = v\n new_ostruct_member(k)\n end if hash\n end",
"def initialize(hsh={})\n @values = {}\n hsh.each{ |k,v| self[k] = v}\n end",
"def initialize(hash={})\n # assign the attributes here (???)\n hash.each do |k, v| # name = id, name, etc.\n self.send(\"#{k}=\", v)\n # self.k = v # there's no '.k' method\n #binding.pry\n end\n end",
"def add(hash); end",
"def initialize\n\t\t\t@hash = {}\n\t\tend",
"def initialize (account_hash) #initialize is actually a class method\n @id = account_hash[:id].to_i\n @balance = account_hash[:initial_balance].to_i\n if @balance < 0\n raise ArgumentError.new(\"Nope.\")\n end\n @creation_date = account_hash[:creation_date] #these are the hash keys\n\n end",
"def initialize (hash)\n hash.each {|key, value|\n self.class.attr_accessor(key)\n self.send((\"#{key}=\"), value)\n }\n @@all << self\n end",
"def initialize(input_hash)\n unless input_hash.is_a? Hash\n raise ValidationError, \"Parameter `input_hash` supplied to #{self.class} must be of type Hash (#{input_hash.class}: #{input_hash.inspect})!\"\n end\n super input_hash\n validate!\n end",
"def test_hashify_regular_values\n test_obj = NewTest.new\n test_obj.name = 'sally'\n test_obj.age = 5\n generated_hash = test_obj.hashify\n\n assert_equal('sally', generated_hash[:name])\n assert_equal(5, generated_hash[:age])\n end",
"def initialize(hash)\n hash.each do |key, value|\n attribute = ATTRIBUTE_MAP[key.to_s]\n send(\"#{attribute}=\", value) if respond_to?(attribute)\n end\n end",
"def initialize(hash)\n hash.each do |key, value|\n self.__send__(\"#{key}=\", value)\n end\n raise ArgumentError if id.nil? || url.nil?\n end",
"def params=(hash); end",
"def params=(hash); end",
"def hash(*args, **_arg1, &block); end",
"def initialize(hash, cancellation_factor, sale_amount_factor)\n @hash = hash\n @cancellation_factor = cancellation_factor\n @sale_amount_factor = sale_amount_factor\n end",
"def initialize(namehash = {})\n\t\t@id = namehash[:id]\n\t\t@first_name = namehash[:first_name]\n\t\t@last_name = namehash[:last_name]\n\tend",
"def hash\r\n @_hash ||= _hash\r\n end",
"def hash\n { hash: @hash, hashType: @hash_type }\n end",
"def initialize(hash=nil)\n @attributes = hash\n @attributes ||= {}\n end",
"def hash_key(key, options = T.unsafe(nil)); end",
"def must_be_hash(hstr)\n hash = hstr.is_a?(String) ? eval(hstr) : hstr\n new_hash = Hash.new\n hash.each_pair { |k, v| new_hash[k.to_sym] = v }\n return new_hash\n end",
"def initialize(market_hash)\n @id = market_hash[:id]\n @name = market_hash[:name]\n @address = market_hash[:address]\n @city = market_hash[:city]\n @county = market_hash[:county]\n @state = market_hash[:state]\n @zip = market_hash[:zip]\n end",
"def initialize hash={}\n @hash = Hash.new\n\n hash.each do |key, value|\n key = key.to_sym unless key.is_a? Symbol\n @hash[key] = value\n end\n\n @hash.each do |name, node|\n @hash[name] = self.class.send(:__blobjectify__, node)\n end\n\n yield self if block_given?\n end",
"def initialize(hash)\r\n hash.each { |k, v|\r\n # Create getters and setters\r\n self.class.attr_accessor(k)\r\n # Set value for created variable\r\n self.send(\"#{k}=\", v)\r\n }\r\n self.class.all.push(self)\r\n end",
"def initialize(hash = {})\n hash.each {|k,v| self.send \"#{k.to_s}=\", v}\n @errors = {}\n end",
"def initialize( confighash={} )\n\t\tihash = internify_keys( untaint_values(confighash) )\n\t\tmergedhash = DEFAULTS.merge( ihash, &HashMergeFunction )\n\n\t\t@struct = ConfigStruct.new( mergedhash )\n\t\t@create_time = Time.now\n\t\t@name = nil\n\t\t@loader = nil\n\n\t\tsuper()\n\tend",
"def initialize(hash)\n super(hash)\n end",
"def to_hash(*_arg0); end",
"def initialize(name, to_h = nil, from_hash = nil)\n @name = name.to_sym\n @to_h = to_h\n @from_hash = from_hash\n end",
"def hash\n if @_hash.nil?\n @_hash = {}\n run\n end\n @_hash\n end",
"def load_hash(hash)\n @login = hash['login']\n @html_url = hash['html_url']\n @avatar_url = hash['avatar_url']\n @name = hash['name']\n @company = hash['company']\n @email = hash['email']\n end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def number_hash_def(no1: ,no2: ,no3: 10 )\n\t\t@n1 = no1\n\t\t@n2 = no2\n\t\t@n3 = no3\n\tend",
"def from_h(a_hash)\n a_hash.each_pair do |k, v|\n add k\n send(\"#{k}=\", v)\n end\n end",
"def initialize(hash)\n @hash = hash\n @data = resourcify_data\n end",
"def initialize(*h)\n if h.length == 1 && h.first.kind_of?(Hash)\n h.first.each { |k,v| send(\"#{k}=\",v) }\n end\n end",
"def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @version, @cost, @salt, @checksum = split_hash(self)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end",
"def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @version, @cost, @salt, @checksum = split_hash(self)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end",
"def hash_clear(myhash)\n\tempty_hash = {}\n\tmy_hash = {\"first\" => 1, \"second\" => 2, \"third\" => 3}\n\tmy_hash = {}\n\nend",
"def initialize()\n\t\t\t#set key by hash unique value\n\t\t\t@key = Digest::SHA1.hexdigest(Time.now.to_s)\n\t\tend",
"def initialize (hash)\n @name = hash [:name]\n @color = hash [:color]\n @robots = hash [:robots]\n @moon_count = hash [:moon_count]\n @cats = hash [:cats]\n #@solar_rotation = solar_rotation .....I dont really understand what a solar rotation is.... it's confusing.....\n @distance_from_the_sun = hash [:distance_from_the_sun]\n end"
] |
[
"0.68278867",
"0.6704111",
"0.6697266",
"0.64653933",
"0.6379613",
"0.63791376",
"0.6326546",
"0.63047826",
"0.62858886",
"0.6254126",
"0.6254126",
"0.6243375",
"0.62301403",
"0.622225",
"0.62056303",
"0.61594737",
"0.6151692",
"0.6151692",
"0.61068255",
"0.60926086",
"0.60856587",
"0.60781",
"0.60722214",
"0.6063263",
"0.6036658",
"0.59995747",
"0.5998701",
"0.5993717",
"0.59894425",
"0.5947909",
"0.5903585",
"0.5892287",
"0.58898157",
"0.58833516",
"0.5856933",
"0.5842182",
"0.5827519",
"0.58115",
"0.58104646",
"0.5798137",
"0.57938933",
"0.57802767",
"0.57682055",
"0.57681745",
"0.5756318",
"0.5747649",
"0.5720644",
"0.5716336",
"0.57058126",
"0.57020277",
"0.56932735",
"0.56895655",
"0.5667615",
"0.5666126",
"0.56594735",
"0.56594735",
"0.56571907",
"0.56560355",
"0.56542987",
"0.5649396",
"0.56239086",
"0.5620239",
"0.56195366",
"0.56145775",
"0.5607473",
"0.56014943",
"0.55985254",
"0.5598191",
"0.5592801",
"0.5592029",
"0.5581714",
"0.55547434",
"0.55492747",
"0.55310315",
"0.55310136",
"0.55310136",
"0.55310136",
"0.55310136",
"0.55310136",
"0.55310136",
"0.55310136",
"0.55310136",
"0.55310136",
"0.55310136",
"0.5530933",
"0.5530933",
"0.5530933",
"0.5530933",
"0.5530933",
"0.5530933",
"0.5530933",
"0.55242395",
"0.55129373",
"0.55061895",
"0.5502662",
"0.5500065",
"0.54995674",
"0.54962844",
"0.5493148",
"0.5479131"
] |
0.65267617
|
3
|
Challenge II: Hash with Data shipping_manifest returns a hash with key/value pairs describing oldtimey items set a variable called `the_manifest`, equal to a hash fill that hash with key/value pairs that describe the following information: We have 5 whale bone corsets, 2 porcelain vases and 3 oil paintings
|
def shipping_manifest
the_manifest = {"whale bone corsets" => 5, "porcelain vases" => 2, "oil paintings" => 3}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def shipping_manifest\n the_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\nend",
"def shipping_manifest\n shipping_manifest = {\n \"whale bone corsets\" => 5,\n \"porcelain vases\" => 2,\n \"oil paintings\" => 3\n }\nend",
"def shipping_manifest\n shipping_manifest = {\n \"whale bone corsets\" => 5,\n \"porcelain vases\" => 2,\n \"oil paintings\" => 3\n }\nend",
"def shipping_manifest\n the_manifest={\n\"whale bone corsets\" => 5,\n\"porcelain vases\" => 2,\n\"oil paintings\" => 3\n}\nthe_manifest\nend",
"def retrieval\n shipping_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n shipping_manifest[\"oil paintings\"]\nend",
"def adding\n shipping_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n shipping_manifest[\"muskets\"] = 2\n shipping_manifest[\"gun powder\"] = 4\n\n shipping_manifest\nend",
"def retrieval\n shipping_manifest = { \"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3 }\n\n shipping_manifest[\"oil paintings\"]\nend",
"def adding\n shipping_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n\n shipping_manifest[\"pearl necklace\"] = 1\n return shipping_manifest\nend",
"def adding\n shipping_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n \n shipping_manifest[\"pearl necklace\"] = 1\n return shipping_manifest\nend",
"def retrieval\n shipping_manifest = {\n \"whale bone corsets\" => 5,\n \"porcelain vases\" => 2,\n \"oil paintings\" => 3\n }\n shipping_manifest[\"oil paintings\"]\n\nend",
"def adding\n shipping_manifest = {\n \"whale bone corsets\" => 5, \n \"porcelain vases\" => 2, \n \"oil paintings\" => 3\n }\nshipping_manifest[\"muskets\"] = 2\nshipping_manifest[\"gun powder\"]= 4\nshipping_manifest\nend",
"def retrieval\n shipping_manifest = {\n \"whale bone corsets\" => 5, \n \"porcelain vases\" => 2, \n \"oil paintings\" => 3\n }\n \nshipping_manifest[\"oil paintings\"]\nend",
"def retrieval\n shipping_manifest = shipping_manifest = {\"whale bone corsets\" => 5,\"porcelain vases\" => 2,\"oil paintings\" => 3}\n return shipping_manifest[\"oil paintings\"]\nend",
"def retrieval\n shipping_manifest['oil paintings']\nend",
"def updated_manifest()\n new_app_manifest = JSON.parse(current.to_json) # a deep clone.\n #now let's update everything.\n new_mem = @application_json['resources']['memory'] unless @application_json['resources'].nil?\n new_app_manifest[:name] = @application_json['name']\n new_app_manifest['resources'] = Hash.new if new_app_manifest['resources'].nil?\n new_app_manifest['resources']['memory'] = new_mem unless new_mem.nil?\n unless @application_json['staging'].nil?\n new_app_manifest['staging'] = Hash.new if new_app_manifest['staging'].nil?\n new_app_manifest['staging']['model'] = @application_json['staging']['model'] unless @application_json['staging']['model'].nil?\n #new_app_manifest['staging']['framework'] = new_app_manifest['staging']['model']\n new_app_manifest['staging']['stack'] = @application_json['staging']['stack'] unless @application_json['staging']['stack'].nil?\n end\n new_app_manifest['uris'] = @application_json['uris'] unless @application_json['uris'].nil?\n new_app_manifest['services'] = @application_json['services'] unless @application_json['services'].nil?\n new_app_manifest['env'] = @application_json['env'] unless @application_json['env'].nil?\n if @application_json['meta']\n new_app_manifest['meta'] = Hash.new if new_app_manifest['meta'].nil?\n new_app_manifest['meta']['debug'] = @application_json['meta']['debug'] if @application_json['meta']['debug']\n new_app_manifest['meta']['restage_on_service_change'] = @application_json['meta']['restage_on_service_change'] if @application_json['meta']['restage_on_service_change']\n end\n new_app_manifest\n end",
"def hash\n [actor, artist, aspect_ratio, audience_rating, author, back_finding, band_material_type, binding, bluray_region, brand, cero_age_rating, chain_type, clasp_type, color, cpu_manufacturer, cpu_speed, cpu_type, creator, department, director, display_size, edition, episode_sequence, esrb_age_rating, feature, flavor, format, gem_type, genre, golf_club_flex, golf_club_loft, hand_orientation, hard_disk_interface, hard_disk_size, hardware_platform, hazardous_material_type, item_dimensions, is_adult_product, is_autographed, is_eligible_for_trade_in, is_memorabilia, issues_per_year, item_part_number, label, languages, legal_disclaimer, list_price, manufacturer, manufacturer_maximum_age, manufacturer_minimum_age, manufacturer_parts_warranty_description, material_type, maximum_resolution, media_type, metal_stamp, metal_type, model, number_of_discs, number_of_issues, number_of_items, number_of_pages, number_of_tracks, operating_system, optical_zoom, package_dimensions, package_quantity, part_number, pegi_rating, platform, processor_count, product_group, product_type_name, product_type_subcategory, publication_date, publisher, region_code, release_date, ring_size, running_time, shaft_material, scent, season_sequence, seikodo_product_code, size, size_per_pearl, small_image, studio, subscription_length, system_memory_size, system_memory_type, theatrical_release_date, title, total_diamond_weight, total_gem_weight, warranty, weee_tax_value].hash\n end",
"def hash\n [id, name, based_on, custom_calendar, default_flag, application_order, hi_impact_hi_urgency, hi_impact_med_urgency, hi_impact_low_urgency, med_impact_hi_urgency, med_impact_med_urgency, med_impact_low_urgency, low_impact_hi_urgency, low_impact_med_urgency, low_impact_low_urgency, respond_hours, respond_percent, plan_within, plan_within_percent, resolution_hours, resolution_percent, _info].hash\n end",
"def hash\n [system_id, policy, registration_type, name, acronym, system_owner, organization_name, version_release_no, system_type, authorization_status, authorization_date, authorization_termination_date, confidentiality, integrity, availability, ditpr_id, ditpr_don_id, mac, dod_confidentiality, contingency_plan_tested, contingency_plan_test_date, security_review_date, has_open_poam_item, has_open_poam_item90to120_past_scheduled_completion_date, has_open_poam_item120_plus_past_scheudled_completion_date].hash\n end",
"def hash\n [airline_data, amount, avs_postcode_policy, bill_to, card_holder_name, cardnumber, csc, csc_policy, currency, duplicate_policy, expmonth, expyear, external_mpi, identifier, match_avsa, mcc6012, merchantid, sdk, ship_to, threedsecure, trans_info, trans_type].hash\n end",
"def hash\n [active, category_id, category_specifics, condition_description, condition_id, consecutive_failures, custom_category1, custom_category2, dispatch_time_max, domestic_1_additional_cost, domestic_1_first_cost, domestic_2_additional_cost, domestic_2_first_cost, domestic_3_additional_cost, domestic_3_first_cost, domestic_4_additional_cost, domestic_4_first_cost, ebay_auction_id, ebay_specific_inventory, ebay_template_name, ebay_template_oid, end_time, free_shipping, free_shipping_method, international_1_additional_cost, international_1_first_cost, international_2_additional_cost, international_2_first_cost, international_3_additional_cost, international_3_first_cost, international_4_additional_cost, international_4_first_cost, last_status_dts, listed_dispatch_time_max, listed_ebay_template_oid, listing_dts, listing_duration, listing_price, listing_price_override, listing_type, marketplace_analysis, marketplace_analysis_perform, marketplace_final_value_fee_percentage, marketplace_last_check_dts, marketplace_lowest, marketplace_map_violation, marketplace_multiplier, marketplace_other_price, marketplace_other_seller, marketplace_other_shipping, marketplace_other_total, marketplace_our_additional_profit_potential, marketplace_our_price, marketplace_our_profit, marketplace_our_shipping, marketplace_our_total, marketplace_overhead, marketplace_profitable, next_attempt_dts, next_listing_duration, no_promotional_shipping, packaging_handling_costs, previous_ebay_auction_id, quantity, reserve_price, send_dimensions_and_weight, start_time, status, target_dispatch_time_max].hash\n end",
"def random_reviews_hash\n\t\t[{title: \"Pretty decent, could have been better\", stars: 4, summary: \"This chair arrived well-packaged and protected with a lot of foam insulation around the wheels and metal components. Assembly was quick and simple, as I didn't even need the instructions. All you have to do is put the air lift on the base and place the seat on the air lift, then it's ready to go. The chair has great lumbar support and reaches all the way up to my head, allowing me to rest entirely against it. It's also fairly comfortable, having a few inches of padding, while not being too compliant so as to lack support, making for a pretty good balance that I particularly like. The air lift lever (for raising/lowering the height of the chair) is designed so that when pushed in the chair cannot recline, but if you pull it out slightly, it releases a mechanical lock and allows the chair to recline back about 20-30 degrees.\"},\n\t\t{title: \"Got exactly what I needed and more!\", stars: 5, summary: \"Customer Service: We often encounter a customer service rep who has had a bad day or just does not care or any of the negative phrases that make us some reps. This is absolutely NOT the case with the folks at BOSS. After opening the box and putting it together (a feat accomplished by anyone who can lift a sack of potatoes) I could not get the gas cylinder to raise the seat level. One of us is 5'6\\\" and the other is 6'3\\\" and the seat is either too high or too low unless the gas cylinder works. It did not. \n\n\t\t\t\tIt was too late to call and it was Thanksgiving eve. Even if anyone had been home I would have waited until Frantic Friday to call. So I emailed my concern and expected no reply until today or maybe tomorrow. On Friday, the 26th, the height adjustment absence was just too much to endure. A call was placed to BOSS and a woman told me exactly what to do and I did. Closed case. Wow! I did suggest that the instructions would benefit from her advice in future iterations. Regardless, my problem was settled in seconds and when I finally got to reviewing my email I saw a response from BOSS saying the same thing. Let's all give a big shout to BOSS for fantastic service.\"\n\t\t},\n\t\t{title: \"Quick, Easy, and Fast!\", stars: 4, summary: \"The chair leans back which is nice. Doesn't seem to have too much lean which i don't really like but it's enough to put my feet up on my sub woofer. The leather is very nice quality and it has a built-in lumbar support which feels nice. My only issue with the chair was the first chair i sat in it and a bolt sheered off. But i told amazon and they had my new chair their the next day (same as what i paid for to ship it originally) and they had a ups man there the next day to pick up the broken chair. After that the chair has been flawless and very comfortable. The leather feels less cheap then the leather on my old chair.\"\n\t\t\t},\n\t\t\t{title: \"Bad Overall Experience\", stars: 2 , summary: \"This chair is nicely built. It looks elegant and cool. It is easy to clean.\n\t\t\t\tThe problem for me is that this is too big.\n\t\t\t\tI am male, 170 cm, 56 kg, that is about 5 foot 7 inches and 123 pounds. I don't feel very comfortable in this chair especially due to the armrest. The armrest is just a few centimeters too high, it pushes my elbow up, and that's annoying.\n\t\t\t\tThe part where you sit on is very large, and I seem to \\\"sink\\\" inside it, which worsens the armrest problem.\n\t\t\t\tBut I think if you are taller, this should be good. It will be even better if you are both taller and fatter. Maybe if I were 180cm(5 foot 11 inches) 85kg(188 pounds), this chair would be perfect.\" },\n\t\t\t\t\t\t\t{title: \"Worse Lender In Dojo!\", stars: 1, summary: \"First the positives:\n\n\t\t\t\t* This is the easiest chair I've ever put together. Simply unfold the chair back and the seat, which come pre-attached along with the arms, until they lock together. Next, place the gas cylinder firmly into the chair base and snap the 5 wheels onto the bottom. Finally, slide the gas cylinder/base into the seat bottom. It's completely tool-less and takes minutes.\n\n\t\t\t\t* The chair itself is pretty comfortable. It fit my back perfectly and was firm enough to give support while being soft enough to sit for extended periods.\n\n\t\t\t\t* Contrary to what other reviewers say, this chair can lean back. Just slide the height adjustment lever in towards the chair to lock the back in place, or slide it out to allow the chair to lean backwards.\"\n\t\t},\n\t\t{title: \"The Best Lender In the Dojo!\", stars: 5, summary: \"Purchased this chair once before on July 26, 2012. Was happy with the chair and the material that was used. This time the material was totally different. Very Cheap, so called Leather Plus..................... Very Cheap. In the description it does say Leather Plus but in the details as this is how it is described, below. I copied and pasted the information. It is not Leather............. Don't be fooled and it feels and looks very cheap. This material is totally different from the purchase in the past. If it were the same as the first chair I bought, I would have been happy. It was discribe to be the exact same and was not............ I don't write many reviews and I shop a lot with Amazon and this time I am a very unhappy shopper. Beware of this cheap chair...........................................\"\n\t\t},\n\t\t{title: \"Very good experience\", stars: 4, summary: \"This chair was packed sufficiently, arrived quickly, and was easy to assemble (5mins, no tools). The chair is comfortable, but I'll have to either turn my A/C colder or wear a shirt (I work at home) because this material either makes me sweat a lot more, or it just shows up more.\"\n\t\t},\n\t\t{title: \"Experienced teach, but always late\", stars: 2, summary: \"Update: after less that 1 year of use, this chair's piston is giving out. It rises on it's own, and I have to lower the chair every time I sit in it. It even rises slowly while I am in it, causing me to have to constantly lower it again. CHEAP CRAP!!!\"\n\t\t}].sample\n\tend",
"def hash\n [activity_id, blueprint_id, blueprint_location_id, blueprint_type_id, completed_character_id, completed_date, cost, duration, end_date, facility_id, installer_id, job_id, licensed_runs, output_location_id, pause_date, probability, product_type_id, runs, start_date, station_id, status, successful_runs].hash\n end",
"def hash\n [accounting_code, activation_codes, arbitrary_unit_cost, auto_order_last_rebill_dts, auto_order_schedule, barcode, channel_partner_item_id, cogs, component_unit_value, cost, country_code_of_origin, customs_description, description, discount, discount_quantity, discount_shipping_weight, distribution_center_code, edi, exclude_coupon, free_shipping, hazmat, height, item_index, item_reference_oid, kit, kit_component, length, manufacturer_sku, max_days_time_in_transit, merchant_item_id, mix_and_match_group_name, mix_and_match_group_oid, no_shipping_discount, options, packed_by_user, parent_item_index, parent_merchant_item_id, perishable_class, pricing_tier_name, properties, quantity, quantity_refunded, quickbooks_class, refund_reason, return_reason, ship_separately, shipped_by_user, shipped_dts, shipping_status, special_product_type, tags, tax_free, tax_product_type, taxable_cost, total_cost_with_discount, total_refunded, transmitted_to_distribution_center_dts, unit_cost_with_discount, upsell, weight, width].hash\n end",
"def hash\n [admin_flag, allow_expenses_entered_against_companies_flag, allow_in_cell_entry_on_time_sheet, billable_forecast, calendar, calendar_sync_integration_flag, country, daily_capacity, days_tolerance, default_department_id, default_email, default_location_id, default_phone, disable_online_flag, enable_ldap_authentication_flag, enable_mobile_flag, enable_mobile_gps_flag, enter_time_against_company_flag, expense_approver, first_name, hide_member_in_dispatch_portal_flag, hire_date, home_email, home_extension, home_phone, hourly_cost, hourly_rate, id, identifier, inactive_date, inactive_flag, include_in_utilization_reporting_flag, last_login, last_name, license_class, mapi_name, middle_initial, minimum_hours, mobile_email, mobile_extension, mobile_phone, notes, office_email, office_extension, office_phone, project_default_board, project_default_department_id, project_default_location_id, reports_to, require_expense_entry_flag, require_start_and_end_time_on_time_entry_flag, require_time_sheet_entry_flag, restrict_default_sales_territory_flag, restrict_default_warehouse_bin_flag, restrict_default_warehouse_flag, restrict_department_flag, restrict_location_flag, restrict_project_default_department_flag, restrict_project_default_location_flag, restrict_schedule_flag, restrict_service_default_department_flag, restrict_service_default_location_flag, sales_default_location_id, schedule_capacity, schedule_default_department_id, schedule_default_location_id, security_level, security_location_id, security_role, service_default_board, service_default_department_id, service_default_location_id, service_location, service_teams, time_approver, time_reminder_email_flag, time_sheet_start_date, time_zone, title, type, vendor_number, warehouse, warehouse_bin, work_role, work_type, _info, system_flag].hash\n end",
"def inventory_hash(older, newer)\n newer.each do |key, value|\n older[key] = value\n end\n older\nend",
"def hash\n [id, title, image, image_type, servings, ready_in_minutes, license, source_name, source_url, spoonacular_source_url, aggregate_likes, health_score, spoonacular_score, price_per_serving, analyzed_instructions, cheap, credits_text, cuisines, dairy_free, diets, gaps, gluten_free, instructions, ketogenic, low_fodmap, occasions, sustainable, vegan, vegetarian, very_healthy, very_popular, whole30, weight_watcher_smart_points, dish_types, extended_ingredients, summary, wine_pairing].hash\n end",
"def hash\n [accounting, amember, auto_order, ccbill, channel_partner_item_mappings, chargeback, checkout, content, creation_dts, description, description_translated_text_instance_oid, digital_delivery, ebay, email_notifications, enrollment123, fulfillment_addons, gift_certificate, google_product_search, identifiers, inactive, instant_payment_notifications, internal, kit, kit_component_only, kit_definition, last_modified_dts, merchant_id, merchant_item_id, merchant_item_oid, options, parent_category_id, parent_category_path, payment_processing, physical, pricing, properties, realtime_pricing, recommend_replenishment_days, related, reporting, restriction, revguard, reviews, salesforce, shipping, tags, tax, third_party_email_marketing, variant_items, variations, wishlist_member].hash\n end",
"def hash\n [seller_fulfillment_order_id, marketplace_id, displayable_order_id, displayable_order_date, displayable_order_comment, shipping_speed_category, delivery_window, destination_address, fulfillment_action, fulfillment_policy, cod_settings, received_date, fulfillment_order_status, status_updated_date, notification_emails, feature_constraints].hash\n end",
"def hash\n [aperture_value, body_serial_number, brightness_value, cfa_pattern, camera_owner_name, color_space, components_configuration, compressed_bits_per_pixel, contrast, custom_rendered, date_time_digitized, date_time_original, device_setting_description, digital_zoom_ratio, exif_version, exposure_bias_value, exposure_index, exposure_mode, exposure_program, exposure_time, f_number, file_source, flash, flash_energy, flashpix_version, focal_length, focal_length_in35_mm_film, focal_plane_resolution_unit, focal_plane_x_resolution, focal_plane_y_resolution, gps_altitude, gps_altitude_ref, gps_area_information, gpsdop, gps_dest_bearing, gps_dest_bearing_ref, gps_dest_distance, gps_dest_distance_ref, gps_dest_latitude, gps_dest_latitude_ref, gps_dest_longitude, gps_dest_longitude_ref, gps_differential, gps_img_direction, gps_img_direction_ref, gps_date_stamp, gps_latitude, gps_latitude_ref, gps_longitude, gps_longitude_ref, gps_map_datum, gps_measure_mode, gps_processing_method, gps_satellites, gps_speed, gps_speed_ref, gps_status, gps_timestamp, gps_track, gps_track_ref, gps_version_id, gain_control, gamma, iso_speed, iso_speed_latitude_yyy, iso_speed_latitude_zzz, photographic_sensitivity, image_unique_id, lens_make, lens_model, lens_serial_number, lens_specification, light_source, maker_note_raw_data, max_aperture_value, metering_mode, oecf, pixel_x_dimension, pixel_y_dimension, recommended_exposure_index, related_sound_file, saturation, scene_capture_type, scene_type, sensing_method, sensitivity_type, sharpness, shutter_speed_value, spatial_frequency_response, spectral_sensitivity, standard_output_sensitivity, subject_area, subject_distance, subject_distance_range, subject_location, subsec_time, subsec_time_digitized, subsec_time_original, user_comment, white_balance, white_point].hash\n end",
"def hash\n [allocated_to_placed_orders, allocated_to_shopping_carts, available_to_allocate, cogs, desired_inventory_level, distribution_center_code, distribution_center_oid, eta, handles, inventory_level, maximum_backorder, reorder_inventory_level, sku, stock_picking_location].hash\n end",
"def hash\n [is_blueprint_copy, is_included, item_id, material_efficiency, quantity, record_id, runs, time_efficiency, type_id].hash\n end",
"def get_shakey \n {\"William Shakespeare\"=>{\"1\"=>{\"title\"=>\"The Two Gentlemen of Verona\", \"finished\"=>1591}, \"2\"=>{\"title\"=>\"The Taming of the Shrew\", \"finished\"=>1591}, \"3\"=>{\"title\"=>\"Henry VI, Part 2\", \"finished\"=>1591}, \"4\"=>{\"title\"=>\"Henry VI, Part 3\", \"finished\"=>1591}, \"5\"=>{\"title\"=>\"Henry VI, Part 1\", \"finished\"=>1592}, \"6\"=>{\"title\"=>\"Titus Andronicus\", \"finished\"=>1592}, \"7\"=>{\"title\"=>\"Richard III\", \"finished\"=>1593}, \"8\"=>{\"title\"=>\"Edward III\", \"finished\"=>1593}, \"9\"=>{\"title\"=>\"The Comedy of Errors\", \"finished\"=>1594}, \"10\"=>{\"title\"=>\"Love's Labour's Lost\", \"finished\"=>1595}, \"11\"=>{\"title\"=>\"Love's Labour's Won\", \"finished\"=>1596}, \"12\"=>{\"title\"=>\"Richard II\", \"finished\"=>1595}, \"13\"=>{\"title\"=>\"Romeo and Juliet\", \"finished\"=>1595}, \"14\"=>{\"title\"=>\"A Midsummer Night's Dream\", \"finished\"=>1595}, \"15\"=>{\"title\"=>\"King John\", \"finished\"=>1596}, \"16\"=>{\"title\"=>\"The Merchant of Venice\", \"finished\"=>1597}, \"17\"=>{\"title\"=>\"Henry IV, Part 1\", \"finished\"=>1597}, \"18\"=>{\"title\"=>\"The Merry Wives of Windsor\", \"finished\"=>1597}, \"19\"=>{\"title\"=>\"Henry IV, Part 2\", \"finished\"=>1598}, \"20\"=>{\"title\"=>\"Much Ado About Nothing\", \"finished\"=>1599}, \"21\"=>{\"title\"=>\"Henry V\", \"finished\"=>1599}, \"22\"=>{\"title\"=>\"Julius Caesar\", \"finished\"=>1599}, \"23\"=>{\"title\"=>\"As You Like It\", \"finished\"=>1600}, \"24\"=>{\"title\"=>\"Hamlet\", \"finished\"=>1601}, \"25\"=>{\"title\"=>\"Twelfth Night\", \"finished\"=>1601}, \"26\"=>{\"title\"=>\"Troilus and Cressida\", \"finished\"=>1602}, \"27\"=>{\"title\"=>\"Sir Thomas More\", \"finished\"=>1604}, \"28\"=>{\"title\"=>\"Measure for Measure\", \"finished\"=>1604}, \"29\"=>{\"title\"=>\"Othello\", \"finished\"=>1604}, \"30\"=>{\"title\"=>\"All's Well That Ends Well\", \"finished\"=>1605}, \"31\"=>{\"title\"=>\"King Lear\", \"finished\"=>1606}, \"32\"=>{\"title\"=>\"Timon of Athens\", \"finished\"=>1606}, \"33\"=>{\"title\"=>\"Macbeth\", \"finished\"=>1606}, \"34\"=>{\"title\"=>\"Antony and Cleopatra\", \"finished\"=>1606}, \"35\"=>{\"title\"=>\"Pericles, Prince of Tyre\", \"finished\"=>1608}, \"36\"=>{\"title\"=>\"Coriolanus\", \"finished\"=>1608}, \"37\"=>{\"title\"=>\"The Winter's Tale\", \"finished\"=>1611}, \"38\"=>{\"title\"=>\"Cymbeline\", \"finished\"=>1610}, \"39\"=>{\"title\"=>\"The Tempest\", \"finished\"=>1611}, \"40\"=>{\"title\"=>\"Cardenio\", \"finished\"=>1613}, \"41\"=>{\"title\"=>\"Henry VIII\", \"finished\"=>1613}, \"42\"=>{\"title\"=>\"The Two Noble Kinsmen\", \"finished\"=>1614}}}\nend",
"def hash\n [click_rate_formatted, created_dts, deleted, email_campaign_uuid, email_communication_sequence_uuid, end_once_customer_purchases, end_once_customer_purchases_anywhere, esp_campaign_folder_uuid, esp_domain_user, esp_domain_uuid, esp_friendly_name, library_item_oid, memberships, merchant_id, name, open_rate_formatted, prevent_sending_due_to_spam, revenue_formatted, revenue_per_customer_formatted, scheduled_dts, screenshot_large_full_url, sms_esp_twilio_uuid, sms_phone_number, status, status_dts, storefront_oid].hash\n end",
"def hash\n [customer_membership_package_id, membership_package_id, membership_package_name, driving_credit, membership_period, membership_fee, application_fee, account_setup_fee, billing_period].hash\n end",
"def hash\n [adwords_grouping, adwords_label1, adwords_label2, adwords_label3, adwords_label4, adwords_label5, age_group, available_at_physical_store, book_author, book_format, book_isbn, book_publisher, category_description, color, condition, custom_label0, custom_label1, custom_label2, custom_label3, custom_label4, gender, google_product_category, music_artist, music_format, music_release_date, omit_from_feed, product_type, promotion_id1, promotion_id10, promotion_id2, promotion_id3, promotion_id4, promotion_id5, promotion_id6, promotion_id7, promotion_id8, promotion_id9, search_dts, search_lowest_price, search_lowest_url, search_position, shipping_label, size, video_director, video_format, video_rating, video_release_date, video_starring].hash\n end",
"def hash\n [marketplace_technical_code, account_id, beez_up_order_id, beez_up_order_url, marketplace_business_code, order_marketplace_order_id, order_status_beez_up_order_status, order_status_marketplace_order_status, order_merchant_order_id, order_merchant_e_commerce_software_name, order_merchant_e_commerce_software_version, order_purchase_utc_date, order_last_modification_utc_date, order_marketplace_last_modification_utc_date, order_buyer_name, order_total_price, order_currency_code, processing, etag, links, order_market_place_channel, order_total_tax, order_total_commission, order_payment_method, order_paying_utc_date, order_comment, order_shipping_civility, order_shipping_company_name, order_shipping_address_name, order_shipping_email, order_shipping_address_line1, order_shipping_address_line2, order_shipping_address_line3, order_shipping_address_postal_code, order_shipping_address_city, order_shipping_address_state_or_region, order_shipping_address_country_name, order_shipping_address_country_iso_code_alpha2, order_shipping_phone, order_shipping_mobile_phone, order_shipping_price, order_shipping_method, order_shipping_shipping_tax, order_shipping_earliest_ship_utc_date, order_shipping_latest_ship_utc_date, order_buyer_identifier, order_buyer_civility, order_buyer_company_name, order_buyer_email, order_buyer_address_line1, order_buyer_address_line2, order_buyer_address_line3, order_buyer_address_postal_code, order_buyer_address_city, order_buyer_address_state_or_region, order_buyer_address_country_name, order_buyer_address_country_iso_code_alpha2, order_buyer_phone, order_buyer_mobile_phone, order_order_source_uri, order_order_items_source_uri, order_items, transition_links].hash\n end",
"def passing_hash(stats_xml, passing_yards_xml)\n {\n attempts: stats_xml[:att].to_i,\n completions: stats_xml[:cmp].to_i,\n average: stats_xml[:avg].to_f,\n int: stats_xml[:int].to_i,\n sacks: stats_xml[:sack].to_i,\n yards: {\n net: passing_yards_xml[:net_yds].to_f,\n gross: passing_yards_xml[:gross_yds].to_f,\n sack: passing_yards_xml[:sack_yds].to_f\n }\n }\n end",
"def full_schematics_hash\n\n def sub_weight_and_cost(subs, item, do_item = true)\n if subs.blank?\n wgt = item.weight\n cost = item.vendor_sell_price\n build = item.crafting_seconds\n else\n wgt = cost = build = 0\n subs.each_value do |sub|\n wgt += sub[:wgt].to_f * sub[:qty].to_f\n cost += sub[:cost].to_f * sub[:qty].to_f\n build += sub[:build].to_f * sub[:qty].to_f\n end\n end\n result = {:wgt => wgt, :cost => cost, :build => build}\n if item and do_item\n result.merge(:item => item, :item_id => item.id)\n else\n result\n end\n end\n\n def item_assembley(item_schematic, level, items, assemblies, level_info = true)\n unless assemblies[item_schematic.item_id].blank?\n assembley = assemblies[item_schematic.item_id].inject({}) do |subs, schematic|\n comp_hash = component_to_hash(schematic, level, items)\n unless assemblies[schematic.item_id].blank?\n comp_hash.merge!( item_assembley(schematic, level + 1, items, assemblies, false) )\n #item has subs...cost and wgt and recalc based on subs\n comp_hash.merge!( sub_weight_and_cost(comp_hash[:assembley], nil, false) )\n end\n subs.merge(schematic.id => comp_hash)\n end\n end\n if level_info && items[item_schematic.item_id]\n result = sub_weight_and_cost(assembley, items[item_schematic.item_id] )\n result[:qty] = item_schematic.qty\n else\n result = {}\n end\n result[:assembley] = assembley unless assembley.nil?\n result #return it\n end\n\n def component_to_hash(item_schematic, level, items)\n {\n :item_schematic_id => item_schematic.id,\n :item_id => item_schematic.item_id, #TODO not need once we have item obj\n :level => level,\n :qty => item_schematic.qty,\n }.merge(sub_weight_and_cost(nil, items[item_schematic.item_id]))\n end\n #item knows what assembleys make its schematic... load all ItemSchematic by assemblies\n item_components = assemblies.blank? ? [] : ItemSchematic.by_assemblies(assemblies)\n #build lookup tables\n assemblies = item_components.inject({}) do |asses, component|\n if asses[component.root_item_id].nil?\n asses.merge(component.root_item_id => [component])\n else\n asses.merge(component.root_item_id => (asses[component.root_item_id] << component))\n end\n end\n #item_components is the complete schematic... extract all items from schematic for x-reference\n all_items = (item_components.collect{|s| s.item_id} + item_components.collect{|s| s.root_item_id}).uniq\n refed_items = Item.find(all_items).inject({}) do |items, item|\n items.merge(item.id => item)\n end\n #iterate through item_components array and build full schematic hash\n full_assembley = schematic_roots.inject({}) do |full_schematic, item_schematic|\n full_schematic.merge( item_schematic.id => item_assembley(item_schematic, 1, refed_items, assemblies) )\n end\n #final step.. construct full assembley (including top level item) and calc costs, weight\n {:assembley => full_assembley}.merge(sub_weight_and_cost(full_assembley, self))\n end",
"def hash\n [additional_contact_billing_id, additional_contact_billing_is_primary, additional_contact_billing_name, additional_contact_executive_sponsor_id, additional_contact_executive_sponsor_is_primary, additional_contact_executive_sponsor_name, additional_contact_hiring_manager_id, additional_contact_hiring_manager_is_primary, additional_contact_hiring_manager_name, additional_contact_internal_recruiter_id, additional_contact_internal_recruiter_is_primary, additional_contact_internal_recruiter_name, additional_contact_other_id, additional_contact_other_is_primary, additional_contact_other_name, attachments, created_by_id, created_by_name, created_on, expected_value, external_email_address, id, job_code, last_activity_date, last_engagement_date, modified_by_id, modified_by_name, modified_on, owners, status_id, status_name, time_to_close, actual_value, additional_contact_client_first_name, additional_contact_client_id, additional_contact_client_is_primary, additional_contact_client_last_name, address_business_city, address_business_country, address_business_is_primary, address_business_line1, address_business_state, address_business_zip_code, address_other_city, address_other_country, address_other_is_primary, address_other_line1, address_other_state, address_other_zip_code, bill_rate, bonus, commission, company_id, company_name, compensation, compensation_details, custom_field1, custom_field10, custom_field11, custom_field12, custom_field13, custom_field14, custom_field15, custom_field16, custom_field17, custom_field18, custom_field19, custom_field2, custom_field20, custom_field21, custom_field22, custom_field23, custom_field24, custom_field25, custom_field26, custom_field27, custom_field28, custom_field29, custom_field3, custom_field30, custom_field4, custom_field5, custom_field6, custom_field7, custom_field8, custom_field9, description, discount, estimated_close_date, external_primary_key, fee, fee_percent, hourly_rate, is_lead, is_on_hold, job_title_id, job_title_name, job_types, lead_source_id, lead_source_name, margin, name, number_of_openings, opportunity_type_id, opportunity_type_name, parent_job_id, parent_job_name, pay_rate, potential_value, priority_id, priority_name, probability, salary, start_date, tags, total_hours, website_description, website_description_is_primary, website_other, website_other_is_primary].hash\n end",
"def populate_manifest_data(manifest_parameters:)\n add_ingest_date(storage_manifest: manifest_parameters.storage_manifest,\n ingest_manifest: manifest_parameters.ingest_manifest)\n end",
"def addBlankPlayer(retrosheet_id, hash)\n perfs = Hash.new\n perfs[\"career_games\"] = 0.0\n \n perfs[\"at_bats_last_1_game\"] = [0]\n perfs[\"at_bats_last_2_games\"] = [0, 0]\n perfs[\"at_bats_last_5_games\"] = [0, 0, 0, 0, 0]\n perfs[\"at_bats_last_10_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"at_bats_last_20_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"career_at_bats\"] = 0.0\n \n perfs[\"walks_last_1_game\"] = [0]\n perfs[\"walks_last_2_games\"] = [0, 0]\n perfs[\"walks_last_5_games\"] = [0, 0, 0, 0, 0]\n perfs[\"walks_last_10_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"walks_last_20_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"career_walks\"] = 0\n \n perfs[\"hits_last_1_game\"] = [0]\n perfs[\"hits_last_2_games\"] = [0, 0]\n perfs[\"hits_last_5_games\"] = [0, 0, 0, 0, 0]\n perfs[\"hits_last_10_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"hits_last_20_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"career_hits\"] = 0\n \n perfs[\"strikeouts_last_1_game\"] = [0]\n perfs[\"strikeouts_last_2_games\"] = [0, 0]\n perfs[\"strikeouts_last_5_games\"] = [0, 0, 0, 0, 0]\n perfs[\"strikeouts_last_10_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"strikeouts_last_20_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"career_strikeouts\"] = 0\n \n \n perfs[\"total_bases_last_1_game\"] = [0]\n perfs[\"total_bases_last_2_games\"] = [0, 0]\n perfs[\"total_bases_last_5_games\"] = [0, 0, 0, 0, 0]\n perfs[\"total_bases_last_10_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"total_bases_last_20_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"career_total_bases\"] = 0\n \n hash[retrosheet_id] = perfs\nend",
"def wrestler_hash_output\n\t\twrestler_hash_output = self.values\n\n\t\twrestler_hash_output[\"name\"] = wrestler_hash_output.delete :name\n\t\twrestler_hash_output[\"set\"] = wrestler_hash_output.delete :set\n\n\t\twrestler_hash_output[\"gc02\"] = wrestler_hash_output.delete :gc02\n\t\twrestler_hash_output[\"gc03\"] = wrestler_hash_output.delete :gc03\n\t\twrestler_hash_output[\"gc04\"] = wrestler_hash_output.delete :gc04\n\t\twrestler_hash_output[\"gc05\"] = wrestler_hash_output.delete :gc05\n\t\twrestler_hash_output[\"gc06\"] = wrestler_hash_output.delete :gc06\n\t\twrestler_hash_output[\"gc07\"] = wrestler_hash_output.delete :gc07\n\t\twrestler_hash_output[\"gc08\"] = wrestler_hash_output.delete :gc08\n\t\twrestler_hash_output[\"gc09\"] = wrestler_hash_output.delete :gc09\n\t\twrestler_hash_output[\"gc10\"] = wrestler_hash_output.delete :gc10\n\t\twrestler_hash_output[\"gc11\"] = wrestler_hash_output.delete :gc11\n\t\twrestler_hash_output[\"gc12\"] = wrestler_hash_output.delete :gc12\n\n\t\twrestler_hash_output[\"dc02\"] = wrestler_hash_output.delete :dc02\n\t\twrestler_hash_output[\"dc03\"] = wrestler_hash_output.delete :dc03\n\t\twrestler_hash_output[\"dc04\"] = wrestler_hash_output.delete :dc04\n\t\twrestler_hash_output[\"dc05\"] = wrestler_hash_output.delete :dc05\n\t\twrestler_hash_output[\"dc06\"] = wrestler_hash_output.delete :dc06\n\t\twrestler_hash_output[\"dc07\"] = wrestler_hash_output.delete :dc07\n\t\twrestler_hash_output[\"dc08\"] = wrestler_hash_output.delete :dc08\n\t\twrestler_hash_output[\"dc09\"] = wrestler_hash_output.delete :dc09\n\t\twrestler_hash_output[\"dc10\"] = wrestler_hash_output.delete :dc10\n\t\twrestler_hash_output[\"dc11\"] = wrestler_hash_output.delete :dc11\n\t\twrestler_hash_output[\"dc12\"] = wrestler_hash_output.delete :dc12\n\n\t\twrestler_hash_output[\"specialty\"] = wrestler_hash_output.delete :specialty\n\n\t\twrestler_hash_output[\"s1\"] = wrestler_hash_output.delete :s1\n\t\twrestler_hash_output[\"s2\"] = wrestler_hash_output.delete :s2\n\t\twrestler_hash_output[\"s3\"] = wrestler_hash_output.delete :s3\n\t\twrestler_hash_output[\"s4\"] = wrestler_hash_output.delete :s4\n\t\twrestler_hash_output[\"s5\"] = wrestler_hash_output.delete :s5\n\t\twrestler_hash_output[\"s6\"] = wrestler_hash_output.delete :s6\n\n\t\twrestler_hash_output[\"subx\"] = wrestler_hash_output[:sub][0]\n\t\twrestler_hash_output[\"suby\"] = wrestler_hash_output[:sub][1]\n\t\twrestler_hash_output[\"tagx\"] = wrestler_hash_output[:sub][0]\n\t\twrestler_hash_output[\"tagy\"] = wrestler_hash_output[:sub][1]\n\n\t\twrestler_hash_output.delete :sub\n\t\twrestler_hash_output.delete :tag\n\n\t\twrestler_hash_output[\"prioritys\"] = wrestler_hash_output.delete :prioritys\n\t\twrestler_hash_output[\"priorityt\"] = wrestler_hash_output.delete :priorityt\n\n\t\twrestler_hash_output[\"oc02\"] = wrestler_hash_output.delete :oc02\n\t\twrestler_hash_output[\"oc03\"] = wrestler_hash_output.delete :oc03\n\t\twrestler_hash_output[\"oc04\"] = wrestler_hash_output.delete :oc04\n\t\twrestler_hash_output[\"oc05\"] = wrestler_hash_output.delete :oc05\n\t\twrestler_hash_output[\"oc06\"] = wrestler_hash_output.delete :oc06\n\t\twrestler_hash_output[\"oc07\"] = wrestler_hash_output.delete :oc07\n\t\twrestler_hash_output[\"oc08\"] = wrestler_hash_output.delete :oc08\n\t\twrestler_hash_output[\"oc09\"] = wrestler_hash_output.delete :oc09\n\t\twrestler_hash_output[\"oc10\"] = wrestler_hash_output.delete :oc10\n\t\twrestler_hash_output[\"oc11\"] = wrestler_hash_output.delete :oc11\n\t\twrestler_hash_output[\"oc12\"] = wrestler_hash_output.delete :oc12\n\n\t\twrestler_hash_output[\"ro02\"] = wrestler_hash_output.delete :ro02\n\t\twrestler_hash_output[\"ro03\"] = wrestler_hash_output.delete :ro03\n\t\twrestler_hash_output[\"ro04\"] = wrestler_hash_output.delete :ro04\n\t\twrestler_hash_output[\"ro05\"] = wrestler_hash_output.delete :ro05\n\t\twrestler_hash_output[\"ro06\"] = wrestler_hash_output.delete :ro06\n\t\twrestler_hash_output[\"ro07\"] = wrestler_hash_output.delete :ro07\n\t\twrestler_hash_output[\"ro08\"] = wrestler_hash_output.delete :ro08\n\t\twrestler_hash_output[\"ro09\"] = wrestler_hash_output.delete :ro09\n\t\twrestler_hash_output[\"ro10\"] = wrestler_hash_output.delete :ro10\n\t\twrestler_hash_output[\"ro11\"] = wrestler_hash_output.delete :ro11\n\t\twrestler_hash_output[\"ro12\"] = wrestler_hash_output.delete :ro12\n\n\t\tf = File.new(\"files/output/#{wrestler_hash_output[\"name\"]}_#{wrestler_hash_output[\"set\"]}_hash.txt\", 'a')\n\n\t\tf.write(\"{\")\n\t\twrestler_hash_output.each { |k,v|\n\t\t\tf.write(\"\\\"#{k}\\\"=>\\\"#{v}\\\", \")\n\t\t}\n\t\tf.write(\"template: nil}\")\n\n\t\tf.write(\"\\n\\n\")\n\tend",
"def hash\n [id, identifier, password, first_name, middle_initial, last_name, title, report_card, license_class, disable_online_flag, enable_mobile_flag, type, employee_identifer, vendor_number, notes, time_zone, country, service_board_team_ids, enable_mobile_gps_flag, inactive_date, inactive_flag, last_login, photo, office_email, office_phone, office_extension, mobile_email, mobile_phone, mobile_extension, home_email, home_phone, home_extension, default_email, default_phone, security_role, admin_flag, structure_level, security_location, default_location, default_department, reports_to, restrict_location_flag, restrict_department_flag, work_role, work_type, time_approver, expense_approver, billable_forecast, daily_capacity, hourly_cost, hourly_rate, include_in_utilization_reporting_flag, require_expense_entry_flag, require_time_sheet_entry_flag, require_start_and_end_time_on_time_entry_flag, allow_in_cell_entry_on_time_sheet, enter_time_against_company_flag, allow_expenses_entered_against_companies_flag, time_reminder_email_flag, days_tolerance, minimum_hours, time_sheet_start_date, hire_date, service_default_location, service_default_department, service_default_board, restrict_service_default_location_flag, restrict_service_default_department_flag, excluded_service_board_ids, project_default_location, project_default_department, project_default_board, restrict_project_default_location_flag, restrict_project_default_department_flag, excluded_project_board_ids, schedule_default_location, schedule_default_department, schedule_capacity, service_location, restrict_schedule_flag, hide_member_in_dispatch_portal_flag, calendar, sales_default_location, restrict_default_sales_territory_flag, warehouse, warehouse_bin, restrict_default_warehouse_flag, restrict_default_warehouse_bin_flag, mapi_name, calendar_sync_integration_flag, enable_ldap_authentication_flag, ldap_configuration, ldap_user_name, company_activity_tab_format, invoice_time_tab_format, invoice_screen_default_tab_format, invoicing_display_options, agreement_invoicing_display_options, corelytics_username, corelytics_password, remote_package, remote_package_platform, remote_package_user_name, remote_package_password, remote_package_account, authentication_service_type, timebased_one_time_password_activated, _info].hash\n end",
"def hash\n [customer_no, customer_name, rma_number, order_no, received_date, close_date, ship_to_name, ship_to_company, ship_to_address, ship_to_address2, ship_to_city, ship_to_state, ship_to_zip_code, ship_to_country, email_address, phone_number, return_warehouse, return_status, disposition_code, return_reason, original_tracking_number, shipping_carrier_code, shippng_service_code, return_sales_order_lines].hash\n end",
"def hash\n [id, name, enabled, constrain_weekly_paid_time, flexible_weekly_paid_time, weekly_exact_paid_minutes, weekly_minimum_paid_minutes, weekly_maximum_paid_minutes, constrain_paid_time_granularity, paid_time_granularity_minutes, constrain_minimum_time_between_shifts, minimum_time_between_shifts_minutes, maximum_days, minimum_working_days_per_week, optional_days, shift_start_variances, shifts, agents, metadata, self_uri].hash\n end",
"def inventory_hash(older, newer)\n older.merge(newer)\nend",
"def hash\n [color, cards, address_placement, custom_envelope, double_sided, extra_service, mail_type, return_envelope, bleed, file_original_url].hash\n end",
"def expected_results_with_all_supplemental_codes\n # Since this is a CMS IG requirement, only do this for CVU+ or C3 tests\n return expected_results unless product.cvuplus? || product.c3_test?\n\n required_codes = { 'PAYER' => %w[1 2 6 349], 'SEX' => %w[M F], 'RACE' => %w[2106-3 2076-8 2054-5 2028-9 1002-5 2131-1],\n 'ETHNICITY' => %w[2135-2 2186-5] }.freeze\n new_hash = expected_results\n new_hash.each do |_measure_id, pop_set_hash|\n pop_set_hash.each do |_pop_set_id, pop_set|\n sup_data = pop_set['supplemental_data']\n %w[IPP DENOM NUMER NUMEX DENEX DENEXCEP MSRPOPL MSRPOPLEX].each do |pop_key|\n next unless pop_set[pop_key]\n\n sup_data[pop_key] = { 'RACE' => {}, 'ETHNICITY' => {}, 'SEX' => {}, 'PAYER' => {} } unless sup_data[pop_key]\n required_codes.each do |sup_data_type, codes|\n codes.each do |code|\n sup_data[pop_key][sup_data_type][code] = 0 unless sup_data[pop_key][sup_data_type][code]\n end\n end\n end\n end\n end\n new_hash\n end",
"def hash\n [campaign, number, customer, scheduled_start, child, description, category_type, overview, priority, date_event, product_event, phone, event_name, event_number, time_difference, type_event, primary_phone_call_id, parent_phone_call_id, product_name, product_name_g, scheduled_start_parent, description_parent, act_status_name_parent, organisation_name, organisation_id, action_status, actual_start, actual_end, owner, partner, time_shift, regarding_object_id, phone_call_subject, summary_table_event_id, lead_id, lead_name, contact_id, contact_full_name, account_id, account_name, parent_account_id, parent_account_name, customer_created_on, contact_taxid_number, contact_pin, account_registration_code, account_taxid_number, account_pin, lead_pin, parent_account_registration_code, parent_account_taxid_number, parent_account_pin, address_name, actionnr, campaign_rank, setting_id, ignor_nedozvon, primary_activity_id, activity_serial_number, contact_person_id, contact_person_id_name, phone_call_type, party_id, color, time, created_by, created_on, modified_by, modified_on, id, name, state_code, status_code].hash\n end",
"def hash\n [api_percentage, api_usage, apm_fargate_percentage, apm_fargate_usage, apm_host_percentage, apm_host_usage, apm_usm_percentage, apm_usm_usage, appsec_fargate_percentage, appsec_fargate_usage, appsec_percentage, appsec_usage, browser_percentage, browser_usage, ci_visibility_itr_percentage, ci_visibility_itr_usage, container_excl_agent_percentage, container_excl_agent_usage, container_percentage, container_usage, cspm_containers_percentage, cspm_containers_usage, cspm_hosts_percentage, cspm_hosts_usage, custom_ingested_timeseries_percentage, custom_ingested_timeseries_usage, custom_timeseries_percentage, custom_timeseries_usage, cws_containers_percentage, cws_containers_usage, cws_hosts_percentage, cws_hosts_usage, dbm_hosts_percentage, dbm_hosts_usage, dbm_queries_percentage, dbm_queries_usage, estimated_indexed_logs_percentage, estimated_indexed_logs_usage, estimated_indexed_spans_percentage, estimated_indexed_spans_usage, estimated_ingested_logs_percentage, estimated_ingested_logs_usage, estimated_ingested_spans_percentage, estimated_ingested_spans_usage, estimated_rum_sessions_percentage, estimated_rum_sessions_usage, fargate_percentage, fargate_usage, functions_percentage, functions_usage, infra_host_percentage, infra_host_usage, invocations_percentage, invocations_usage, npm_host_percentage, npm_host_usage, obs_pipeline_bytes_percentage, obs_pipeline_bytes_usage, profiled_container_percentage, profiled_container_usage, profiled_fargate_percentage, profiled_fargate_usage, profiled_host_percentage, profiled_host_usage, sds_scanned_bytes_percentage, sds_scanned_bytes_usage, snmp_percentage, snmp_usage, universal_service_monitoring_percentage, universal_service_monitoring_usage, vuln_management_hosts_percentage, vuln_management_hosts_usage].hash\n end",
"def manifestations_launched\n find_related_frbr_objects( :launches, :which_manifestations?) \n end",
"def digests_data\n {\n '1' => '7a8a3dad389031160f79817c14bb5f3adf058335',\n '2' => '8d4fc3e19f141135ca59f0ba5d9e8b634f04840e',\n '3' => '88f879b8aa22eb340019449955accdca62886f64',\n '4' => 'dba9f7cc5b15cc2eee74a288e6c04431d2f5e509',\n '5' => 'febf0d5b94e4dd2cd23f3a9cd515641885a50980',\n '6' => '2628bf51107c4c5cd581179df5d1148821f8a7a8',\n '7' => '83f929fdce5dfe931f9ccc6af49e2cfd436740f4',\n '8' => '5f9e781563ab48e7a67ec4500321b1ebe553f3fc',\n '9' => '8b14bf8dfa2bc7d74443cd9c4a0d836f1341becb',\n '10' => '5442273b216f7c843de10acc57c33638f7848f74',\n '11' => '3871068443e406fbff7ad6f91bd395bf9482a259',\n '12' => '9e52c47b63dd968ba2349779a86986eff2f2b860',\n '13' => '658ba6008127dc4e61eb5bbe70ec69be5524b845'\n }\n end",
"def hash\n [id, remit_name, location, address_one, address_two, city, state, zip, country, phone, invoice_title, payable_name, topcomment, invoice_footer, quote_footer, overall_invoice_default, standard_invoice_actual, standard_invoice_fixed, progress_invoice, agreement_invoice, credit_memo_invoice, down_payment_invoice, misc_invoice, sales_order_invoice, exclude_do_not_bill_time_flag, exclude_do_not_bill_expense_flag, exclude_do_not_bill_product_flag, prefix_suffix_flag, prefix_suffix_text, charge_adj_to_firm_flag, no_watermark_flag, display_tax_flag, allow_restricted_dept_on_routing_flag, bill_ticket_separately_flag, bill_ticket_complete_flag, bill_ticket_unapproved_flag, bill_project_complete_flag, bill_project_unapproved_flag, progress_time_flag, restrict_project_downpayment_flag, bill_sales_order_complete_flag, bill_product_after_ship_flag, restrict_downpayment_flag, copy_non_service_products_flag, copy_service_products_flag, copy_agreement_products_flag, print_logo_flag, read_receipt_flag, delivery_receipt_flag, disable_routing_email_flag, email_template, localized_country, business_number, currency, custom_label, custom_text, company_code, exclude_avalara_flag, _info].hash\n end",
"def hash\n [inventory_code, plu, name, host_id, size, category, group, master_group, price_level, clerk, location, quantity, total_ex, total_inc, counter, barcode, normal_price, item_cost, tax, tax_free, is_discount, is_refund, is_void, is_surcharge, is_promotion, reason].hash\n end",
"def manifest_json\n unless File.exist?(MANIFEST_JSON) && File.mtime(MANIFEST_JSON) >= File.mtime(MANIFEST_FILE)\n hash = Hash.ordered\n hash[\"@context\"] = \"http://rdfa.info/contexts/rdfa-test.jsonld\"\n hash['@graph'] = []\n\n start = Time.now\n puts \"Started SPARQL @ #{start.to_s}\"\n SPARQL.execute(TESTS_QUERY, graph).each do |tc|\n tc_hash = hash['@graph'].last\n unless tc_hash && tc_hash['@id'] == tc[:id]\n tc_hash = Hash.ordered\n tc_hash['@id'] = tc[:id].to_s\n tc_hash['@type'] = 'test:TestCase'\n tc[:num] = tc_hash['@id'].split('/').last.split('.').first\n tc[:classification] ||= 'http://www.w3.org/2006/03/test-description#required'\n %w(num classification contribuor description input purpose queryParam reference results).each do |prop|\n tc_hash[prop] = tc[prop.to_sym].to_s unless tc[prop.to_sym].nil?\n end\n tc_hash['expectedResults'] = tc[:expectedResults].nil? ? true : tc[:expectedResults].object\n tc_hash['hostLanguages'] = []\n tc_hash['versions'] = []\n hash['@graph'] << tc_hash\n end\n tc_hash['hostLanguages'] << tc[:hostLanguage].to_s unless tc_hash['hostLanguages'].include?(tc[:hostLanguage].to_s)\n tc_hash['versions'] << tc[:version].to_s unless tc_hash['versions'].include?(tc[:version].to_s)\n end\n finish = Time.now\n puts \"Finished SPARQL @ #{finish.to_s} #{finish - start} secs\"\n\n json = hash.to_json(::JSON::State.new(\n :indent => \" \",\n :space => \" \",\n :space_before => \"\",\n :object_nl => \"\\n\",\n :array_nl => \"\\n\"\n ))\n File.open(MANIFEST_JSON, \"w\") {|f| f.write(json)}\n end\n @manifest_json = File.read(MANIFEST_JSON)\n end",
"def stored_manifest\n @stored_manifest ||= directory.files.get(\"#{manifest.name}-#{version}.json\")\n end",
"def hash\n [life_style_type, listing_action, contact_preference, under_offer_or_contract, auction, bond, available_from, property_details, is_new_development, statement_of_information, price, domain_ad_id, domain_agency_id, provider_ad_id, features, description, summary, inspection_details, media, contacts, other_enquiry_email, receive_emails_to_default_address, is_rural, supplementary].hash\n end",
"def for_core\n {\n order_id: order_data.fetch('AmazonOrderId'),\n purchased_at: order_data.fetch('PurchaseDate'),\n status: order_data.fetch('OrderStatus'),\n currency: order_lines_data.dig(0, 'ItemPrice', 'CurrencyCode'),\n shipping_method_id: shipping_method_id,\n shipping_carrier_id: shipping_carrier_id,\n\n shipping_address: {\n email: order_data.dig('BuyerEmail'),\n name: order_data.dig('ShippingAddress', 'Name'),\n phone: order_data.dig('ShippingAddress', 'Phone'),\n address1: (\n order_data.dig('ShippingAddress', 'AddressLine1') ||\n order_data.dig('ShippingAddress', 'AddressLine2')\n ),\n city: order_data.dig('ShippingAddress', 'City'),\n zip: order_data.dig('ShippingAddress', 'PostalCode'),\n country: order_data.dig('ShippingAddress', 'CountryCode'),\n },\n\n # Because Amazon doesn't expose the billing address, we use the same\n # information as for the shipping address.\n billing_address: {\n email: order_data.dig('BuyerEmail'),\n name: order_data.dig('ShippingAddress', 'Name'),\n phone: order_data.dig('ShippingAddress', 'Phone'),\n address1: (\n order_data.dig('ShippingAddress', 'AddressLine1') ||\n order_data.dig('ShippingAddress', 'AddressLine2')\n ),\n city: order_data.dig('ShippingAddress', 'City'),\n zip: order_data.dig('ShippingAddress', 'PostalCode'),\n country: order_data.dig('ShippingAddress', 'CountryCode'),\n },\n\n order_lines_attributes: order_lines_data.collect do |ol|\n {\n product_id: ol.fetch('SellerSKU'),\n quantity: ol.fetch('QuantityOrdered'),\n cents_with_vat: (ol.dig('ItemPrice', 'Amount').to_f * 100.0).round(2).to_s,\n }\n end,\n\n raw_data: order_data,\n }\n end",
"def hash\n [router_mode, matrix_id, router_dimension, speed_multiplier, area, speed_multiplier_area, traffic, departure, track, motorway, toll, trailers, weight, weight_per_axle, height, width, length, hazardous_goods, max_walk_distance, approach, snap, strict_restriction, cost_fixed, cost_distance_multiplier, cost_time_multiplier, cost_value_multiplier, cost_waiting_time_multiplier, cost_late_multiplier, start_point_id, end_point_id, capacities, sequence_timewindows, timewindow_id, timewindow, rest_ids, id, coef_setup, additional_setup, coef_service, additional_service, shift_preference, trips, value_matrix_id, duration, distance, maximum_ride_time, maximum_ride_distance, skills, unavailable_work_day_indices, unavailable_work_date, unavailable_index_ranges, unavailable_date_ranges, free_approach, free_return].hash\n end",
"def add_supply_to_winter_holidays(holiday_hash, item)\n holiday_hash[:winter].each do |holiday, decorations|\n decorations << item\n end\nend",
"def to_hash\n xml = replay_xml_data.to_hash\n merged_hash = xml\n if replay_outcome\n ro = replay_outcome.to_hash\n if xml[:p1][:legend_rank] == ro[:p1][:rank] and ro[:p1][:is_legend]\n merged_hash[:p1][:archetype] = ro[:p1][:archetype]\n merged_hash[:p2][:archetype] = ro[:p2][:archetype]\n # fix missing legend ranks from xml data\n # if one of the ranks is correlated to replay outcome data\n unless merged_hash[:p2][:legend_rank].present?\n merged_hash[:p2][:legend_rank] = ro[:p2][:rank]\n end\n elsif xml[:p1][:legend_rank] == ro[:p2][:rank] and ro[:p2][:is_legend]\n merged_hash[:p1][:archetype] = ro[:p2][:archetype]\n merged_hash[:p2][:archetype] = ro[:p1][:archetype]\n # fix missing legend ranks from xml data\n # if one of the ranks is correlated to replay outcome data\n unless merged_hash[:p2][:legend_rank].present?\n merged_hash[:p2][:legend_rank] = ro[:p1][:rank]\n end\n end\n end\n deck_card_ids = xml[:deck_card_ids] || replay_xml_data.deck_card_ids\n merged_hash.delete(:deck_card_ids)\n merged_hash = merged_hash.merge({\n hsreplay_id: @hsreplay_id,\n num_turns: num_turns,\n found_at: found_at,\n deck_card_names: HearthstoneCard.card_ids_to_deck_list(deck_card_ids)\n })\n if replay_game_api_response\n opposing_deck = replay_game_api_response.opposing_deck\n if opposing_deck\n card_ids = opposing_deck[\"cards\"] || []\n predicted_card_ids = opposing_deck[\"predicted_cards\"] || []\n merged_hash = merged_hash.merge({\n opposing_deck: {\n cards: HearthstoneCard.card_ids_to_deck_list(card_ids),\n predicted_cards: HearthstoneCard.card_ids_to_deck_list(predicted_card_ids)\n }\n })\n end\n if !merged_hash[:p1][:archetype]\n merged_hash[:p1][:archetype] = replay_game_api_response.friendly_class_name\n end\n if !merged_hash[:p2][:archetype]\n merged_hash[:p2][:archetype] = replay_game_api_response.opposing_class_name\n end\n if !merged_hash[:found_at]\n merged_hash[:found_at] = replay_game_api_response.data[\"global_game\"][\"match_start\"]\n end\n if replay_game_api_response.arena?\n merged_hash[:metadata] = replay_game_api_response.metadata\n end\n end\n merged_hash\n end",
"def add_supply_to_winter_holidays(holiday_hash, item)\n holiday_hash[:winter].each do |holiday, decorations|\n decorations.push(item)\n end\nend",
"def manifest\n seed = { 'label' => title }\n\n manifest = IIIF::Presentation::Manifest.new(seed)\n\n manifest['@id'] = uri(image_server, \"#{id}/manifest\")\n manifest.attribution = 'University of Pennsylvania Libraries'\n manifest.viewing_hint = viewing_hint\n manifest.viewing_direction = viewing_direction\n\n sequence = IIIF::Presentation::Sequence.new(\n '@id' => uri(image_server, \"#{id}/sequence/normal\"),\n 'label' => 'Current order'\n )\n\n assets.map.with_index do |asset, i|\n index = i + 1\n\n # Retrieve image information from image server\n url = uri(image_server, \"#{asset[:file]}/info.json\")\n info = JSON.parse(Faraday.get(URI.parse(url)).body)\n\n # Adding canvas that contains image as an image annotation.\n sequence.canvases << canvas(\n index: index,\n label: asset[:label],\n height: info['height'],\n width: info['width'],\n profile: info['profile'][0],\n filepath: asset[:file],\n additional_downloads: asset[:additional_downloads]\n )\n\n # Adding table of contents, if label and table of contents entries are provided.\n if asset[:label] && asset[:table_of_contents]&.any?\n manifest.structures << range(\n index: index,\n label: asset[:label],\n table_of_contents: asset[:table_of_contents]\n )\n end\n end\n\n manifest.sequences << sequence\n manifest.to_json\n end",
"def legacies(vet)\n LegacyAppeal.fetch_appeals_by_file_number(vet.file_number).tap do |las|\n las.map do |l|\n { nod: l.nod_date, soc: l.soc_date, ssoc: l.ssoc_dates,\n vacols_id: l.vacols_id, disposition: l.disposition }\n end\n end\nend",
"def hash\n [date, net_asset_value, beta_vs_spy, trailing_one_month_return_split_and_dividend, trailing_one_month_return_split_only, trailing_one_year_return_split_and_dividend, trailing_one_year_return_split_only, trailing_one_year_volatility_annualized, trailing_three_year_annualized_return_split_and_dividend, trailing_three_year_annualized_return_split_only, trailing_three_year_volatility_annualized, trailing_five_year_annualized_return_split_and_dividend, trailing_five_year_annualized_return_split_only, trailing_five_year_volatility_annualized, trailing_ten_year_annualized_return_split_and_dividend, trailing_ten_year_annualized_return_split_only, inception_annualized_return_split_and_dividend, inception_annualized_return_split_only, calendar_year_5_return_split_and_dividend, calendar_year_5_return_split_only, calendar_year_4_return_split_and_dividend, calendar_year_4_return_split_only, calendar_year_3_return_split_and_dividend, calendar_year_3_return_split_only, calendar_year_2_return_split_and_dividend, calendar_year_2_return_split_only, calendar_year_1_return_split_and_dividend, calendar_year_1_return_split_only, calendar_year_to_date_return_split_and_dividend, calendar_year_to_date_return_split_only, etf].hash\n end",
"def general_metadata_hash\r\n metadata = Hash.new\r\n metadata[:filename] = @datafile.file_file_name\r\n metadata[:downloads] = 0\r\n\r\n metadata[:title] = clean_string(general_metadata_sheet[*WBF[:meta_title_pos]])\r\n metadata[:abstract] = clean_string(general_metadata_sheet[*WBF[:meta_abstract_pos]])\r\n metadata[:comment] = clean_string(general_metadata_sheet[*WBF[:meta_comment_pos]])\r\n metadata[:usagerights] = clean_string(general_metadata_sheet[*WBF[:meta_usagerights_pos]])\r\n metadata[:published] = clean_string(general_metadata_sheet[*WBF[:meta_published_pos]])\r\n metadata[:spatialextent] = clean_string(general_metadata_sheet[*WBF[:meta_spatial_extent_pos]])\r\n metadata[:temporalextent] = clean_string(general_metadata_sheet[*WBF[:meta_temporalextent_pos]])\r\n metadata[:taxonomicextent] = clean_string(general_metadata_sheet[*WBF[:meta_taxonomicextent_pos]])\r\n metadata[:design] = clean_string(general_metadata_sheet[*WBF[:meta_design_pos]])\r\n metadata[:dataanalysis] = clean_string(general_metadata_sheet[*WBF[:meta_dataanalysis_pos]])\r\n metadata[:circumstances] = clean_string(general_metadata_sheet[*WBF[:meta_circumstances_pos]])\r\n return metadata\r\n end",
"def hash\n [actual_value, additional_contact_client_first_name, additional_contact_client_id, additional_contact_client_is_primary, additional_contact_client_last_name, address_business_city, address_business_country, address_business_is_primary, address_business_line1, address_business_state, address_business_zip_code, address_other_city, address_other_country, address_other_is_primary, address_other_line1, address_other_state, address_other_zip_code, bill_rate, bonus, commission, company_id, company_name, compensation, compensation_details, custom_field1, custom_field10, custom_field11, custom_field12, custom_field13, custom_field14, custom_field15, custom_field16, custom_field17, custom_field18, custom_field19, custom_field2, custom_field20, custom_field21, custom_field22, custom_field23, custom_field24, custom_field25, custom_field26, custom_field27, custom_field28, custom_field29, custom_field3, custom_field30, custom_field4, custom_field5, custom_field6, custom_field7, custom_field8, custom_field9, description, discount, estimated_close_date, external_primary_key, fee, fee_percent, hourly_rate, is_lead, is_on_hold, job_title_id, job_title_name, job_types, lead_source_id, lead_source_name, margin, name, number_of_openings, opportunity_type_id, opportunity_type_name, parent_job_id, parent_job_name, pay_rate, potential_value, priority_id, priority_name, probability, salary, start_date, tags, total_hours, website_description, website_description_is_primary, website_other, website_other_is_primary].hash\n end",
"def consolidate_cart(cart)\n # code here\n new_hash = {}\n cart.each do |items|\n items.each do |name, attributes|\n if new_hash[name]\n new_hash[name][:count] += 1 #adds a count of one to each item when there are no duplicates\n else\n new_hash[name] = attributes\n new_hash[name][:count] = 1\n end\n end\n end\n new_hash\nend",
"def hash\n [id, name, ticker, figi_ticker, ric, isin, sedol, exchange_mic, sponsor, type, description, inception_date, data_change_date, close_date, is_live_listed, legal_structure, intraday_nav_ticker, primary_ticker, primary_ticker_country_code, primary_listing_region, net_expense_ratio, asset_class, other_asset_types, market_cap_range, holds_only_nyse_stocks, holds_only_nasdaq_stocks, growth_value_tilt, growth_type, value_type, sector, industry, sub_industry, cross_sector_theme, natural_resources_type, excludes_financials, excludes_technology, us_or_excludes_us, developed_emerging, specialized_region, continent, latin_america_sub_group, europe_sub_group, asia_sub_group, specific_country, china_listing_location, us_state, real_estate, index_weighting_scheme, market_cap_weighting_type, fundamental_weighting_type, dividend_weighting_type, bond_type, government_bond_types, municipal_bond_region, municipal_vrdo, mortgage_bond_types, bond_tax_status, credit_quality, average_maturity, specific_maturity_year, bond_currency_denomination, laddered, zero_coupon, floating_rate, build_america_bonds, commodity_types, energy_type, agricultural_type, metal_type, inverse_leveraged, target_date_multi_asset_type, currency_hedged, currency_pair, social_environmental_type, clean_energy_type, dividend_type, regular_dividend_payor_type, holds_ml_ps, holds_preferred_stock, holds_closed_end_funds, quant_strategies_type, other_quant_models, hedge_fund_type, derivatives_based, holds_ad_rs, index_linked, includes_short_exposure, index_name, parent_index, index_family, broader_index_family, index_provider, fund_family, index_ticker, etn_issuing_bank, etn_maturity_date, livestock, dynamic_futures_roll, index_provider_code, single_category_designation, registered_countries, issuing_entity_country_code, ucits, replication_structure, domicile, base_currency, listing_currency, fund_listing_date, listing_country_code, listing_region, smartvs_traditional_beta, smartvs_traditional_beta_level2, income_category, etp_structure_type, month_end_assets, etf_portfolio_turnover, firstbridge_id, firstbridge_parent_id, number_of_holdings].hash\n end",
"def build_manifest(opts={})\n main_class = (opts[:main_class] ? randomize(opts[:main_class]) : nil)\n app_name = (opts[:app_name] ? randomize(opts[:app_name]) : nil)\n existing_manifest = nil\n meta_inf_exists = @entries.find_all{|item| item.name == 'META-INF/' }.length > 0\n\n @manifest = \"Manifest-Version: 1.0\\r\\n\"\n @manifest << \"Main-Class: #{main_class}\\r\\n\" if main_class\n @manifest << \"Application-Name: #{app_name}\\r\\n\" if app_name\n @manifest << \"Permissions: all-permissions\\r\\n\"\n @manifest << \"\\r\\n\"\n @entries.each { |e|\n next if e.name =~ %r|/$|\n if e.name == \"META-INF/MANIFEST.MF\"\n existing_manifest = e\n next\n end\n #next unless e.name =~ /\\.class$/\n @manifest << \"Name: #{e.name}\\r\\n\"\n #@manifest << \"SHA1-Digest: #{Digest::SHA1.base64digest(e.data)}\\r\\n\"\n @manifest << \"\\r\\n\"\n }\n if existing_manifest\n existing_manifest.data = @manifest\n else\n add_file(\"META-INF/\", '') unless meta_inf_exists\n add_file(\"META-INF/MANIFEST.MF\", @manifest)\n end\n end",
"def create_products_hash\n toys = {}\n $products_hash[\"items\"].each do |product|\n toys[product[\"title\"]] = {}\n\t\ttoys[product[\"title\"]][\"retail_price\"] = product[\"full-price\"]\n\t\ttoys[product[\"title\"]][\"amount_sold\"] = product[\"purchases\"].length\n\t\ttoys[product[\"title\"]][\"total_sales\"] = 0.0\n toys[product[\"title\"]][\"average_discount\"] = 0.0\n\t\tproduct[\"purchases\"].each do |sales|\n toys[product[\"title\"]][\"total_sales\"] += sales[\"price\"]\n\t\tend # end total_sales loop\n toys[product[\"title\"]][\"average_price\"] =\n toys[product[\"title\"]][\"total_sales\"] /\n toys[product[\"title\"]][\"amount_sold\"]\n\n toys[product[\"title\"]][\"average_discount\"] = 100 -\n (toys[product[\"title\"]][\"average_price\"].to_f /\n toys[product[\"title\"]][\"retail_price\"].to_f * 100)\n end # end each loop to create_products_hash\n\treturn toys\nend",
"def hash\n [label_id, status, shipment_id, shipment, ship_date, created_at, shipment_cost, insurance_cost, tracking_number, is_return_label, rma_number, is_international, batch_id, carrier_id, charge_event, outbound_label_id, service_code, test_label, package_code, validate_address, voided, voided_at, label_download_type, label_format, label_layout, trackable, label_image_id, carrier_code, tracking_status, label_download, form_download, insurance_claim, packages].hash\n end",
"def hash\n [accounts_date, reporting_period, currency, consolidated_accounts, audit_qualification, number_of_employees, turnover, cost_of_sales, sga_plus_other_net_costs, operating_profit, interest_receivable, interest_payable, pre_tax_profit, taxation, post_tax_profit, dividends_payable, retained_profits, intangible_assets, tangible_assets, investments_and_other_assets, fixed_assets, stock, trade_debtors, other_debtors, miscellaneous_current_assets, cash, current_assets, total_assets, bank_loans_and_overdrafts, trade_creditors, miscellaneous_current_liabilities, other_short_term_finances, current_liabilities, contingent_liabilities, other_long_term_finances, total_long_term_liabilities, total_liabilities, net_assets, equity_paid_up, revaluation_reserve, sundry_reserves, profit_and_loss_account_reserve, shareholder_funds, depreciation, amortisation_of_intangibles, ebitda, working_capital, capital_employed, wages_and_salaries, directors_emoluments, audit_fees, bank_overdraft_and_long_term_loans, net_cash_flow_from_operations, net_cash_flow_before_financing, net_cash_flow_from_financing, increase_in_cash, debtor_days, exports, gross_margin_percentage, operating_profit_margin_percentage, ebitda_margin_percentage, pre_tax_profit_margin_percentage, net_margin_percentage, return_on_assets_percentage, return_on_capital_employed_percentage, return_on_equity, current_ratio, cash_to_current_liabilities_ratio, cash_to_total_assets_percentage, liquidity_ratio, gearing_percentage_on_liability_basis, gearing_percentage_on_gross_debt_basis, gearing_percentage_on_net_debt_basis, debt_to_capital_percentage, inventory_turnover_ratio, cash_to_turnover_ratio, cash_to_turnover_percentage, days_inventory_outstanding, days_sales_outstanding, days_payable_outstanding, cash_conversion_cycle, revenue_per_employee, human_capital_value_added, interest_coverage_ratio, net_debt_to_ebitda_ratio, cfo_to_sales_ratio, auditor, joint_auditor, solicitor, accountant].hash\n end",
"def hash\n [registration_number, tax_status, tax_due_date, art_end_date, mot_status, mot_expiry_date, make, month_of_first_dvla_registration, month_of_first_registration, year_of_manufacture, engine_capacity, co2_emissions, fuel_type, marked_for_export, colour, type_approval, wheelplan, revenue_weight, real_driving_emissions, date_of_last_v5_c_issued, euro_status].hash\n end",
"def hash\n [date, campaign_revenue, total_campaign_revenue, campaign_refund, total_campaign_refund, campaign_discount_costs, total_campaign_discount_costs, campaign_refunded_discounts, total_campaign_refunded_discounts, campaign_free_items, total_campaign_free_items, coupon_redemptions, total_coupon_redemptions, coupon_rolledback_redemptions, total_coupon_rolledback_redemptions, referral_redemptions, total_referral_redemptions, coupons_created, total_coupons_created, referrals_created, total_referrals_created, added_loyalty_points, total_added_loyalty_points, deducted_loyalty_points, total_deducted_loyalty_points].hash\n end",
"def entry_hash\n entries.map{ |entry| entry.routing_number.to_i / 10 }.compact.inject(&:+)\n end",
"def primary_file(origin_name, dist_name, component_name, packages)\n content = {\n :metadata => {\n :@xmlns => XMLNS_MAP[:common],\n \"@xmlns:rpm\" => XMLNS_MAP[:rpm],\n :@packages => packages.size,\n :package => packages.map { |package|\n {\n :@type => \"rpm\",\n :name => package[\"NAME\"],\n :arch => package[\"ARCH\"],\n :version => {\n :@epoch => package[\"EPOCHNUM\"],\n :@ver => package[\"VERSION\"],\n :@rel => package[\"RELEASE\"].split(\".\").first,\n },\n :checksum => [\n {\n :@type => \"sha\",\n :@pkgid => \"YES\",\n },\n package[:generated_sha],\n ],\n :summary => package[\"SUMMARY\"],\n :description => [package[\"DESCRIPTION\"]].flatten.compact.join(\" \"),\n :packager => package[\"PACKAGER\"],\n :url => package[\"URL\"],\n :time => {\n :@file => Time.now.to_i,\n :@build => package[\"BUILDTIME\"],\n },\n :size => {\n :@archive => package[\"ARCHIVESIZE\"],\n :@package => package[:generated_size],\n :@installed => package[\"LONGSIZE\"],\n },\n :location => package[:generated_path],\n :format => {\n \"rpm:license\" => package[\"LICENSE\"],\n \"rpm:vendor\" => package[\"VENDOR\"],\n \"rpm:group\" => package[\"GROUP\"],\n \"rpm:buildhost\" => package[\"BUILDHOST\"],\n \"rpm:header-range\" => {\n :@start => package[:generated_header][:start],\n :@end => package[:generated_header][:end],\n },\n \"rpm:provides\" => {\n \"rpm:entry\" => Array.new.tap { |entries|\n pro_ver = package[\"PROVIDEVERSION\"].dup\n package[\"PROVIDENAME\"].each_with_index do |p_name, p_idx|\n item = {:@name => p_name}\n if p_flag = VERSION_FLAGS[package[\"PROVIDEFLAGS\"][p_idx]]\n p_ver, p_rel = pro_ver.shift.split(\"-\", 2)\n item.merge!(:@flags => p_flag, :@ver => p_ver, :@rel => p_rel, :@epoch => package[\"EPOCHNUM\"])\n end\n entries.push(item)\n end\n },\n },\n \"rpm:requires\" => {\n \"rpm:entry\" => Array.new.tap { |entries|\n req_ver = package[\"REQUIREVERSION\"].dup\n package[\"REQUIRENAME\"].each_with_index do |r_name, r_idx|\n item = {:@name => r_name}\n if r_flag = VERSION_FLAGS[package[\"REQUIREFLAGS\"][r_idx]]\n r_ver, r_rel = req_ver.shift.split(\"-\", 2)\n item.merge!(:@flags => r_flag, :@ver => r_ver, :@rel => r_rel, :@epoch => package[\"EPOCHNUM\"])\n end\n entries.push(item)\n end\n },\n },\n },\n }\n },\n },\n }\n args = [origin_name, dist_name, component_name, \"repodata\", \"primary.xml\"]\n [\n create_file(*args) do |file|\n file.puts generate_xml(content)\n end,\n compress_file(*args),\n ]\n end",
"def to_hash\n {\n \"ScheduledDelivery\" => scheduled_delivery.to_i,\n \"Packages\" => packages.map { |x| x.to_hash }\n }\n end",
"def hash\n [id, name, default_flag, visible_logo_flag, company_info_flag, billing_terms_flag, summary_flag, discussion_flag, task_flag, task, configurations_flag, internal_notes_flag, resolution_flag, time_flag, time_member_flag, time_date_flag, time_start_end_flag, time_bill_flag, time_hours_flag, time_rate_flag, time_extended_amount_flag, time_work_type_flag, time_agreement_flag, time_notes_flag, time_manual_flag, time_manual_entry, time_tax_flag, expense_flag, expense_date_flag, expense_member_flag, expense_type_flag, expense_bill_flag, expense_amount_flag, expense_agreement_flag, expense_notes_flag, expense_tax_flag, expense_manual_flag, expense_manual_entry, product_flag, product_description_flag, product_bill_flag, product_quantity_flag, product_price_flag, product_extended_amount_flag, product_agreement_flag, product_manual_flag, product_manual_entry, product_tax_flag, technician_signoff_flag, customer_signoff_text_flag, customer_signoff_text, customer_signoff_fields_flag, billing_methods_text_flag, billing_methods_text, credit_card_fields_flag, default_ff_flag, _info].hash\n end",
"def hash\n [additional_merchant_notes_new_order, additional_merchant_notes_original_order, custom_field1, custom_field2, custom_field3, custom_field4, custom_field5, custom_field6, custom_field7, free, immediate_charge, items, original_order_id, shipping_method, skip_payment].hash\n end",
"def parse_meta\n meta = Hash.new\n meta[@data[0][0]] = @data[0][1]\n meta[@data[0][2]] = @data[0][3]\n meta[@data[0][4]] = @data[0][5]\n meta[@data[0][6]] = @data[0][7]\n meta[@data[1][0]] = @data[1][1]\n meta[@data[1][2]] = @data[1][3]\n meta[@data[1][4]] = @data[1][5]\n meta[@data[1][6]] = @data[1][7]\n meta[@data[1][8]] = @data[1][9]\n meta[@data[1][10]] = @data[1][11]\n meta[@data[1][12]] = @data[1][13]\n # This is some cleanup that needs to happen because of an oddity (bug?) in \n # the WF/CSV files in version 5.5.1.\n if [\"5.5.0\",\"5.5.1\"].include? meta[\"AppVersion\"]\n day = Hash.new\n hour = Hash.new\n minu = Hash.new\n sec = Hash.new\n meta.each do |k,v|\n if !k.nil?\n if k.include? \"Day\"\n d = k.split(/([0-9]+)/) \n day[d[0]] = d[1]\n h = v.split(/([0-9]+)/) \n hour[h[0]] = h[1]\n meta.delete(k)\n elsif k.include? \"Minu\"\n m = k.split(/([0-9]+)/) \n minu[m[0]] = m[1]\n s = v.split(/([0-9]+)/) \n sec[s[0]] = s[1]\n meta.delete(k)\n end\n else\n meta.delete(k)\n end\n end \n meta.merge! day\n meta.merge! hour\n meta.merge! minu \n meta.merge! sec\n end \n return meta\n end",
"def generate_manifest\n available_versions.each do |version|\n puts \"Processing #{project_name} - #{channel_name} - #{version}\"\n\n artifacts_for(version).each do |artifact|\n p = artifact.platform\n pv = artifact.platform_version\n m = artifact.architecture\n\n manifest[p] ||= {}\n manifest[p][pv] ||= {}\n manifest[p][pv][m] ||= {}\n manifest[p][pv][m][artifact.version] = {\n sha1: artifact.sha1,\n sha256: artifact.sha256,\n url: artifact.url\n }\n end\n end\n\n manifest\n end",
"def hash\n [id, summary, record_type, board, status, project, phase, wbs_code, company, site, site_name, address_line1, address_line2, city, state_identifier, zip, country, contact, contact_phone_number, contact_phone_extension, contact_email_address, type, sub_type, item, team, owner, priority, service_location, source, required_date, budget_hours, opportunity, agreement, severity, impact, external_x_ref, po_number, knowledge_base_category_id, knowledge_base_sub_category_id, allow_all_clients_portal_view, customer_updated_flag, automatic_email_contact_flag, automatic_email_resource_flag, automatic_email_cc_flag, automatic_email_cc, initial_description, initial_internal_analysis, initial_resolution, contact_email_lookup, process_notifications, skip_callback, closed_date, closed_by, closed_flag, date_entered, entered_by, actual_hours, approved, sub_billing_method, sub_billing_amount, sub_date_accepted, date_resolved, date_resplan, date_responded, resolve_minutes, res_plan_minutes, respond_minutes, is_in_sla, knowledge_base_link_id, resources, parent_ticket_id, has_child_ticket, knowledge_base_link_type, bill_time, bill_expenses, bill_products, predecessor_type, predecessor_id, predecessor_closed_flag, lag_days, lag_nonworking_days_flag, estimated_start_date, duration, location_id, business_unit_id, mobile_guid, sla, _info, custom_fields].hash\n end",
"def populate_holdings\n mfhd_fields = {\n summary_holdings: '866',\n supplements: '867',\n indexes: '868',\n public_notes: '890',\n donor_information: '891',\n reproduction_note: '892',\n url: '893',\n acquisitions_information: '894',\n current_issues: '895'\n }\n\n # Process each 852, creating a new mfhd for each\n holdings = {}\n @marc_record.each_by_tag('852') do |tag852|\n mfhd_id = tag852['0']\n\n # Call Number might be defined at the Bib or Holdings level.\n # Holdings call number, if present, takes precedence.\n best_call_number = tag852['h'].present? ? tag852['h'] : self.call_number\n\n holdings[mfhd_id] = {\n mfhd_id: mfhd_id,\n location_display: tag852['a'],\n location_code: tag852['b'],\n display_call_number: best_call_number,\n items: []\n }\n # And fill in all possible mfhd fields with empty array\n mfhd_fields.each_pair do |label, _tag|\n holdings[mfhd_id][label] = []\n end\n end\n\n # Scan the MARC record for each of the possible mfhd fields,\n # if any found, add to appropriate Holding\n # (e.g., label :summary_holdings, tag '866')\n mfhd_fields.each_pair do |label, tag|\n @marc_record.each_by_tag(tag) do |mfhd_data_field|\n mfhd_id = mfhd_data_field['0']\n value = mfhd_data_field['a']\n next unless mfhd_id && holdings[mfhd_id] && value\n holdings[mfhd_id][label] << value\n end\n end\n\n # Now add the list of items to each holding.\n @marc_record.each_by_tag('876') do |item_field|\n # build the Item hash\n item = {\n item_id: item_field['a'],\n use_restriction: item_field['h'],\n temporary_location: item_field['l'],\n barcode: item_field['p'],\n enum_chron: item_field['3']\n # customer_code: item_field['z']\n }\n # Store this item hash in the apppropriate Holding\n mfhd_id = item_field['0']\n holdings[mfhd_id][:items] << item\n # Assume a single customer code per holding.\n if item_field['z'].present?\n holdings[mfhd_id][:customer_code] = item_field['z']\n end\n end\n\n # Now that all the data is matched up, we don't need\n # the hash of mfhd_id ==> holdings_hash\n # Just store an array of Holdings\n @holdings = holdings.values\n end",
"def hash\n [additional_line_item_data, allow_invoice_download, allowed_payment_method_configurations, currency, id, integrated_payment_form_enabled, language, login_name, name, payment_app_version, payment_installed, payment_proxy_path, planned_purge_date, replace_payment_method_image, shop_name, show_payment_information, show_subscription_information, space_id, space_view_id, state, subscription_app_version, subscription_installed, subscription_proxy_path, version].hash\n end",
"def get_program_hash\n program = {:max_roomslots => 0, :days => []}\n\n prev_start = Date.new(1970,01,01)\n start = nil\n day = nil\n room_count = 0\n Timeslot.all.each do |t|\n\n if(t.start.to_date > prev_start.to_date)\n day = {:starts => [], :date => t.start.to_date}\n program[:days].push(day)\n end\n\n if t.start > prev_start\n prev_start = t.start\n \n start[:room_count] = room_count if start\n start = {:timeslots => [], :start => t.start, :room_count => 0}\n \n day[:starts].push(start)\n \n if program[:max_roomslots] < room_count\n program[:max_roomslots] = room_count\n end\n room_count = 0\n end\n\n start[:timeslots].push(t)\n room_count += t.roomslot.size\n end\n\n start[:room_count] = room_count\n if program[:max_roomslots] < room_count\n program[:max_roomslots] = room_count\n end\n\n program\n end",
"def adding_matz\n\tprogrammer_hash = \n \t\t{\n :grace_hopper => {\n :known_for => \"COBOL\",\n :languages => [\"COBOL\", \"FORTRAN\"]\n },\n :alan_kay => {\n :known_for => \"Object Orientation\",\n :languages => [\"Smalltalk\", \"LISP\"]\n },\n :dennis_ritchie => {\n :known_for => \"Unix\",\n :languages => [\"C\"]\n }\n }\n \n programmer_hash = {\n :yukihiro_matsumoto => {\n :known_for => \"Ruby\",\n :languages => [\"LISP\", \"C\"]\n }\n }\nend",
"def med_stats_hash(_assessed_data); end",
"def hash\n [name, time_period_ids, discount_id, match_products_id, apply_products_id, exclude_products_id, valid_from_date, valid_from_local_time, valid_until_date, valid_until_local_time].hash\n end",
"def hash\n [additional_properties, currency_code, description, inventory, min_inventory_threshold, not_available, not_displayable, original_price, price, published, sale_id, sale_name, sku, start_date, stop_date].hash\n end",
"def big_shoe_rebounds\n shoe_size =0 #creates a lowest size shoe_size\n rebounds = 0\ngame_hash[:home][:players].each do |player,attribute_hash|\n if attribute_hash[:shoe] > shoe_size #every shoe_size that is bigger than the last will overwrite the array.\n shoe_size = attribute_hash[:shoe]\n rebounds = attribute_hash[:rebounds]\n end\nend\n#repeat process for the away side of the hash\ngame_hash[:away][:players].each do |player,attribute_hash|\n if attribute_hash[:shoe] > shoe_size\n shoe_size = attribute_hash[:shoe]\n rebounds = attribute_hash[:rebounds]\nend\nend\nrebounds\nend",
"def hash\n [attachments, created_by_id, created_by_name, created_on, id, modified_by_id, modified_by_name, modified_on, name, owners, status_id, status_name, address_business_city, address_business_country, address_business_is_primary, address_business_line1, address_business_state, address_business_zip_code, address_home_city, address_home_country, address_home_is_primary, address_home_line1, address_home_state, address_home_zip_code, address_other_city, address_other_country, address_other_is_primary, address_other_line1, address_other_state, address_other_zip_code, current_position_company_id, current_position_company_name, current_position_title, current_position_when_end, current_position_when_start, description, education_accreditation_id, education_accreditation_name, education_honors, education_institution_id, education_institution_name, education_when_end, education_when_start, email_address_other, email_address_other_is_primary, email_address_personal, email_address_personal_is_primary, email_address_work, email_address_work_is_primary, ethnicity_id, ethnicity_name, external_primary_key, first_name, gender_id, gender_name, key_date_anniversary, key_date_birthday, key_date_other, last_name, middle_name, nick_name, phone_number_fax, phone_number_fax_extension, phone_number_fax_is_primary, phone_number_home, phone_number_home_extension, phone_number_home_is_primary, phone_number_mobile, phone_number_mobile_extension, phone_number_mobile_is_primary, phone_number_other, phone_number_other_extension, phone_number_other_is_primary, phone_number_skype, phone_number_skype_extension, phone_number_skype_is_primary, phone_number_work_direct, phone_number_work_direct_extension, phone_number_work_direct_is_primary, phone_number_work_main, phone_number_work_main_extension, phone_number_work_main_is_primary, preferred_contact_method_type_id, preferred_contact_method_type_name, record_type, related_contact_assistant_first_name, related_contact_assistant_id, related_contact_assistant_is_primary, related_contact_assistant_last_name, related_contact_client_first_name, related_contact_client_id, related_contact_client_is_primary, related_contact_client_last_name, related_contact_other_first_name, related_contact_other_id, related_contact_other_is_primary, related_contact_other_last_name, related_contact_referred_by_first_name, related_contact_referred_by_id, related_contact_referred_by_is_primary, related_contact_referred_by_last_name, related_contact_spouse_first_name, related_contact_spouse_id, related_contact_spouse_is_primary, related_contact_spouse_last_name, salary, salary_details, salutation_id, salutation_name, social_aim, social_aim_is_primary, social_facebook_chat, social_facebook_chat_is_primary, social_face_time, social_face_time_is_primary, social_google_talk, social_google_talk_is_primary, social_icq, social_icq_is_primary, social_other, social_other_is_primary, social_skype, social_skype_is_primary, social_twitter, social_twitter_is_primary, social_yahoo_msg, social_yahoo_msg_is_primary, source_id, source_name, suffix_id, suffix_name, tags, website_blog, website_blog_is_primary, website_business, website_business_is_primary, website_facebook, website_facebook_is_primary, website_linked_in, website_linked_in_is_primary, website_other, website_other_is_primary, website_personal, website_personal_is_primary].hash\n end",
"def verifiable_info\n if baptized_at_home_parish\n verifiables_baptized_at_home_parish\n elsif !baptized_at_home_parish && baptized_catholic\n verifiables_baptized_at_home_parish.merge(verifiables_baptized_catholic)\n else\n verifiables_baptized_at_home_parish.merge(verifiables_baptized_catholic)\n .merge(verifiables_profession_of_faith)\n end\n end",
"def hash\n [id, type, state, country, street, postal_code, city, phone_country, phone_number, email, ip, address_description, identification_number, identification_type, lang, name, first_name, middle_name, last_name, birth_date, occupation, nationality, legal_entity_type, registration_date, registration_number, nature_of_business, source_of_funds, custom_source_of_funds, core_business_activity, purpose_of_opening_account, office_phone, vat_registration_number, financial_regulator, regulatory_licence_number, contact_person_email, trading_country, trading_address, trading_name, number_monthly_transactions, amount_monthly_transactions, documents, metadata, errors, onboarding_status, politically_exposed_people, external_id, city_of_birth, country_of_birth, gender, sales_lead_id, created_at, company_office_number, company_office_number_country, aml_officer_email, aml_officer_phone, aml_officer_phone_country, company_website_url, number_of_employees_in_company, list_of_countries_of_operation, estimated_annual_revenue_turnover, declaration].hash\n end",
"def to_h\n @manifest.to_h.keys.map do |k|\n [k, self[k]]\n end.to_h\n end",
"def yards_hash(total_xml, rushing_xml)\n overall = plays_yards_average(total_xml)\n overall[:rushing] = plays_yards_average(rushing_xml)\n overall\n end",
"def generate_rating_qualifier_snak(game, progress_bar)\n snak = {\n CONTENT_DESCRIPTOR_PID => [],\n ESRB_INTERACTIVE_ELEMENTS_PID => []\n }\n\n game.descriptors.each do |descriptor|\n unless CONTENT_DESCRIPTORS.keys.map(&:to_s).include?(descriptor)\n progress_bar.log \"'#{descriptor}' could not be found in the list of content descriptor QIDs.\"\n next\n end\n\n snak[CONTENT_DESCRIPTOR_PID] << {\n \"entity-type\" => \"item\",\n \"numeric-id\" => CONTENT_DESCRIPTORS[descriptor.to_sym],\n \"id\" => \"Q#{CONTENT_DESCRIPTORS[descriptor.to_sym]}\"\n }\n end\n\n game.interactive_elements.each do |interactive_elem|\n unless INTERACTIVE_ELEMENTS.keys.map(&:to_s).include?(interactive_elem)\n progress_bar.log \"'#{interactive_elem}' could not be found in the list of interactive elements QIDs.\"\n next\n end\n\n snak[ESRB_INTERACTIVE_ELEMENTS_PID] << {\n \"entity-type\" => \"item\",\n \"numeric-id\" => INTERACTIVE_ELEMENTS[interactive_elem.to_sym],\n \"id\" => \"Q#{INTERACTIVE_ELEMENTS[interactive_elem.to_sym]}\"\n }\n end\n\n return snak\nend",
"def hash\n [id, id_account, webid, application_date, date, value, gross_value, nature, original_wording, simplified_wording, stemmed_wording, wording, id_category, state, date_scraped, rdate, vdate, bdate, coming, active, id_cluster, comment, last_update, deleted, original_value, original_gross_value, original_currency, commission, commission_currency, country, counterparty, card].hash\n end",
"def hash\n [type, id, updated_at, version, is_deleted, catalog_v1_ids, present_at_all_locations, present_at_location_ids, absent_at_location_ids, item_data, category_data, item_variation_data, tax_data, discount_data, modifier_list_data, modifier_data].hash\n end",
"def item_stats\n return unless public?\n\n if @item_stats.nil?\n @item_stats = {}\n @item_stats[:ammo_deployed] = @xml_data['stats']['weapons']['ammo_deployed'].to_i\n @item_stats[:sentryguns_deployed] = @xml_data['stats']['weapons']['sentryguns_deployed'].to_i\n @item_stats[:sentry_flamers_deployed] = @xml_data['stats']['weapons']['sentry_flamers_deployed'].to_i\n @item_stats[:sentry_freeze_deployed] = @xml_data['stats']['weapons']['sentry_freeze_deployed'].to_i\n @item_stats[:sentry_cannon_deployed] = @xml_data['stats']['weapons']['sentry_cannon_deployed'].to_i\n @item_stats[:medkits_used] = @xml_data['stats']['weapons']['medkits_used'].to_i\n @item_stats[:flares_used] = @xml_data['stats']['weapons']['flares_used'].to_i\n @item_stats[:adrenaline_used] = @xml_data['stats']['weapons']['adrenaline_used'].to_i\n @item_stats[:tesla_traps_deployed] = @xml_data['stats']['weapons']['tesla_traps_deployed'].to_i\n @item_stats[:freeze_grenades_thrown] = @xml_data['stats']['weapons']['freeze_grenades_thrown'].to_i\n @item_stats[:electric_armor_used] = @xml_data['stats']['weapons']['electric_armor_used'].to_i\n @item_stats[:healgun_heals] = @xml_data['stats']['weapons']['healgun_heals'].to_i\n @item_stats[:healgun_heals_self] = @xml_data['stats']['weapons']['healgun_heals_self'].to_i\n @item_stats[:healbeacon_heals] = @xml_data['stats']['weapons']['healbeacon_heals'].to_i\n @item_stats[:healbeacon_heals_self] = @xml_data['stats']['weapons']['healbeacon_heals_self'].to_i\n @item_stats[:damage_amps_used] = @xml_data['stats']['weapons']['damage_amps_used'].to_i\n @item_stats[:healbeacons_deployed] = @xml_data['stats']['weapons']['healbeacons_deployed'].to_i\n @item_stats[:healbeacon_heals_pct] = @xml_data['stats']['weapons']['healbeacon_heals_pct'].to_f\n @item_stats[:healgun_heals_pct] = @xml_data['stats']['weapons']['healgun_heals_pct'].to_f\n @item_stats[:healbeacon_heals_pct_self] = @xml_data['stats']['weapons']['healbeacon_heals_pct_self'].to_f\n @item_stats[:healgun_heals_pct_self] = @xml_data['stats']['weapons']['healgun_heals_pct_self'].to_f\n end\n\n @item_stats\n end"
] |
[
"0.78442127",
"0.7546124",
"0.7546124",
"0.7457613",
"0.6570351",
"0.6488464",
"0.64694744",
"0.64540035",
"0.6430159",
"0.6420317",
"0.6230764",
"0.62144035",
"0.61396486",
"0.5907613",
"0.5788022",
"0.5510948",
"0.542372",
"0.5393345",
"0.5367835",
"0.5365915",
"0.5342259",
"0.53383",
"0.53200287",
"0.52962136",
"0.527983",
"0.5257991",
"0.5222099",
"0.52201223",
"0.521749",
"0.5198808",
"0.51785874",
"0.51780754",
"0.5150794",
"0.5121018",
"0.5096834",
"0.50808054",
"0.50762284",
"0.5065068",
"0.5063968",
"0.50629944",
"0.5062801",
"0.5054917",
"0.5051663",
"0.50467724",
"0.502757",
"0.49895707",
"0.49894875",
"0.49886003",
"0.49856856",
"0.49675274",
"0.49451867",
"0.49430063",
"0.49377158",
"0.49305835",
"0.49260682",
"0.49243936",
"0.49185202",
"0.4914954",
"0.49112156",
"0.49097222",
"0.49058127",
"0.4900266",
"0.48988655",
"0.48893595",
"0.4885002",
"0.4882999",
"0.48824647",
"0.4875047",
"0.48651043",
"0.48647156",
"0.48552606",
"0.48509404",
"0.4849386",
"0.484915",
"0.48460832",
"0.48398364",
"0.4835183",
"0.48279327",
"0.48278064",
"0.4821901",
"0.4821192",
"0.48181602",
"0.48151284",
"0.48141962",
"0.48141333",
"0.48131448",
"0.48128265",
"0.481041",
"0.48103365",
"0.48061535",
"0.48047337",
"0.48028073",
"0.47905633",
"0.47813419",
"0.47781274",
"0.47735754",
"0.4773245",
"0.47688425",
"0.4768665",
"0.47666577"
] |
0.77538717
|
1
|
Challenge III: Retrieving Data retrieval operates on the shipping_manifest hash to return the value of the 'oil paintings' key Look up the value of the "oil paintings" key in the shipping_manifest hash below
|
def retrieval
shipping_manifest = {"whale bone corsets" => 5, "porcelain vases" => 2, "oil paintings" => 3}
shipping_manifest["oil paintings"]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def retrieval\n shipping_manifest = { \"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3 }\n\n shipping_manifest[\"oil paintings\"]\nend",
"def retrieval\n shipping_manifest['oil paintings']\nend",
"def retrieval\n shipping_manifest = {\n \"whale bone corsets\" => 5,\n \"porcelain vases\" => 2,\n \"oil paintings\" => 3\n }\n shipping_manifest[\"oil paintings\"]\n\nend",
"def retrieval\n shipping_manifest = shipping_manifest = {\"whale bone corsets\" => 5,\"porcelain vases\" => 2,\"oil paintings\" => 3}\n return shipping_manifest[\"oil paintings\"]\nend",
"def retrieval\n shipping_manifest = {\n \"whale bone corsets\" => 5, \n \"porcelain vases\" => 2, \n \"oil paintings\" => 3\n }\n \nshipping_manifest[\"oil paintings\"]\nend",
"def shipping_manifest\n shipping_manifest = {\n \"whale bone corsets\" => 5,\n \"porcelain vases\" => 2,\n \"oil paintings\" => 3\n }\nend",
"def shipping_manifest\n shipping_manifest = {\n \"whale bone corsets\" => 5,\n \"porcelain vases\" => 2,\n \"oil paintings\" => 3\n }\nend",
"def shipping_manifest\n the_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\nend",
"def shipping_manifest\n the_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n\nend",
"def shipping_manifest\n the_manifest={\n\"whale bone corsets\" => 5,\n\"porcelain vases\" => 2,\n\"oil paintings\" => 3\n}\nthe_manifest\nend",
"def adding\n shipping_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n\n shipping_manifest[\"pearl necklace\"] = 1\n return shipping_manifest\nend",
"def adding\n shipping_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n \n shipping_manifest[\"pearl necklace\"] = 1\n return shipping_manifest\nend",
"def second_supply_for_fourth_of_july(holiday_hash)\n holiday_supplies[:summer][:fourth_of_july][1]\nend",
"def adding\n shipping_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n shipping_manifest[\"muskets\"] = 2\n shipping_manifest[\"gun powder\"] = 4\n\n shipping_manifest\nend",
"def adding\n shipping_manifest = {\n \"whale bone corsets\" => 5, \n \"porcelain vases\" => 2, \n \"oil paintings\" => 3\n }\nshipping_manifest[\"muskets\"] = 2\nshipping_manifest[\"gun powder\"]= 4\nshipping_manifest\nend",
"def second_supply_for_fourth_of_july(holiday_hash)\n holiday_hash.each do |season, details|\n details.each do |holiday, supplies|\n if holiday == :fourth_of_july\n return supplies[1]\n end\n end\n end\nend",
"def second_supply_for_fourth_of_july(holiday_supplies)\n holiday_supplies[:summer][:fourth_of_july][1]\nend",
"def second_supply_for_fourth_of_july(holiday_hash)\n holiday_hash[:summer][:fourth_of_july][1]\nend",
"def discounted_shipping_price\n hash[\"DiscountedShippingPrice\"]\n end",
"def get_occupation(data, hometown)\n # code here\n occupation = nil \n data.each do |key1, value1|\n value1.each do |key_value_pair|\n if key_value_pair[\"hometown\"] == hometown\n occupation = key_value_pair[\"occupation\"]\n break\n end\n end\n end\n occupation\nend",
"def get_bay(product)\n WAREHOUSE.select{|bay| bay[:product] == product}.first[:bay_no]\nend",
"def shipping\n @data[:shipping]\n end",
"def bay_at_item(item) #finds the key of an item given the value (task 2)\n for hash in WAREHOUSE\n if hash.has_value?(item)\n return hash.key(item).to_s\n end\n end\nend",
"def find_single_bay(hash,lookup)\n\n for key,value in hash\n\n if value[:item] == lookup\n return key \n end\n \n end\n #If gone all the way throuh the hash, no item\n #found so return nil\n return nil\nend",
"def hash_for_location(offense); end",
"def for_core\n {\n order_id: order_data.fetch('AmazonOrderId'),\n purchased_at: order_data.fetch('PurchaseDate'),\n status: order_data.fetch('OrderStatus'),\n currency: order_lines_data.dig(0, 'ItemPrice', 'CurrencyCode'),\n shipping_method_id: shipping_method_id,\n shipping_carrier_id: shipping_carrier_id,\n\n shipping_address: {\n email: order_data.dig('BuyerEmail'),\n name: order_data.dig('ShippingAddress', 'Name'),\n phone: order_data.dig('ShippingAddress', 'Phone'),\n address1: (\n order_data.dig('ShippingAddress', 'AddressLine1') ||\n order_data.dig('ShippingAddress', 'AddressLine2')\n ),\n city: order_data.dig('ShippingAddress', 'City'),\n zip: order_data.dig('ShippingAddress', 'PostalCode'),\n country: order_data.dig('ShippingAddress', 'CountryCode'),\n },\n\n # Because Amazon doesn't expose the billing address, we use the same\n # information as for the shipping address.\n billing_address: {\n email: order_data.dig('BuyerEmail'),\n name: order_data.dig('ShippingAddress', 'Name'),\n phone: order_data.dig('ShippingAddress', 'Phone'),\n address1: (\n order_data.dig('ShippingAddress', 'AddressLine1') ||\n order_data.dig('ShippingAddress', 'AddressLine2')\n ),\n city: order_data.dig('ShippingAddress', 'City'),\n zip: order_data.dig('ShippingAddress', 'PostalCode'),\n country: order_data.dig('ShippingAddress', 'CountryCode'),\n },\n\n order_lines_attributes: order_lines_data.collect do |ol|\n {\n product_id: ol.fetch('SellerSKU'),\n quantity: ol.fetch('QuantityOrdered'),\n cents_with_vat: (ol.dig('ItemPrice', 'Amount').to_f * 100.0).round(2).to_s,\n }\n end,\n\n raw_data: order_data,\n }\n end",
"def shoe_size(player_name)\n # using .each do |location, team_data| to iterate over each piece of data to expose specific data, in this case the team_players\n game_hash.each do |location, team_data|\n # goes through all of the players and then a name and its value\n team_data[:players].each do |name, data|\n # if the key \"name\" is equal to player_name then the value of shoe should be returned\n if name == player_name\n return data[:shoe]\n end\n end\n end\nend",
"def get_spicy_food_by_cuisine(spicy_foods, cuisine)\n spicy_foods.find { |spicy_food_hash| spicy_food_hash[:cuisine] == cuisine}\nend",
"def shoe_size(name)\n #third level\n game_hash.each do |location, team_data|\n team_data.each do |attribute, data|\n data.each do |item|\n if item.class == Hash\n item.each do |k, v|\n if k == name\n return item[k][:shoe]\n end\n end\n end\n end\n end\n end\nend",
"def get_occupation(data, hometown)\n data.each do |season_hash, info|\n info.each do |detail|\n if detail[\"hometown\"] == hometown\n return detail[\"occupation\"]\n end \n end \n end\nend",
"def shipping_method_code\n hash [\"ShippingMethodCode\"]\n end",
"def get_area_code(city_zip_hash, key)\n# Write code here\n if city_zip_hash[key]\n print \"The zip code is: \"\n puts city_zip_hash[key]\n zip = city_zip_hash[key]\n return zip\n else\n puts \"cannot find the city name, sorry\"\n end\nend",
"def attribute_matching(key, data, property=:long_name)\n data[\"address_components\"].each do |comp|\n return comp[property.to_s] if comp[\"types\"].include?(key)\n end\n return nil\n end",
"def lookup btc_address\n\t\t\t\t@report.each do |address|\n\t\t\t\t\tif address[0].eql?(btc_address)\n\t\t\t\t\t\tresult = {\n\t\t\t\t\t\t\t:address => address[0],\n\t\t\t\t\t\t\t:lastHourShares => address[1][\"lastHourShares\"],\n\t\t\t\t\t\t\t:immatureBalance => address[1][\"immatureBalance\"],\n\t\t\t\t\t\t\t:lastHourRejectedShares => address[1][\"lastHourRejectedShares\"],\n\t\t\t\t\t\t\t:paidOut => address[1][\"paidOut\"],\n\t\t\t\t\t\t\t:unexchangedBalance => address[1][\"unexchangedBalance\"],\n\t\t\t\t\t\t\t:megahashesPerSecond => address[1][\"megahashesPerSecond\"],\n\t\t\t\t\t\t\t:bitcoinBalance => address[1][\"bitcoinBalance\"],\n\t\t\t\t\t\t\t:rejectedMegahashesPerSecond => address[1][\"rejectedMegahashesPerSecond\"]\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn result\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\treturn nil\n\t\t\tend",
"def shoe_size(name)\n game_hash.collect do |key, value|\n value.collect do |key2, value2|\n if value2.include?(name)\n return game_hash[key][key2][name][:shoe]\n\n end\n end\n end\n\nend",
"def total_shipping_price\n hash[\"TotalShippingPrice\"]\n end",
"def get_address v\n if(File.exist?($d + \"/beta/\" + v + \".yaml\" ))\n y = YAML.load_file($d + \"/beta/\" + v + \".yaml\")\n else\n y = YAML.load_file($d + \"/alpha/\" + v + \".yaml\")\n end\n y['addresses'].collect do |t|\n t['type'] + \" \" + t['sha1sum'] + \" \" + t['address']\n end.join \"\\n\"\nend",
"def shoe_size(name)\n shoe_size = nil\n game_hash.each do |home_or_away, team_details|\n team_details[:players].each do |one_hash| # one_hash is an array\n one_hash.each do |key1,value1|\n if one_hash.has_value? (name)\n shoe_size = one_hash[:shoe]\n end\n end\n end\n end\n shoe_size\nend",
"def expected_results_with_all_supplemental_codes\n # Since this is a CMS IG requirement, only do this for CVU+ or C3 tests\n return expected_results unless product.cvuplus? || product.c3_test?\n\n required_codes = { 'PAYER' => %w[1 2 6 349], 'SEX' => %w[M F], 'RACE' => %w[2106-3 2076-8 2054-5 2028-9 1002-5 2131-1],\n 'ETHNICITY' => %w[2135-2 2186-5] }.freeze\n new_hash = expected_results\n new_hash.each do |_measure_id, pop_set_hash|\n pop_set_hash.each do |_pop_set_id, pop_set|\n sup_data = pop_set['supplemental_data']\n %w[IPP DENOM NUMER NUMEX DENEX DENEXCEP MSRPOPL MSRPOPLEX].each do |pop_key|\n next unless pop_set[pop_key]\n\n sup_data[pop_key] = { 'RACE' => {}, 'ETHNICITY' => {}, 'SEX' => {}, 'PAYER' => {} } unless sup_data[pop_key]\n required_codes.each do |sup_data_type, codes|\n codes.each do |code|\n sup_data[pop_key][sup_data_type][code] = 0 unless sup_data[pop_key][sup_data_type][code]\n end\n end\n end\n end\n end\n new_hash\n end",
"def process_search(user_id)\n locations_and_prices = {}\n user = User.find_by_id(user_id)\n user.get_airport_codes.each do |code|\n locations_and_prices[code] = response_key_value_data(code)[\"trips\"][\"tripOption\"][0][\"saleTotal\"]\n end\n locations_and_prices\nend",
"def shoe_size(player_name)\n game_hash.each do |location, team_data|\n team_data[:players].each do |attributes|\n if attributes[:player_name] == player_name\n return attributes[:shoe]\n end\n end\n end\nend",
"def cache_key(package)\n stock_location = package.stock_location.nil? ? \"\" : \"#{package.stock_location.id}\"\n ship_address = package.order.ship_address\n contents_hash = Digest::MD5.hexdigest(package.contents.map {|content_item| content_item.variant.id.to_s + \"_\" + content_item.quantity.to_s }.join(\"|\"))\n @cache_key = \"Spree::Calculator::Shipping::PerVariant-#{stock_location}-#{package.order.number}-#{ship_address.country.iso}-#{ship_address.state_text}-#{ship_address.city}-#{ship_address.zipcode}-#{contents_hash}-#{I18n.locale}\".gsub(\" \",\"\")\n end",
"def get_food(food)\n database.fetch(food, 'Key Not Found!')\n end",
"def location_of_bay(bay)\n location = WAREHOUSE.select{ |item| item[:product_name] == bay }\n return location[0][:rack_bay_position]\nend",
"def test_rates_for_locations_with_only_zip_and_country \n response = @carrier.find_rates(\n @locations[:bare_beverly_hills],\n @locations[:bare_ottawa],\n @packages.values_at(:wii)\n )\n assert response.rates.size > 0\n end",
"def cost_map\n flavor_os_families.each_with_object({}) do |f, hash|\n hash[f.os_family.name] = f.hourly_cost\n end\n end",
"def shoe_size(name)\n game_hash.each do |location, team_data|\n team_data[:players].each do |player_name, data|\n if player_name == name\n return data[:shoe]\n end\n end\n end\nend",
"def getZapposProductData(zapposSvpplyWants)\n\n zapposProductData = Array.new()\n \n key=\"e2d70f1ead64bafbc86dae4064d789f94644b8ff\"\n \n #iterate over each of the zappos products found on Svpply wants list. Collect data for use in emails. \n zapposSvpplyWants.each do |p| \n begin\n term = formatSearchTerm(p[\"page_title\"])\n escapedSearchTerm = URI.escape(term)\n \n #this just pulls the first variant from the product - need to work out a better way to select the right variant\n zapposResponse = JSON.parse(HTTParty.get(\"http://api.zappos.com/Search?term=#{escapedSearchTerm}&key=#{key}\").response.body)[\"results\"].first\n\n productDetails = {\n title: term,\n image: p[\"image\"], \n buyURL: zapposResponse[\"productUrl\"],\n price: zapposResponse[\"price\"] , \n }\n\n zapposProductData.push(productDetails)\n rescue\n # do nothing - will send error email to user. \n end \n end\n \n zapposProductData\n end",
"def test_rates_for_locations_with_only_zip_and_country \n response = @carrier.find_rates(\n @locations[:bare_beverly_hills],\n @locations[:bare_ottawa],\n @packages.values_at(:wii)\n )\n\n assert response.rates.size > 0\n end",
"def test_rates_for_locations_with_only_zip_and_country \n response = @carrier.find_rates(\n @locations[:bare_beverly_hills],\n @locations[:bare_ottawa],\n @packages.values_at(:wii)\n )\n\n assert response.rates.size > 0\n end",
"def test_rates_for_locations_with_only_zip_and_country \n response = @carrier.find_rates(\n @locations[:bare_beverly_hills],\n @locations[:bare_ottawa],\n @packages.values_at(:wii)\n )\n\n assert response.rates.size > 0\n end",
"def get_occupation(data, hometown)\n data.each do |season_iteration, stats|\n stats.find do |town|\n if town[\"hometown\"] == hometown\n return town[\"occupation\"]\n end\n end\n end\nend",
"def serving_size_calc(item_to_make, order_quantity)\n # Data\n pantry = {\"cookie\" => 1, \"cake\" => 5, \"pie\" => 7}\n\n if pantry.has_key?(item_to_make)\n\n stock = (pantry[item_to_make] - order_quantity)\n\n p \"We have to make #{order_quantity} #{item_to_make}. By processing this order, the stock of #{item_to_make} will be #{stock} #{item_to_make}.\" \n\n\n if stock > 0\n p \"We have enough #{item_to_make} to proceed with the order!\"\n elsif stock == 0\n p \"We just have enough stock. The next order will probably put us out of stock. We should make more #{item_to_make}.\"\n else \n p \"We don't have enough stock...to be able to proceed with the order. We should make #{stock.abs} #{item_to_make}.\"\n end \n \n p \"We now have:\" \n \n pantry.each do |key,value|\n pantry[item_to_make] = stock\n \n p \"#{key.capitalize} : #{value}\"\n end\n \n else\n raise ArgumentError.new(\"#{item_to_make} is not on our menu.\")\n end \nend",
"def find_pet_by_name(shop_hash, pet_name)\n for pet_hash in shop_hash[:pets]\n if pet_hash[:name] == pet_name\n return pet_hash\n end\n end\n # if no matches, we expect a program to return nil.\n return nil\nend",
"def get_occupation(data, hometown)\n data.each do |season, info|\n info.each do |people|\n people.each do |k,v|\n if v == hometown\n return people[\"occupation\"]\n end\n end\n end\n end\nend",
"def digital_shipping_method\n rates = rate_hash\n # If there is a shipping method has \"Download\" in its name then we take that one.\n rates.each { |rate| return rate if rate[:name].downcase.include?('download') }\n # Other than that, we take the first one that we find that doesn't cost anything.\n rates.each { |rate| return rate if rate[:cost] == 0 }\n # Well, at this point we have a problem. No shipping method is cost-free or called \"download\".\n nil\n end",
"def product_to_bay(ref_hash, item_string)\n key = ref_hash.key(item_string)\n return key\nend",
"def test_by_allergy(allergies)\n score = 0\n allergies.each do |allergy| \n score += $all_allergies[allergy.to_sym] if $all_allergies.keys.include?(allergy.to_sym)\n end\n score\nend",
"def item_at_bay(bay)\n for x in INVENTORY\n if x.has_key?(bay.to_sym)\n return value = x[bay.to_sym]\n end\n end\n return value\nend",
"def fetch (fei)\n\n @cache[fei.short_hash]\n end",
"def bakery_num(num_of_people, fav_food) #Defining a function that takes two parameters\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1} #Declaring a my_list hash\n pie_qty = 0 # Assigning three other variables \n cake_qty = 0\n cookie_qty = 0\n \n has_fave = false #setting a default value of false \n\n my_list.each_key do |k| #looping through the keys of my_list\n if k == fav_food #An if statement, where the condition is comapred to one of the parameters\n has_fave = true #If true, declaring a has_fave to true \n fav_food = k #Assigning fav_food to that key\n end\n end\n if has_fave == false #If no matec ==> error\n raise ArgumentError.new(\"You can't make that food\")\n else\n fav_food_qty = my_list.values_at(fav_food)[0] #If match ==> find value from Hash \n if num_of_people % fav_food_qty == 0 #Module of the first function parameter, number of people by fav food quantity\n num_of_food = num_of_people / fav_food_qty #If true, get portions \n return \"You need to make #{num_of_food} #{fav_food}(s).\" #return an order \n else num_of_people % fav_food_qty != 0 #redundant but if not \n while num_of_people > 0 \n if num_of_people / my_list[\"pie\"] > 0 #if there are more people than pies\n pie_qty = num_of_people / my_list[\"pie\"] #This gets portions\n num_of_people = num_of_people % my_list[\"pie\"] #this gets amount of people for leftovers \n elsif num_of_people / my_list[\"cake\"] > 0 #If the number of people is not rgeater than pies, we go into cakes\n cake_qty = num_of_people / my_list[\"cake\"]\n num_of_people = num_of_people % my_list[\"cake\"]\n else\n cookie_qty = num_of_people\n num_of_people = 0\n end\n end\n return \"You need to make #{pie_qty} pie(s), #{cake_qty} cake(s), and #{cookie_qty} cookie(s).\"\n end\n end\nend",
"def amount_of_chocolate_chips(perfect_10_recipe)\n puts perfect_10_recipe[:mini_dark_chocolate_chips]\nend",
"def serializable_shipping\n if shipping = self.shipping?\n shipping_hash = ActiveSupport::HashWithIndifferentAccess.new\n shipping_hash[:local_pick_up] = shipping.local_pick_up?.to_bool # FORCE Boolean\n\n # if shipping.free_shipping?\n # shipping_hash[:free_shipping ] = shipping.free_shipping.to_bool # FORCE Boolean\n # end\n\n case shipping_hash[:mode] = shipping.mode?\n when \"me1\"\n # code here\n when \"me2\"\n # code here\n\n # when \"custom\"\n # TO FIX: https://gist.github.com/gullitmiranda/2ba389dbb5bbf3378c8f#file-shipping_custom-json\n # shipping_hash[:costs] = (shipping.costs? || []).map do |cost|\n # {\n # name: cost.name?,\n # cost: cost.cost?.to_f # FORCE Float\n # }\n # end\n else\n shipping_hash.delete(:mode)\n end\n\n shipping_hash[:dimensions] = shipping.dimensions? if shipping.dimensions?\n\n shipping_hash\n end\n end",
"def shoe_size(player_name)\n # remember that \"find\" returns the first item that matches the conditional\n get_players.find { |player| player[:player_name] == player_name }[:shoe]\nend",
"def address(first_recycle_bin)\n puts first_recycle_bin[\"address\"]\nend",
"def serving_size_calc(item_to_make, order_quantity)\n ##hash called library, \n library = {\"cookie\" => 1, \"cake\" => 5, \"pie\" => 7}\n ##variable called error_counter, set to three\n #error_counter = 3\n #library.each do |food|\n # if library[food] != library[item_to_make]\n ## serving_size_calc(\"pie\", 7)\n ## library[food] != library[\"pie\"]\n # p error_counter += -1\n #end\n # end\n\n #if error_counter > 0\n if library.include?(item_to_make) == false\n raise ArgumentError.new(\"#{item_to_make} is not a valid input\")\n end\n #assign var serving_size to get the value of the key matching item_to_make\n serving_size = library[item_to_make]\n #assign var serving_size_mod to \n serving_size_mod = order_quantity % serving_size\n ## serving_size_calc(\"pie\", 8)\n ## want 8 pies\n ## serving size = 7\n ## 8%7 = 1\n \n\n if serving_size_mod == 0\n return \"Calculations complete: Make #{order_quantity/serving_size} of #{item_to_make}\"\n elsif serving_size_mod.between?(1,4)\n return \"Calculations complete: Make #{order_quantity/serving_size} of #{item_to_make}, you have #{serving_size_mod} leftover ingredients. Suggested baking items: #{serving_size_mod} cookies.\"\n end\n \n # return \"Calculations complete: Make #{order_quantity/serving_size} of #{item_to_make}, you have #{serving_size_mod} leftover ingredients. Suggested baking items: \"\n #end\nend",
"def serving_size_calc(item_to_make, order_quantity)\n library = {\"cookie\" => 1, \"cake\" => 5, \"pie\" => 7}\n error_counter = 3\n\n library.each do |food|\n if library[food] != library[item_to_make]\n p error_counter += -1\n end\n end\n\n if error_counter > 0\n raise ArgumentError.new(\"#{item_to_make} is not a valid input\")\n end\n\n serving_size = library.values_at(item_to_make)[0]\n serv# Your Names\n# 1) Jon Clayton\n# 2) Van Phan \n\n# We spent [#] hours on this challenge.\n\n# Bakery Serving Size portion calculator.\n\n# def serving_size_calc(item_to_make, order_quantity)\n# # this number of servings provided per recipe\n# library = {\"cookie\" => 1, \"cake\" => 5, \"pie\" => 7}\n# # need to replace this method of comparing input to library keys and generating error message if needed through line 23\n \n# error_counter = 3\n\n# library.each do |food|\n# if library[food] != library[item_to_make]\n# p error_counter += -1\n# end\n# end\n\n# if error_counter > 0\n# raise ArgumentError.new(\"#{item_to_make} is not a valid input\")\n# end\n# # how many servings from one batch---need to clean up code\n# # Calculate how many full batches are needed to meet order requirement\n# # calculate how many leftover servings will be generated\n# # report above in sentence format\n# # example: p serving_size_calc(\"pie\", 15) #=> \"Make 3 pies. You will have 6 servings left over, which is equivalent to 0 pies, 1 cake, and 1 cookie.\"\n \n# serving_size = library.values_at(item_to_make)[0]\n# serving_size_mod = order_quantity % serving_size\n\n# case serving_size_mod\n# when 0\n# return \"Calculations complete: Make #{order_quantity/serving_size} of #{item_to_make}\"\n# else\n# return \"Calculations complete: Make #{order_quantity/serving_size} of #{item_to_make}, you have #{serving_size_mod} leftover ingredients. Suggested baking items: TODO: MAKE THIS FEATURE\"\n# end\n# end\n\n#Refactored version\n\ndef serving_size_calc(item_to_make, servings_needed)\n # this number of servings provided per recipe\n library = {\"cookie\" => 1, \"cake\" => 5, \"pie\" => 7}\n # need to replace this method of comparing input to library keys and generating error message if needed through line 23\n\n raise ArgumentError.new(\"#{item_to_make} is not a valid input\") unless library.has_key?(item_to_make)\n \n # how many servings from one batch---need to clean up code\n # Calculate how many full batches are needed to meet order requirement\n # calculate how many leftover servings will be generated\n # report above in sentence format\n # example: p serving_size_calc(\"pie\", 15) #=> \"Make 3 pies. You will have 6 servings left over, which is equivalent to 0 pies, 1 cake, and 1 cookie.\"\n \n servings_per_batch = library[item_to_make]\n full_batches_needed = servings_needed / servings_per_batch\n extra_servings_required = servings_needed % servings_per_batch\n extra_batch_needed? = extra_servings_required > 0\n batches_to_prepare = full_batches_needed + extra_batch_needed? ? 1 : 0\n leftover_servings = servings_per_batch - extra_servings_required\n \n cake_possible? = leftover_servings => library[\"cake\"]\n cookies_from_leftovers = cake_possible? ? leftover_servings - library[\"cake\"] : leftover_servings\n case cookies_from_leftovers\n when 0\n cookie_equivalent = \"\"\n when 1\n cookie_equivalent = \"1 cookie\"\n else\n cookie_equivalent = \"#{cookies_from_leftovers} cookies\"\n end\n result = \"Make #{batches_to_prepare} pies to serve #{servings_needed} people.\"\n if extra_batch_needed?\n result += \" You will have #{leftover_servings} servings left over, which is equivalent to #{ cake_possible? ? \"1 cake, and \" : \"\" } #{cookie_equivalent}.\"\n end\nend\n\n#p serving_size_calc(\"pie\", 7)\np serving_size_calc(\"pie\", 8)\n#p serving_size_calc(\"cake\", 5)\n#p serving_size_calc(\"cake\", 7)\n#p serving_size_calc(\"cookie\", 1)\n#p serving_size_calc(\"cookie\", 10)\n#p serving_size_calc(\"THIS IS AN ERROR\", 5)\n\n# Reflection\ning_size_mod = order_quantity % serving_size\n\n case serving_size_mod\n when 0\n return \"Calculations complete: Make #{order_quantity/serving_size} of #{item_to_make}\"\n else\n return \"Calculations complete: Make #{order_quantity/serving_size} of #{item_to_make}, you have #{serving_size_mod} leftover ingredients. Suggested baking items: TODO: MAKE THIS FEATURE\"\n end\nend",
"def big_shoe_rebounds\n big_shoe_rebounds_helper\n rebounds = \"\"\n \n game_hash.each do |key, value|\n players = value[:players]\n players.each do |element|\n if big_shoe_rebounds_helper == element[:shoe]\n rebounds = element[:rebounds]\n end\n end\n end\n rebounds \nend",
"def my_hash_finding_method(source, thing_to_find)\n final_answer = source.select{|key, value| value == thing_to_find}\n p final_answer.keys\nend",
"def my_hash_finding_method(source, thing_to_find)\n final_answer = source.select{|key, value| value == thing_to_find}\n p final_answer.keys\nend",
"def get_area_code(somehash, key)\n=begin\n somehash.each do |each_dial|\n if each_dial[0] == key\n each_dial[1]\n end\n end\n=end\n somehash[key]\nend",
"def get_product_key(mfg, product)\n data = YAML.load(open_file('tires', mfg))\n key = data.fetch(product)\n end",
"def get_occupation(data, hometown)\n return_value = \"No contestants from that hometown\"\n data.each do |season_in_hash, contestant_array|\n contestant_array.each do |contestant|\n contestant.each do |x, y|\n if contestant['hometown'] == hometown\n return contestant['occupation']\n end\n end \n end\n end \n return_value\nend",
"def field_mapping_for_cloud_exposures\n {\n 'application-server-software' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"application_server_software_#{x[\"firstObservation\"][\"configuration\"][\"applicationServerSoftware\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Exposed App Server Software: #{x[\"firstObservation\"][\"configuration\"][\"applicationServerSoftware\"]}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"application_server_software_#{x[\"firstObservation\"][\"configuration\"][\"applicationServerSoftware\"]}\".to_string_identifier }\n }\n ]\n },\n 'bacnet-servers' => {}, \n '-certificate-advertisements' => {}, \n 'development-environments' => {},\n 'dns-servers' => {}, \n '-domain-control-validated-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"comain_control_validated_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Domain Control Validated Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"comain_control_validated_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'ethernet-ip-servers' => {}, \n 'expired-when-scanned-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"expired_when_scanned_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Expired Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"expired_when_scanned_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'ftp-servers' => {}, \n 'ftps-servers' => {}, \n '-healthy-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"healthy_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Healthy Certificate Advertisement: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"healthy_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'insecure-signature-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"insecure_signature_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Insecure Signature Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"insecure_signature_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'internal-ip-address-advertisements'=> {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"internal_ip_address_advertisements_#{x[\"cloudAssetId\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Detected Internal IP advertisement with configuration: #{JSON.pretty_generate(x[\"firstObservation\"][\"configuration\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"internal_ip_address_advertisements_#{x[\"cloudAssetId\"]}\".to_string_identifier }\n }\n ]\n },\n 'load-balancers' => {},\n 'long-expiration-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"long_expiration_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Long Expiration Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"long_expiration_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'memcached-servers' => {}, \n 'modbus-servers' => {}, \n 'ms-sql-servers' => {}, \n 'my-sql-servers' => {}, \n 'net-bios-name-servers' => {},\n 'pop3-servers' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"detected_server_pop3_#{x[\"cloudAssetId\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Detected Pop3 Server with configuration: #{JSON.pretty_generate(x[\"firstObservation\"][\"configuration\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"detected_server_pop3_#{x[\"cloudAssetId\"]}\".to_string_identifier }\n }\n ]\n }, \n 'rdp-servers' => {},\n 'self-signed-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"self_signed_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Self Signed Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"self_signed_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'server-software' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"server_software_#{x[\"firstObservation\"][\"configuration\"][\"serverSoftware\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Exposed Server Software: #{x[\"firstObservation\"][\"configuration\"][\"serverSoftware\"]}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"server_software_#{x[\"firstObservation\"][\"configuration\"][\"serverSoftware\"]}\".to_string_identifier }\n }\n ]\n },\n 'short-key-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"shert_key_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Short Key Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"shert_key_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'sip-servers' => {},\n 'smb-servers' => {},\n 'smtp-servers' => {},\n 'snmp-servers' => {},\n 'ssh-servers' => {},\n 'telnet-servers' => {},\n 'upnp-servers' => {},\n 'unencrypted-logins' => {},\n 'unencrypted-ftp-servers' => {},\n 'web-servers' => {},\n 'wildcard-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"wildcard_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Wildcard Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"wildcard_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'vnc-servers' => {},\n 'vx-works-servers' => {}\n }\n end",
"def shoe_size(name)\n game_hash.each do |location, attributes|\n attributes[:players].each do |player, stats|\n if player == name\n return stats[:shoe]\n end\n end\n end\nend",
"def shoe_size(player_name)\n game_hash.each do |place, team|\n team.each do |attribute, data|\n if attribute == :players \n data.each do |player|\n if player[:player_name]== player_name\n return player[:shoe]\n end\n end\n end\n end\n end\nend",
"def test_rates_for_locations_with_only_zip_and_country \n setup_user\n response = @carrier.find_rates(\n @locations[:bare_beverly_hills],\n @locations[:bare_ottawa],\n @packages.values_at(:wii)\n )\n \n assert response.rates.size > 0\n end",
"def sku\n item_hash.deep_find(:sku)\n end",
"def search_by_zip\n puts \"\n Please give me a zip code\n \"\n user_input = gets.chomp.slice(0,5)\n #slice chomps up the input of zipcode to the frist 5 characters\n brewery_array = Brewery.where(zip: user_input)\n \n #check to see if there's anything returning from the database \n if brewery_array.length > 0 \n brewery_array.each do |brewery|\n puts \"*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*\"\n puts brewery.name\n puts brewery_array.state\n puts brewery_array.street\n puts \"*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*\"\n puts \"Would you like to add to your favorite? y/n\"\n user_anwer = gets.chomp\n if user_anwer ==\"y\"\n create_favorites(brewery.id)\n puts \"Saved!\" \n elsif user_anwer == \"n\"\n puts \"No worries.\" \n end\n end\n else\n response_hash = ApiCommunicator.get_breweries\n count = 0\n\n response_hash.each do |brewery|\n # binding.pry\n if user_input == brewery[\"postal_code\"].slice(0,5)\n # binding.pry\n count +=1\n puts \"*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*\"\n puts brewery[\"name\"]\n puts brewery[\"state\"]\n puts brewery[\"street\"]\n puts brewery[\"phone\"]\n puts \"*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*:*.*\"\n puts \"Would you like to add to your favorite? y/n\"\n user_anwer = gets.chomp\n if user_anwer ==\"y\"\n #create a record into the breweries database\n brewery_obj = Brewery.create(name: brewery[\"name\"], street:brewery[\"street\"],city:brewery[\"city\"],state:brewery[\"state\"],zip:brewery[\"postal_code\"],country:brewery[\"country\"],phone:brewery[\"phone\"],website_url:brewery[\"website_url\"])\n # binding.pry\n\n # create_favorites(brewery.id)\n #get brewery.id to create favorite \n create_favorites(brewery_obj.id)\n puts \"Saved!\" \n\n elsif user_anwer == \"n\"\n puts \"No worries.\" \n end \n else\n \n end\n \n end \n if count == 0\n puts \"Nothing Found\"\n end\n end #end of a if statement to check database records\n end",
"def purchase_in_store_list\n stores = []\n if macys?\n purchase_in_store_container_elements.each do |container|\n\n city, state = container.span_element(:class => 'line', :index => 4).text.split(',')\n state.strip!\n\n stores << {\n 'store_name' => container.span_element(:index => 0).text,\n 'address_line_1' => container.span_element(:class => 'line', :index => 0).text,\n 'address_line_2' => container.span_element(:class => 'line', :index => 1).text,\n 'address_city' => city,\n 'address_state' => state,\n 'address_zip_code' => container.span_element(:class => 'line', :index => 4).text,\n 'distance' => container.span_element(:class => 'miles-bops').text,\n 'store_hours' => container.div_element(:class =>'store-hours').text,\n }\n end\n else\n instore_availability = false\n store_header = store_container_element.div_elements(:class => 'bops_so_storeAvailability').map(&:text)\n store_header.each do |header|\n if header.include?('not available for our buy online')\n instore_availability = true\n break\n end\n end\n raise 'No in-store available stores are found' unless instore_availability\n\n store_count = 0\n container = store_container_element.div_elements(:class => 'bops_so_storeResultWrapper')\n\n if store_availability_message.include?('Buy online')\n store_count = store_count_div[/(\\d+)/, 1].to_i\n total_store_count = container.count - 1\n elsif store_availability_message.include?('not available for our buy online')\n total_store_count = container.count - 1\n end\n\n not_available_stores = false\n store_header.each do |header|\n if header.include?('Not available at')\n not_available_stores = true\n break\n end\n end\n\n if not_available_stores\n total_store_count -= 1\n end\n\n (store_count..total_store_count).each do |i|\n location_container = container[i].div_element(:class => 'bops_so_storeLocation')\n hours_container = container[i].div_element(:class => 'bops_so_storeHoursContainer')\n city_state_zip = location_container.div_element(:index => 2).text\n\n stores << {\n 'store_name' => location_container.div_element(:index => 0).text,\n 'address_line_1' => location_container.div_element(:index => 1).text,\n 'address_line_2' => '',\n 'address_city' => city_state_zip[/([^,]+)/, 1], # Everything up to the first ,\n 'address_state' => city_state_zip[/,(\\w{2})/, 1], # First two characters after the ,\n 'address_zip_code' => city_state_zip[/(\\d{5}(-\\d{4})?)$/, 1], # Last 5 digits (plus optional 4 digits)\n 'phone_number' => location_container.div_element(:index => 3).text,\n 'distance' => location_container.span_element(:class => 'bops_so_storeMiles').text.sub(' View Map', '').sub(' Hide Map', ''),\n 'store_hours' => hours_container.text\n }\n end\n end\n stores\n end",
"def shipping_method_name\n hash[\"ShippingMethodName\"]\n end",
"def retrieve_listing_basics(listingDetail, listing)\n\t\t\t\tcase listingDetail[\"communityCode\"]\n\t\t\t\twhen \"NY026\"\n\t\t\t\t\tlisting[:title] = \"343 Gold Street\"\n\t\t\t\t\tlisting[:city_name] = \"Brooklyn\"\n\t\t\t\t\tlisting[:state_name] = \"NY\"\n\t\t\t\t\tlisting[:zipcode] = \"11201\"\n\t\t\t\t\tlisting[:contact_tel] = \"7185963143\"\n\t\t\t\t\tlisting[:description] = \"Avalon Fort Greene brings new meaning to luxury with these unbeatable Brooklyn apartments built on fabulous green living principles. The massive Fort Greene Avalon Tower offers spaciously designed studios along with one-, two- and three-bedroom designs that boast spectacular views of Manhattan and Brooklyn while providing residents a high-quality living experience. Inside the homes you’ll find a wide range of amenities including spacious floor plans, vaulted ceiling, mini blinds, stainless steel sinks, linen closets, high ceilings, large closets and balconies or patios. Residents are also privy to community amenities like a state of the art fitness center, stylish resident lounge, urban park plaza and valet parking service. Adding to the list of enticing features is the fact that our Brooklyn apartments have a courteous and attentive staff as well as all the necessary amenities to cater to the most discerning New York residents.\"\n\t\t\t\t\tlisting[:amenities] = [\"In-unit washer/dryer\",\"24-hour emergency maintenance\",\"Resident clubhouse\",\"On-site ZipCar\",\"Ceramic tile flooring\",\"ENERGY STAR appliances\",\"Marble vanity\"]\n\n\t\t\t\twhen \"DV007\"\n\t\t\t\t\tlisting[:title] = \"214 Duffield Street\"\n\t\t\t\t\tlisting[:city_name] = \"Brooklyn\"\n\t\t\t\t\tlisting[:state_name] = \"NY\"\n\t\t\t\t\tlisting[:zipcode] = \"11201\"\n\t\t\t\t\tlisting[:contact_tel] = \"7185963143\"\n\t\t\t\t\tlisting[:description] = \"\"\n\t\t\t\t\tlisting[:amenities] = \"\"\n\n\t\t\t\twhen \"DV102\"\n\t\t\t\t\tlisting[:title] = \"240 East Shore Road\"\n\t\t\t\t\tlisting[:city_name] = \"Great Neck\"\n\t\t\t\t\tlisting[:state_name] = \"NY\"\n\t\t\t\t\tlisting[:zipcode] = \"11023\"\n\t\t\t\t\tlisting[:contact_tel] = \"7185963143\"\n\t\t\t\t\tlisting[:description] = \"\"\n\t\t\t\t\tlisting[:amenities] = \"\"\n\n\t\t\t\twhen \"NY011\"\n\t\t\t\t\tlisting[:title] = \"2-01 50th Avenue\"\n\t\t\t\t\tlisting[:city_name] = \"Long Island City\"\n\t\t\t\t\tlisting[:state_name] = \"NY\"\n\t\t\t\t\tlisting[:zipcode] = \"11101\"\n\t\t\t\t\tlisting[:contact_tel] = \"7187297800\"\n\t\t\t\t\tlisting[:description] = \"In the heart of Long Island City, the stunning Avalon Riverview North is an urban paradise entrenched near the East River, LaGuardia Airport and Grand Central Station. Our apartments in Long Island City offer spacious studios and one-, two- or three-bedroom floor plans to fit your needs. These stunning Long Island City apartments feature gourmet kitchens with granite countertops, washer and dryers, modern hardwood floors, maple cabinetry and so much more. The community has a host of amenities as well, including a 24-hour concierge, state of the art fitness center, 9th floor sparkling swimming pool with views of Manhattan and a roof-garden with barbecue grills are just a few of the amenities at your disposal.\"\n\t\t\t\t\tlisting[:amenities] = [\"Granite countertops\",\"24-hour concierge\",\"Spectacular views of Manhattan skyline\",\"WiFi access in common areas\",\"Fully-equipped kitchens include dishwashers\",\"10 minutes to Grand Central on 7 train\",\"Beautifully landscaped courtyards\"]\n\n\t\t\t\twhen \"NY034\"\n\t\t\t\t\tlisting[:title] = \"525 West 28th Street\"\n\t\t\t\t\tlisting[:city_name] = \"New York\"\n\t\t\t\t\tlisting[:state_name] = \"NY\"\n\t\t\t\t\tlisting[:zipcode] = \"10001\"\n\t\t\t\t\tlisting[:contact_tel] = \"2122391323\"\n\t\t\t\t\tlisting[:description] = \"AVA is a first. Our apartments are energized by this great city, personalized by you. You're on the High Line - steps away from the high life of art galleries, eclectic dining, and exciting clubs and bars such as the Frying Pan. Yep. Take our DIY kits and go to town in your new West Chelsea apartment. Our brand new studio, 1- and 2-bedroom apartments feature stainless steel appliances, black quartz countertops, plank flooring, and built-in charging stations.We're also smoke free, eco-friendly,and pet-friendly (big dogs too). Work out in our awesome fitness center, take in city views on the 14th floor roof deck or attend social events exclusive to AVA friends. Dive in and make it yours.\"\n\t\t\t\t\tlisting[:amenities] = [\"Granite countertops\",\"24-hour concierge\",\"Chill Lounge\",\"WiFi access in common areas\",\"Fully-equipped kitchens include dishwashers\",\"Smoke-free community\",\"Affordable housing available\"]\n\n\t\t\t\twhen \"NY018\"\n\t\t\t\t\tlisting[:title] = \"4-75 48th Avenue\"\n\t\t\t\t\tlisting[:city_name] = \"Long Island City\"\n\t\t\t\t\tlisting[:state_name] = \"NY\"\n\t\t\t\t\tlisting[:zipcode] = \"11109\"\n\t\t\t\t\tlisting[:contact_tel] = \"7189371390\"\n\t\t\t\t\tlisting[:description] = \"In the heart of Long Island City, the stunning Avalon Riverview North is an urban paradise entrenched near the East River, LaGuardia Airport and Grand Central Station. Our apartments in Long Island City offer spacious studios and one-, two- or three-bedroom floor plans to fit your needs. These stunning Long Island City apartments feature gourmet kitchens with granite countertops, washer and dryers, modern hardwood floors, maple cabinetry and so much more. The community has a host of amenities as well, including a 24-hour concierge, state of the art fitness center, 9th floor sparkling swimming pool with views of Manhattan and a roof-garden with barbecue grills are just a few of the amenities at your disposal.\"\n\t\t\t\t\tlisting[:amenities] = [\"Granite countertops\",\"24-hour concierge\",\"Spectacular views of Manhattan skyline\",\"WiFi access in common areas\",\"Fully-equipped kitchens include dishwashers\",\"10 minutes to Grand Central on 7 train\",\"Beautifully landscaped courtyards\"]\n\n\t\t\t\twhen \"NY034\"\n\t\t\t\t\tlisting[:title] = \"525 West 28th Street\"\n\t\t\t\t\tlisting[:city_name] = \"New York\"\n\t\t\t\t\tlisting[:state_name] = \"NY\"\n\t\t\t\t\tlisting[:zipcode] = \"10001\"\n\t\t\t\t\tlisting[:contact_tel] = \"2122391323\"\n\t\t\t\t\tlisting[:description] = \"AVA is a first. Our apartments are energized by this great city, personalized by you. You're on the High Line - steps away from the high life of art galleries, eclectic dining, and exciting clubs and bars such as the Frying Pan. Yep. Take our DIY kits and go to town in your new West Chelsea apartment. Our brand new studio, 1- and 2-bedroom apartments feature stainless steel appliances, black quartz countertops, plank flooring, and built-in charging stations.We're also smoke free, eco-friendly,and pet-friendly (big dogs too). Work out in our awesome fitness center, take in city views on the 14th floor roof deck or attend social events exclusive to AVA friends. Dive in and make it yours.\"\n\t\t\t\t\tlisting[:amenities] = [\"Granite countertops\",\"24-hour concierge\",\"Chill Lounge\",\"WiFi access in common areas\",\"Fully-equipped kitchens include dishwashers\",\"Smoke-free community\",\"Affordable housing available\"]\n\n\t\t\t\twhen \"NY015\"\n\t\t\t\t\tlisting[:title] = \"11 East First Street\"\n\t\t\t\t\tlisting[:city_name] = \"New York\"\n\t\t\t\t\tlisting[:state_name] = \"NY\"\n\t\t\t\t\tlisting[:zipcode] = \"10003\"\n\t\t\t\t\tlisting[:contact_tel] = \"2123877720\"\n\t\t\t\t\tlisting[:description] = \"Avalon Bowery Place was designed to let you indulge in Manhattan living, the way you always dreamt. Set in the famed Bowery, this luxury residence puts you in the center of an all-encompassing lifestyle. Our luxury New York City apartments offer studios and one- or two-bedroom designs that showcase the finest blend of sophisticated appointments. These apartments in New York have features that include fully equipped gourmet kitchens with stainless steel appliances, washers and dryers, hardwood flooring, floor to ceiling windows, spacious walk-in closets and private terraces and balconies. Residents of our New York apartments have a long list of stellar community amenities at their disposal as well. These include unbeatable features such as garage parking, a landscaped courtyard, a sundeck with gas barbecue grill, views of both downtown and uptown Manhattan, a resident lounge, amazing on-site retail shops and a state of the art fitness center are all here at the apartments in New York City.\"\n\t\t\t\t\tlisting[:amenities] = [\"Granite countertops\",\"Private balcony or patio\",\"Chill Lounge\",\"WiFi access in common areas\",\"Fully-equipped kitchens include dishwashers\",\"Smoke-free community\",\"Garages and covered parking\"]\n\n\t\t\t\twhen \"NY533\"\n\t\t\t\t\tlisting[:title] = \"515 West 52nd Street\"\n\t\t\t\t\tlisting[:city_name] = \"New York\"\n\t\t\t\t\tlisting[:state_name] = \"NY\"\n\t\t\t\t\tlisting[:zipcode] = \"10019\"\n\t\t\t\t\tlisting[:contact_tel] = \"2129578200\"\n\t\t\t\t\tlisting[:description] = \"In the midst of the bustling city of Manhattan, you will discover the serenity of world class living at Avalon Clinton. Stumble upon thoughtfully designed studio, one-, and two-bedroom New York apartment rentals that will cater to all your needs. All our homes are equipped with luxurious amenities like floor-to-ceiling windows, parquet wood flooring, spacious closets, and white-on-white appliances. The Avalon Clinton apartment community offers breathtaking views of the Manhattan skyline as well as a wealth of facilities such as two private health clubs, cat-friendly homes, roof-top sky decks, and laundry rooms. The brilliant array of features and a courteous on-site staff makes this Avalon community the ideal place to set up your new home.\"\n\t\t\t\t\tlisting[:amenities] = [\"Granite countertops\",\"24-hour concierge\",\"On-site retail and restaurants\",\"WiFi access in common areas\",\"Fully-equipped kitchens include dishwashers\",\"On-site laundry facilities\",\"Complimentary package acceptance service\"]\n\n\t\t\t\twhen \"NYC40\"\n\t\t\t\t\tlisting[:title] = \"377 East 33rd Street\"\n\t\t\t\t\tlisting[:city_name] = \"New York\"\n\t\t\t\t\tlisting[:state_name] = \"NY\"\n\t\t\t\t\tlisting[:zipcode] = \"10016\"\n\t\t\t\t\tlisting[:contact_tel] = \"2126841333\"\n\t\t\t\t\tlisting[:description] = \"Enjoy beautiful views of the East River and the Chrysler building from your stunning apartment homes at Avalon Kips Bay. Discover studio, one-, two-, three- and four-bedroom New York apartment rentals that surpass all expectations in terms of their quality and design. Each of our lovely homes is equipped with amazing features such as granite countertops, stainless steel appliances, European-style marble vanities and high-speed internet access. You'll also enjoy excellent facilities within our Avalon community like an on-site fitness center with cardio theater equipment, additional storage and parking. The great collection of amenities and a professional on-site staff makes Avalon Kips Bay the ideal place to set up your new home.\"\n\t\t\t\t\tlisting[:amenities] = [\"Granite countertops\",\"24-hour concierge\",\"Ceramic tile flooring\",\"WiFi access in common areas\",\"Fully-equipped kitchens include dishwashers\",\"On-site laundry facilities\",\"Complimentary package acceptance service\"]\n\n\t\t\t\twhen \"NY525\"\n\t\t\t\t\tlisting[:title] = \"250 West 50th Street\"\n\t\t\t\t\tlisting[:city_name] = \"New York\"\n\t\t\t\t\tlisting[:state_name] = \"NY\"\n\t\t\t\t\tlisting[:zipcode] = \"10019\"\n\t\t\t\t\tlisting[:contact_tel] = \"2122455050\"\n\t\t\t\t\tlisting[:description] = \"Discover life in the Big Apple with beautiful studio, one- and two-bedroom New York apartments at Avalon Midtown West. Enjoy a wide array of world class features such as open architecture featuring angled walls, high ceilings and wall-to-wall windows that provide sweeping city views, modern appliances, breakfast bars and white cabinetry, parquet wood flooring, and Botticino marble hotel-style vanities in the bathrooms. The Midtown West community also provides various facilities for residents like a fitness Center featuring cardio theatre equipment, resistance machines, free weights and a sauna, a wireless lounge fitted with convenient laptop tables, complimentary WiFi service and plasma TV, laundry facilities, Thalia Restaurant and the Food Emporium located on site on the ground level, and an expansive community room with multiple seating groups, plasma TV, laptop tables and caterers kitchen. The excellent amenities and professional on-site staff make this New York community the ideal place to live.\"\n\t\t\t\t\tlisting[:amenities] = [\"Granite countertops\",\"24-hour concierge\",\"On site ATM\",\"WiFi access in common areas\",\"Fully-equipped kitchens include dishwashers\",\"On-site laundry facilities\",\"Complimentary package acceptance service\"]\n\n\n\t\t\t\twhen \"NY023\"\n\t\t\t\t\tlisting[:title] = \"1 Morningside Drive\"\n\t\t\t\t\tlisting[:city_name] = \"New York\"\n\t\t\t\t\tlisting[:state_name] = \"NY\"\n\t\t\t\t\tlisting[:zipcode] = \"10025\"\n\t\t\t\t\tlisting[:contact_tel] = \"2123160529\"\n\t\t\t\t\tlisting[:description] = \"Wake up every day next to the stunning Morningside and Central Parks right in the heart of Manhattan at Avalon Morningside Park. Our brand new high-rise apartments in New York City, on Manhattan's Upper West Side, offer spacious studios and one-, two- and three-bedroom options each boasting breathtaking views of the New York City skyline, East River, the parks and the rest of the sights of the city that never sleeps. The apartments in New York City sport luxury amenities like gourmet kitchens equipped with beautiful granite countertops and stainless steel appliances, spacious bathrooms with marble vanities, walk-in closets, floor to ceiling windows, washers and dryers in each home and beautiful hardwood floors. Residents can also enjoy a host of spectacular features like a state of the art fitness center with cardio theater, yoga room, children’s playroom, game room, resident lounge, landscaped courtyards and the easy access to the nearby parks’ biking and jogging trails.\"\n\t\t\t\t\tlisting[:amenities] = [\"Granite countertops\",\"24-hour concierge\",\"ENERGY STAR appliances\",\"WiFi access in common areas\",\"Fully-equipped kitchens include dishwashers\",\"On-site laundry facilities\",\"Complimentary package acceptance service\"]\n\n\t\t\t\twhen \"NY029\"\n\t\t\t\t\tlisting[:title] = \"282 11th Avenue\"\n\t\t\t\t\tlisting[:city_name] = \"New York\"\n\t\t\t\t\tlisting[:state_name] = \"NY\"\n\t\t\t\t\tlisting[:zipcode] = \"10001\"\n\t\t\t\t\tlisting[:contact_tel] = \"2125642813\"\n\t\t\t\t\tlisting[:description] = \"We believe elevating where you live is about blending it seamlessly with how you live. We go to great lengths designing amenities and choosing locations that put everything within reach. Where you live, is where you come alive. In a flourishing area, Avalon offers New York apartments that cater to all of your needs. Escape the hustle and bustle of midtown, inside our refreshing smoke-free community. Within our walls, you'll find thoughtfully designed studio, one- and two-bedroom apartment homes. Imagine entertaining in gourmet kitchens with ENERGY STAR® stainless steel appliances and quartz stone countertops. Live your life effortlessly with amenities that include a state-of-the-art fitness center, a resident lounge with a large entertaining kitchen and an outdoor lounge on the 8th floor with Hudson River and skyline views. Not to mention our community is also within walking distance to Citi Bike, C/E subway lines, Penn Station and the High Line. Make Avalon West Chelsea your next home and personal retreat within the city. This is not just apartment living. This is living up.\"\n\t\t\t\t\tlisting[:amenities] = [\"Granite countertops\",\"24-hour concierge\",\"Central to the 7-line subway extension and the High Line\",\"WiFi access in common areas\",\"Fully-equipped kitchens include dishwashers\",\"On-site laundry facilities\",\"Complimentary package acceptance service\"]\n\n\t\t\t\twhen \"NY037\"\n\t\t\t\t\tlisting[:title] = \"100 Willoughby Street\"\n\t\t\t\t\tlisting[:city_name] = \"Brooklyn\"\n\t\t\t\t\tlisting[:state_name] = \"NY\"\n\t\t\t\t\tlisting[:zipcode] = \"11201\"\n\t\t\t\t\tlisting[:contact_tel] = \"7186431581\"\n\t\t\t\t\tlisting[:description] = \"Which is why we chose to be in the heart of it all - steps from cultural icons such as the Barclay's Center and Brooklyn Flea, and local restaurants and nightlife of Fort Greene, Carroll Gardens, and Brooklyn Heights. Our brand new studio, 1-, 2-, and 3-bedroom floor plans feature kitchens with stainless steel appliances, quartz-stone countertops, and tile backsplashes. Plus, each unit comes with hard-surface plank flooring, in-unit washer/dryer, and built-in charging station. Our community also features a 58th floor rooftop deck and lounge, 30th floor terrace with fire pit and grills, heated indoor/outdoor dog run, and fully-equipped fitness center . Best of all, we're directly above the subway giving you immediate access to the A, C, F, and R trains, and less than a 5-minute walk from the 2, 3, 4, 5, B, N, and Q trains - making your home the perfect home base.\"\n\t\t\t\t\tlisting[:amenities] = [\"Granite countertops\",\"24-hour concierge\",\"Hard-surface plank flooring\",\"WiFi access in common areas\",\"Fully-equipped kitchens include dishwashers\",\"On-site laundry facilities\",\"Complimentary package acceptance service\"]\n\n\n\t\t\t\twhen \"NJ002\"\n\t\t\t\t\tlisting[:title] = \"444 Washington Boulevard\"\n\t\t\t\t\tlisting[:city_name] = \"Jersey City\"\n\t\t\t\t\tlisting[:state_name] = \"NJ\"\n\t\t\t\t\tlisting[:zipcode] = \"07310\"\n\t\t\t\t\tlisting[:contact_tel] = \"2012169200\"\n\t\t\t\t\tlisting[:description] = \"Located by the historic Waterfront Walkway on the Hudson River, Avalon Cove brings a new sense of luxury living to this metropolis. Our newly renovated Jersey City apartments boast one-, two-, three- and four-bedroom designs in this bustling haven. Some of the upgrades you will find include designer gourmet kitchens with granite counters, stainless-steel appliances, hardwood floors, espresso cabinetry, marble tile bathrooms, spacious walk-in closets and private patios and balconies with great views of Manhattan. Residents can choose to spend their leisure time in the landscaped barbecue and picnic areas, at the sparkling outdoor heated swimming pool, state of the art fitness center, clubroom with billiards or at the beautiful waterfront walkway. Residents can also engage in sporting activities as our Jersey City apartments have an indoor basketball court, two lighted tennis courts and two indoor racquetball courts. Residents of our apartments in Jersey City also have access to local public transportation, on-site storage units, private garage space, gated entrance with controlled access and 24-hour maintenance service.\"\n\t\t\t\t\tlisting[:amenities] = [\"Granite countertops\",\"Marble tile entries and baths\",\"Spacious walk-in closets\",\"24-hour emergency maintenance\",\"Fully-equipped kitchens include dishwashers\",\"On-site laundry facilities\",\"Complimentary package acceptance service\"]\n\n\t\t\t\tend\n\t\t\t\tlisting\n\t\t\tend",
"def shoe_size(player)\n out=\"no player\"\n x= game_hash[:home][:players]\n x.each do |playa|\n #this is where the players are listed and his stats\n out = playa[:shoe] if playa[:player_name]==player\n # playa.each do |key,value|\n # puts \"This is the key #{key} and this is the value #{value}\"\n # out=value if player=key\n # end\n end\n y= game_hash[:away][:players]\n y.each do |playa,stats|\n out = playa[:shoe] if playa[:player_name]==player\n end\n out\nend",
"def hash\n [admin_flag, allow_expenses_entered_against_companies_flag, allow_in_cell_entry_on_time_sheet, billable_forecast, calendar, calendar_sync_integration_flag, country, daily_capacity, days_tolerance, default_department_id, default_email, default_location_id, default_phone, disable_online_flag, enable_ldap_authentication_flag, enable_mobile_flag, enable_mobile_gps_flag, enter_time_against_company_flag, expense_approver, first_name, hide_member_in_dispatch_portal_flag, hire_date, home_email, home_extension, home_phone, hourly_cost, hourly_rate, id, identifier, inactive_date, inactive_flag, include_in_utilization_reporting_flag, last_login, last_name, license_class, mapi_name, middle_initial, minimum_hours, mobile_email, mobile_extension, mobile_phone, notes, office_email, office_extension, office_phone, project_default_board, project_default_department_id, project_default_location_id, reports_to, require_expense_entry_flag, require_start_and_end_time_on_time_entry_flag, require_time_sheet_entry_flag, restrict_default_sales_territory_flag, restrict_default_warehouse_bin_flag, restrict_default_warehouse_flag, restrict_department_flag, restrict_location_flag, restrict_project_default_department_flag, restrict_project_default_location_flag, restrict_schedule_flag, restrict_service_default_department_flag, restrict_service_default_location_flag, sales_default_location_id, schedule_capacity, schedule_default_department_id, schedule_default_location_id, security_level, security_location_id, security_role, service_default_board, service_default_department_id, service_default_location_id, service_location, service_teams, time_approver, time_reminder_email_flag, time_sheet_start_date, time_zone, title, type, vendor_number, warehouse, warehouse_bin, work_role, work_type, _info, system_flag].hash\n end",
"def hash_two_sum(value,data)\n hash = {}\n hash = add_to_hash(hash,data)\n keys = hash.keys\n data.each do |data_item|\n search_item = value - data_item\n if keys.include?(search_item)\n puts \"found in the hash\"\n break\n end\n end\nend",
"def all_holidays_with_bbq(holiday_hash)\n # return an array of holiday names (as symbols) where supply lists\n # include the string \"BBQ\"\n holiday_array = []\n holiday_hash.each do |season, holidays|\n holidays.each do |holidays,supplies|\n supplies.each do |items|\n if items == \"BBQ\"\n #binding.pry\n holiday_array << holidays\n end\n #binding.pry\nend\nend\nend\nreturn holiday_array\nend",
"def shoe_size(name)\n game_hash.each do |place, team|\n team.each do |attribute, data|\n if attribute == :players\n data.each do |player|\n if name == player[:player_name] \n return player[:shoe] \n end\n end\n end\n end\n end\nend",
"def best_in_propositions package_hash\n return nil unless @phash2ihash[package_hash]\n\n @phash2ihash[package_hash].inject({}) do |acc, el|\n if acc == {}\n el\n elsif acc[:count] < el.values.first\n {ihash: el.keys.first, count: el.values.first}\n end\n end[:ihash]\n end",
"def shoe_size(player_name)\n game_hash.each do |location, team_data|\n team_data.each do |attribute, values|\n if attribute == :players\n values.each do |person, data|\n if person.to_s == player_name\n return game_hash[location][:players][person][:shoe]\n end\n end\n end\n end\n end\nend",
"def shoe_size(player_name)\n shoe_size = \"\"\n\n game_hash.each do |key, value|\n players = value[:players]\n players.each do |element|\n if player_name == element[:player_name]\n shoe_size = element[:shoe]\n end\n end\n end\n shoe_size\nend",
"def shoe_size(player_name)\n for location in game_hash.keys\n if(game_hash[location][:players][player_name])\n return game_hash[location][:players][player_name][:shoe]\n end\n end\n return \"Player not found\"\nend",
"def service_hash()\n searched_vendor = @data_service_json['vendor']\n current()\n # in the vmc.rb code there is a comment that says 'FIXME!'\n @current_services_info.each do |service_type, value|\n value.each do |vendor, version|\n version.each do |version_str, service_descr|\n if searched_vendor == service_descr[:vendor]\n return {\n \"type\" => service_descr[:type], \"tier\" => 'free',\n \"vendor\" => searched_vendor, \"version\" => version_str\n }\n end\n end\n end\n end\n raise \"vcap does not provide a data-service which vendor is #{searched_vendor}\"\n end",
"def finder(order_meal)\n result = Hash.new \n meals = order_meal.meals\n @restaurants.reverse_each do |restaurant|\n restaurant_temp = restaurant\n meals.keys.each do |name|\n if ( restaurant.meals[name] && restaurant_temp.meals[name].quantity > 0 )\n if ( meals[name].quantity <= restaurant_temp.meals[name].quantity ) \n result[restaurant_temp.name] = Hash.new unless result[restaurant_temp.name]\n result[restaurant_temp.name][name] = meals[name].quantity\n restaurant_temp.meals[name].remove_qty(meals[name].quantity)\n else\n result[restaurant_temp.name] = Hash.new unless result[restaurant_temp.name]\n result[restaurant_temp.name][name] = restaurant_temp.meals[name].quantity\n meals[name].remove_qty(restaurant_temp.meals[name].quantity)\n end\n end\n end\n end\n\n result\n end",
"def serving_size_calc(item_to_make, order_quantity)\n # Library hash contains all baked goods that can be made\n inventory = {\"cookie\" => 1, \"cake\" => 5, \"pie\" => 7}\n\n# # Check to see whether the item being requested is in the library\n# error_counter = 3\n\n# library.each do |food|\n# if library[food] != library[item_to_make]\n# p error_counter += -1\n# end\n# end\n\n # If the item requested is not in the library then raise an error\n if !inventory.has_key?(item_to_make)\n raise ArgumentError.new(\"#{item_to_make} is not a valid input\")\n end\n\n # Match the item requested to the item in the library and calculate how many ingredients are left over\n serving_size = inventory[item_to_make]\n leftover = order_quantity % serving_size\n baked_goods = \"\"\n inventory.each do |key, value|\n if value <= leftover && leftover > 0\n baked_goods += \" \" + key + \" \" + (leftover/value).to_s\n end\n end\n\n# if serving_size_mod == library[]\n\n # Return the number of servings that can be made and how many left over ingredients are available for other items\n# case serving_size_mod\n# when 0\n if leftover == 0\n return \"Calculations complete: Make #{order_quantity/serving_size} of #{item_to_make}\"\n else\n return \"Calculations complete: Make #{order_quantity/serving_size} of #{item_to_make}, you have #{leftover} leftover ingredients. Suggested baking items:#{baked_goods}\"\n end\nend",
"def get_trio(bay_no)\n WAREHOUSE.select{|bay_no| bay[:bay_no] == bay_no}[:product]\nend",
"def find_base_price(obj, arr)\n\n price = nil\n count = 0\n\n filtered_objs = []\n\n arr.each do |obj2|\n if obj[\"product-type\"] == obj2[\"product-type\"]\n filtered_objs.push(obj2)\n end\n end\n\n #go through the options of each obj in the base price file and grab the one\n #that satisfies all of the options in the current cart file object\n filtered_objs.each do |obj2|\n obj2[\"options\"].each_key do |k|\n if obj2[\"options\"][k].include?(obj[\"options\"][k])\n count += 1\n end\n end\n if count == obj2[\"options\"].length\n price = obj2[\"base-price\"]\n break\n else\n count = 0\n end\n end\n\n price\nend",
"def fetch(filter = {})\n result = self[filter]\n\n if result.length != 1\n raise KeyError.new(\"#{filter} matched #{result.length} pallets\")\n end\n\n result.first\n end",
"def bakery_num(num_of_people, fav_food) # creating method bakery_num\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1} #creating hash. value of keys equals servings per person\n pie_qty = 0\n cake_qty = 0\n cookie_qty = 0\n dessert_array = Array.new\n has_fave = false \n\n my_list.each_key do |k| #iterates each key in the hash my_list\n if k == fav_food # making a comparison of each key in hash\n has_fave = true # gives a true value to fave_food\n #fav_food = k #fav_food is set to the value of the key ***** Redundant assignment, line deleted.\n end\n end\n\n if has_fave == false #if has_fave is false\n raise ArgumentError.new(\"You can't make that food\") #makes a new error to say that we cannot make that food because we have the incorrect arguements\n else\n fav_food_qty = my_list[fav_food] #creating a variable that, through the values method, returns an array made up by the value of the key established at fav_food \n if num_of_people % fav_food_qty == 0 #if theres no remainder in num_of_people divided fav_food_quantity\n num_of_food = num_of_people / fav_food_qty #creating num_of_food variable that gives us how many food items we should make\n return \"You need to make #{num_of_food} #{fav_food}(s).\" # returns string \n else #if there is a remainder \n while num_of_people > 0\n #\n my_list.each do |k,v|\n dessert_qty = num_of_people / v\n num_of_people = num_of_people % v\n dessert_array << dessert_qty \n end\n \n #\n # if num_of_people / my_list[\"pie\"] > 0 # if num_of_people divided by number of servings of pie is greather than zero\n # pie_qty = num_of_people / my_list[\"pie\"] # pie_qty equals num_of_people divided by servings of pie\n # num_of_people = num_of_people % my_list[\"pie\"] # num_of_people equals the remainder of num_of_people and servings of pie\n # elsif num_of_people / my_list[\"cake\"] > 0 #repetition of first set of conditions of pie\n # cake_qty = num_of_people / my_list[\"cake\"]\n # num_of_people = num_of_people % my_list[\"cake\"]\n # else\n # cookie_qty = num_of_people / my_list[\"cookie\"] \n # num_of_people = num_of_people % my_list[\"cookie\"] # so we don't have an infinite loop\n # end\n end\n return \"You need to make #{dessert_array[0]} pie(s), #{dessert_array[1]} cake(s), and #{dessert_array[2]} cookie(s).\"\n end\n end\nend",
"def extract_ingredients(meal_data, main_ingredient)\n # if COUNTER < 100\n # result = []\n meal_data[\"meals\"].each do |meal|\n for i in 1..20 do\n if meal[\"strIngredient#{i}\"]\n if meal[\"strIngredient#{i}\"].downcase == main_ingredient.downcase\n puts meal\n end\n else\n get_recipes_from_api(main_ingredient)\n puts meal\n end\n end\n # if result.length == 0\n # get_recipes_from_api(main_ingredient)\n # end\n # # COUNTER += 1\n # # else\n # # p \"Sorry, can't find #{main_ingredient}\"\n # end\n # p result\nend\nend",
"def hopper\n\tprogrammer_hash = \n \t\t{\n :grace_hopper => {\n :known_for => \"COBOL\",\n :languages => [\"COBOL\", \"FORTRAN\"]\n },\n :alan_kay => {\n :known_for => \"Object Orientation\",\n :languages => [\"Smalltalk\", \"LISP\"]\n },\n :dennis_ritchie => {\n :known_for => \"Unix\",\n :languages => [\"C\"]\n }\n }\n programmer_hash[:grace_hopper]\nend"
] |
[
"0.81601053",
"0.8157861",
"0.8017714",
"0.7990587",
"0.79893243",
"0.724268",
"0.724268",
"0.7154802",
"0.71107197",
"0.68546134",
"0.5993058",
"0.59607154",
"0.59378505",
"0.58808833",
"0.5747803",
"0.56566864",
"0.5654441",
"0.56174874",
"0.5582411",
"0.55625093",
"0.5548722",
"0.5457733",
"0.54353976",
"0.5263156",
"0.5248189",
"0.52460986",
"0.52280146",
"0.52178866",
"0.5210635",
"0.51840246",
"0.5179559",
"0.5160869",
"0.5156712",
"0.5150552",
"0.5119929",
"0.5104461",
"0.50929666",
"0.5050627",
"0.50244594",
"0.5011635",
"0.5008993",
"0.50024915",
"0.49726552",
"0.49710506",
"0.4969938",
"0.49672526",
"0.4966086",
"0.49646914",
"0.4952691",
"0.4952691",
"0.4952691",
"0.49501863",
"0.49282965",
"0.4925341",
"0.4909344",
"0.49069163",
"0.48996317",
"0.48981696",
"0.48854023",
"0.48766935",
"0.4870896",
"0.48676068",
"0.4865946",
"0.4865464",
"0.4857631",
"0.48511425",
"0.4849975",
"0.48482636",
"0.48434183",
"0.48434183",
"0.48407012",
"0.4838248",
"0.48373717",
"0.48360902",
"0.48342353",
"0.4832791",
"0.483227",
"0.48301062",
"0.48282176",
"0.48201635",
"0.4819486",
"0.48170322",
"0.4815301",
"0.48040456",
"0.48008662",
"0.4797964",
"0.47975764",
"0.479346",
"0.47889033",
"0.47808686",
"0.4779772",
"0.47729746",
"0.47724846",
"0.4771288",
"0.47600982",
"0.47552678",
"0.47544932",
"0.47544372",
"0.47511494",
"0.47494718"
] |
0.81682825
|
0
|
Challenge IV: Adding Data adding operates on the shipping_manifest hash to add a key/value pair add 2 muskets to the shipping_manifest hash below add 4 gun powder to the shipping_manifest hash below return the shipping_manifest hash below
|
def adding
shipping_manifest = {"whale bone corsets" => 5, "porcelain vases" => 2, "oil paintings" => 3}
shipping_manifest["muskets"] = 2
shipping_manifest["gun powder"] = 4
shipping_manifest
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def adding\n shipping_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n\n shipping_manifest[\"pearl necklace\"] = 1\n return shipping_manifest\nend",
"def adding\n shipping_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n \n shipping_manifest[\"pearl necklace\"] = 1\n return shipping_manifest\nend",
"def shipping_manifest\n the_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\nend",
"def adding\n shipping_manifest = {\n \"whale bone corsets\" => 5, \n \"porcelain vases\" => 2, \n \"oil paintings\" => 3\n }\nshipping_manifest[\"muskets\"] = 2\nshipping_manifest[\"gun powder\"]= 4\nshipping_manifest\nend",
"def shipping_manifest\n the_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n\nend",
"def shipping_manifest\n shipping_manifest = {\n \"whale bone corsets\" => 5,\n \"porcelain vases\" => 2,\n \"oil paintings\" => 3\n }\nend",
"def shipping_manifest\n shipping_manifest = {\n \"whale bone corsets\" => 5,\n \"porcelain vases\" => 2,\n \"oil paintings\" => 3\n }\nend",
"def shipping_manifest\n the_manifest={\n\"whale bone corsets\" => 5,\n\"porcelain vases\" => 2,\n\"oil paintings\" => 3\n}\nthe_manifest\nend",
"def retrieval\n shipping_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n shipping_manifest[\"oil paintings\"]\nend",
"def retrieval\n shipping_manifest = { \"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3 }\n\n shipping_manifest[\"oil paintings\"]\nend",
"def retrieval\n shipping_manifest = {\n \"whale bone corsets\" => 5,\n \"porcelain vases\" => 2,\n \"oil paintings\" => 3\n }\n shipping_manifest[\"oil paintings\"]\n\nend",
"def retrieval\n shipping_manifest = {\n \"whale bone corsets\" => 5, \n \"porcelain vases\" => 2, \n \"oil paintings\" => 3\n }\n \nshipping_manifest[\"oil paintings\"]\nend",
"def retrieval\n shipping_manifest = shipping_manifest = {\"whale bone corsets\" => 5,\"porcelain vases\" => 2,\"oil paintings\" => 3}\n return shipping_manifest[\"oil paintings\"]\nend",
"def length_extension_attack(mac, message, payload, oracle)\n # We will assume a 256-bit key (for no real reason other than a more realistic demonstration).\n (0..32).each do |key_size|\n # The forged message is constructed as MD4(key || original-message || glue-padding || new-message).\n # The key need not be the true key, as we only care about the key-size, as per the way Merkle-Damgard constructed digests are padded.\n # Hence, we can use any key for the glue-padding, so long as the guessed key-size is correct.\n forged_message = pad('A' * key_size + message)[key_size..-1] + payload\n\n # With the registers \"fixated\", hash the additional data you want to forge.\n registers = internal_state(mac)\n md4_mac = MD4_MAC.new('', payload, (key_size + forged_message.size) * 8, *registers)\n forged_mac = md4_mac.digest\n\n if oracle.verify(forged_message, forged_mac)\n return [forged_message, forged_mac, key_size]\n end\n end\n\n raise 'MD4 length-extension attack failed.'\nend",
"def step_6\n\t\t@summed.each do |num|\n\t\t\t@final_encryption << @alphabet[num - 1]\n\t\tend\n\t\t@final_encryption\n\tend",
"def length_extension_attack(mac, message, payload, oracle, type)\n # We will assume a 256-bit key (for no real reason other than a more realistic demonstration).\n (0..32).each do |key_size|\n # The forged message is constructed as H(key || original-message || glue-padding || new-message).\n # The key need not be the true key, as we only care about the key-size, as per the way Merkle-Damgard constructed digests are padded.\n # Hence, we can use any key for the glue-padding, so long as the guessed key-size is correct.\n forged_message = type.pad('A' * key_size + message)[key_size..-1] + payload\n\n # With the registers \"fixated\", hash the additional data you want to forge.\n registers = type.state(mac)\n forged_mac = type.new('', payload, (key_size + forged_message.size) * 8, *registers).digest\n\n if oracle.verify(forged_message, forged_mac)\n return [forged_message, forged_mac, key_size]\n end\n end\n\n raise 'Length-extension attack failed.'\n end",
"def pack(data, user, pw)\n slot = nil\n \n @store.transaction {\n @store['count'] += 1\n slot = @store['count'].to_s\n @store[slot] = {\n data: data,\n user: user,\n pwhash: pw,\n created: Time.now.utc.to_i\n }\n }\n\n slot\n end",
"def pay_size_enc(total_size)\n\t#The 32 here is for the 4 added bytes denoting the total size of the payload\n\tsize_signature = (8 * total_size + 32).to_s(2) #8 for bits per byte\n\n\t#Pad 0's here I think(bad commenting)\n\tsize_signature = ((\"0\" * (32 - size_signature.size)) + size_signature).split('')\nend",
"def retrieval\n shipping_manifest['oil paintings']\nend",
"def create_invite_hash!\n self.invite_hash = Digest::SHA2.new(256).update(\"#{self.serializable_hash}+#{Time.now}+jibffffrrrji!@#sh\").to_s[2..12]\n end",
"def digests_data\n {\n '1' => '7a8a3dad389031160f79817c14bb5f3adf058335',\n '2' => '8d4fc3e19f141135ca59f0ba5d9e8b634f04840e',\n '3' => '88f879b8aa22eb340019449955accdca62886f64',\n '4' => 'dba9f7cc5b15cc2eee74a288e6c04431d2f5e509',\n '5' => 'febf0d5b94e4dd2cd23f3a9cd515641885a50980',\n '6' => '2628bf51107c4c5cd581179df5d1148821f8a7a8',\n '7' => '83f929fdce5dfe931f9ccc6af49e2cfd436740f4',\n '8' => '5f9e781563ab48e7a67ec4500321b1ebe553f3fc',\n '9' => '8b14bf8dfa2bc7d74443cd9c4a0d836f1341becb',\n '10' => '5442273b216f7c843de10acc57c33638f7848f74',\n '11' => '3871068443e406fbff7ad6f91bd395bf9482a259',\n '12' => '9e52c47b63dd968ba2349779a86986eff2f2b860',\n '13' => '658ba6008127dc4e61eb5bbe70ec69be5524b845'\n }\n end",
"def makehash(body)\n if ENV.include?(\"MCOLLECTIVE_PSK\")\n psk = ENV[\"MCOLLECTIVE_PSK\"]\n else\n raise(\"No plugin.psk configuration option specified\") unless @config.pluginconf.include?(\"psk\")\n psk = @config.pluginconf[\"psk\"]\n end\n \n Digest::MD5.hexdigest(body.to_s + psk)\n end",
"def set_outgoing_hash\n \n \t\tdata = \tself.class.get_payumoney_key + \"|\" + self.id.to_s + \"|\" + self.amount.to_s + \"|\" + get_product_info + \"|\" + get_first_name + \"|\" + get_email + \"|||||\" + get_udf5 + \"||||||\" + self.class.get_payumoney_salt\n\n \t\tself.outgoing_hash = Digest::SHA512.hexdigest(data)\n \tend",
"def create_app_key(string, pepper = rand(9**99).to_s)\n # Hash then encrypt our seed string\n 10.times do\n # Run our string through 10 rounds of SHA512, each time \"peppering\" it with random data\n 10.times do\n string = sha512(string + pepper)\n end\n # Encrypt the end result to further obfuscate things\n string = encrypt(string + pepper)\n end\n return string[0...128] # return the end result, stripping to 128 characters\nend",
"def command_128(*args, &block)\n old_value = $game_party.marw_item_number_plus_equips($data_armors[@params[0]])\n marw_command128_8qu7(*args, &block) # Call Original Method\n # Add to receipt if the possessed number of this armor has changed\n new_value = $game_party.marw_item_number_plus_equips($data_armors[@params[0]])\n update_item_receipt(:A, @params[0], new_value, old_value)\n end",
"def fix!\n self.payload = [@ips, @authdata].flatten.pack(\"N#{@ips.size}a*\")\n self.num_ips = @ips.size\n self.checksum!\n end",
"def encode\n [@signature1].pack('L*') <<\n [@signature2].pack('L*') <<\n [@flags].pack('L*') <<\n [@version].pack('L*') <<\n @master_seed <<\n @encryption_iv <<\n [@groups_count].pack('L*') <<\n [@entries_count].pack('L*') <<\n @content_hash <<\n @master_seed2 <<\n [@rounds].pack('L*')\n end",
"def challenge29(mac, message)\n # Copy SHA1 padding code into a proc\n sha1_pad = proc do |s|\n bit_len = s.bytesize << 3\n s.force_encoding(Encoding::ASCII_8BIT)\n pad = 0x80.chr\n while ((s + pad).size % 64) != 56\n pad += \"\\x00\"\n end\n pad += [bit_len >> 32, bit_len & 0xffffffff].pack(\"N2\")\n end\n \n h = mac.unpack('N5')\n extension = ';admin=true'\n\n IO.readlines('/usr/share/dict/words', chomp: true).each do |key|\n glue = sha1_pad.call(key + message)\n forged_message = message + glue + extension\n forged_mac = CryptUtil::Digest::SHA1.digest(key.force_encoding(Encoding::ASCII_8BIT) + forged_message, h, [key, message, glue].map(&:bytesize).sum / 64)\n if CryptUtil::Digest::SHA1.authenticate_mac(forged_mac, key, forged_message)\n return forged_mac, forged_message\n end\n end\n end",
"def generate_key\n begin\n multipliers = eval(self.software.multipliers)\n key = []\n self.challenge.split(\"-\").each_with_index do |word,i|\n word = word.to_i(16) # convert hex to dec\n word *= (word[0].even?) ? multipliers[i][:even] : multipliers[i][:odd]\n key << word.to_s(16).reverse[0,8].reverse # convert dec to hex, keep only 8 rightmost hex characters\n end\n self.activation_key = key.join(\"-\").upcase\n rescue\n self.activation_key = \"error!\"\n end\n end",
"def generate_hash_24 phrase, username\n passphrase_hash = Digest::SHA256.base64digest phrase+username\n key = passphrase_hash[0,24]\n puts 'size in bytes is: ' + key.bytesize.to_s\n return key\n end",
"def add(name, password, email)\n id = Digest::SHA256.hexdigest name + '_' + password + '_' + email\n id = id[0, 8]\n @names[id] = name\n @passwords[id] = password\n @emails[id] = email\n @stats[id] = { swin: 0, slose: 0, gwin: 0, glose: 0, draw: 0 }\n\n id\n end",
"def hack(secret_size, msg, mac, final)\n sha1 = Chal28.new\n hash_words = mac.scan(/.{8}/).map{|u| u.to_i(16)}\n fake_secret = \"A\" * secret_size\n padded_orig_msg = sha1.pad_message(fake_secret + msg)\n glue_padding = padded_orig_msg.pack(\"N*\")[(fake_secret.size + msg.size)..-1]\n padded_hack_msg = sha1.pad_message(fake_secret + msg + glue_padding + final)\n\n extra_data = padded_hack_msg[padded_orig_msg.size..-1]\n\n extra_data.each_slice(16) do |chunk|\n hash_words = sha1.sha1_reduce(chunk, hash_words)\n end\n\n hacked_mac = (\"%08x\"*5) % hash_words\n\n [msg + glue_padding + final, hacked_mac]\n end",
"def hash\n id.hash + 32 * bs_request.hash\n end",
"def cache_key(package)\n stock_location = package.stock_location.nil? ? \"\" : \"#{package.stock_location.id}\"\n ship_address = package.order.ship_address\n contents_hash = Digest::MD5.hexdigest(package.contents.map {|content_item| content_item.variant.id.to_s + \"_\" + content_item.quantity.to_s }.join(\"|\"))\n @cache_key = \"Spree::Calculator::Shipping::PerVariant-#{stock_location}-#{package.order.number}-#{ship_address.country.iso}-#{ship_address.state_text}-#{ship_address.city}-#{ship_address.zipcode}-#{contents_hash}-#{I18n.locale}\".gsub(\" \",\"\")\n end",
"def universal_key_values\n fake_checksum = Digest::MD5.new\n fake_checksum.update rand(2000).to_s\n\n {:UUID => SecureRandom.uuid,\n :assetFileName => \"#{@file_name}\",\n :definition => [\"hd\", \"sd\"].sample,\n :isInMMS => [true, false].sample,\n :width => (500..1000).to_a.sample,\n :height => (500..1000).to_a.sample,\n :fileSize => (1024..200000).to_a.sample,\n :pathToBag => @bag_path,\n :checksum => fake_checksum.to_s,\n :metadata => {\n :title => Faker::Lorem.words(number: rand(6)+1).join,\n :identifier => \"ABVVGTU\".split(\"\").shuffle.join,\n :typeOfResource => \"moving image\",\n :dateCreated => [\"05/18/2015\",\"07/20/1999\",\"2/12/98E\",\"06/07/77M\",nil,\"\"].sample,\n :division => [\"dan_MIA\", \"dan\", \"myd\", nil, \"\"].sample,\n :objectIdentifier => [Faker::Code.ean, Faker::Code.ean, nil].sample,\n :format => ['Digital Betacam', 'VHS', 'DV', nil].sample,\n :generation => (1..5).to_a.push(nil).sample,\n :broadcastStandard => ['NTSC', 'PAL', nil].sample,\n :color => ['b/w', 'color', nil].sample,\n :fileFormat => ['MPEG-4', 'MOV', 'OGG', nil].sample,\n :audioCodecName => ['ALAC', 'API', 'WMAL', 'AAL', nil].sample,\n :videoCodecName => ['AJA 10-bit 4:2:2 Component YCbCr', nil, \"DXA\", 'non-ISO MPEG-2.5'].sample,\n :contentNotes => [Faker::Lorem.sentences(number: rand(2)+1).join(\" \"), nil ].sample,\n :accessNote => [Faker::Lorem.sentences(number: rand(2)+1).join(\" \"), nil ].sample,\n :duration => [\"00:16:25:23\", \"01:1#{rand{8}+1}:25:23\", \"01:16:25:#{rand{9}}#{rand{9}}\"].sample,\n :dateCaptured => Faker::Date.backward(days: 1000).strftime(\"%-m/%d/%y\"),\n :projectIdentifier => \"#{Faker::Lorem.words(number: 1).first}.xls\",\n :formerClassmark => \"* #{('A'..'Z').to_a.shuffle[0..4].join} #{('1'..'9').to_a.shuffle[0..2].join}\"\n }\n }\n end",
"def fbe_extra\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return 0\n end\n\n fbe_struct_offset = read_uint32(fbe_offset)\n if (fbe_struct_offset == 0) || ((@_buffer.offset + fbe_struct_offset + 4) > @_buffer.size)\n return 0\n end\n\n @_buffer.shift(fbe_struct_offset)\n\n fbe_result = fbe_body \\\n + id.fbe_extra \\\n + symbol.fbe_extra \\\n + side.fbe_extra \\\n + type.fbe_extra \\\n + price.fbe_extra \\\n + volume.fbe_extra \\\n\n @_buffer.unshift(fbe_struct_offset)\n\n fbe_result\n end",
"def mining_hash\n Utils.keccak(rlp_encode skip_keys: [:mix_hash, :nonce])\n end",
"def create_api_key(string, pepper = rand(9**99).to_s)\n # Hash then encrypt our seed string\n 10.times do\n # Run our string through 10 rounds of SHA512, each time \"peppering\" it with random data\n 10.times do\n string = sha512(string.to_s + pepper)\n end\n # Encrypt the end result to further obfuscate things\n string = encrypt(string + pepper)\n end\n return string[0...64] # return the end result, stripping to 64 characters\nend",
"def to_witness_payload\n pin = \"\"\n @in.each{|input| pin << input.to_payload }\n pout = \"\"\n @out.each{|output| pout << output.to_payload }\n payload = [@ver].pack(\"V\") << [0].pack(\"c\") << [1].pack(\"c\") << Bitcoin::Protocol.pack_var_int(@in.size) << pin <<\n Bitcoin::Protocol.pack_var_int(@out.size) << pout << @witness.to_payload << [@lock_time].pack(\"V\")\n payload\n end",
"def sadd\n @redis.sadd md5_list, @md5_sum\n end",
"def add(hash); end",
"def script\n raise ArgumentError, \"BTC::PublicKeyAddress: invalid data length (must be 20 bytes)\" if self.data.bytesize != 20\n BTC::Script.new << OP_DUP << OP_HASH160 << self.data << OP_EQUALVERIFY << OP_CHECKSIG\n end",
"def compute_hmac( payload )\n @hmac.digest( [ @sequence_number, payload ].pack( \"NA*\" ) )\n end",
"def add_secure_hash\n # Per MIGS requirements we must stringify, sort fields alphabetically\n # minus the 'vpc_' prefix, add back the 'vpc_' prefix after sorting,\n # then join all fields as a query string separated by '&'.\n sorted_values = @fields.stringify_keys\n .map { |(k, v)| [k.gsub('vpc_', ''), v] }\n .sort\n .map { |i| \"vpc_#{i[0]}=#{i[1]}\" }\n .join('&')\n hash = OpenSSL::HMAC.hexdigest(HASH_ALGORITHM, [@secret].pack('H*'), sorted_values).upcase\n add_field('vpc_SecureHash', hash)\n add_field('vpc_SecureHashType', 'SHA256')\n end",
"def fbe_extra\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return 0\n end\n\n fbe_struct_offset = read_uint32(fbe_offset)\n if (fbe_struct_offset == 0) || ((@_buffer.offset + fbe_struct_offset + 4) > @_buffer.size)\n return 0\n end\n\n @_buffer.shift(fbe_struct_offset)\n\n fbe_result = fbe_body \\\n + id.fbe_extra \\\n + name.fbe_extra \\\n + state.fbe_extra \\\n + wallet.fbe_extra \\\n + asset.fbe_extra \\\n + orders.fbe_extra \\\n\n @_buffer.unshift(fbe_struct_offset)\n\n fbe_result\n end",
"def add_item(input_hash, item, qty = 0)\n# steps: use input item as key and input quantity as value \n input_hash[item] = qty\n# output: hash data structure of key/value pairs\n return input_hash\nend",
"def zcard(key); end",
"def zcard(key); end",
"def gp_signed_apdu!(apdu_data) \n apdu_data = apdu_data.dup\n apdu_data[:cla] = (apdu_data[:cla] || 0) | 0x04\n apdu_data[:data] = (apdu_data[:data] || []) + [0, 0, 0, 0, 0, 0, 0, 0]\n \n apdu_bytes = Smartcard::Iso::IsoCardMixin.serialize_apdu(apdu_data)[0...-9]\n mac = Des.send @gp_secure_channel_mac,\n @gp_secure_channel_keys[:cmac], apdu_bytes.pack('C*'),\n @gp_secure_channel_keys[:mac_iv]\n @gp_secure_channel_keys[:mac_iv] = mac\n \n apdu_data[:data][apdu_data[:data].length - 8, 8] = mac.unpack('C*')\n apdu_data[:le] = false\n iso_apdu! apdu_data\n end",
"def update!(**args)\n @bytes_to_sign = args[:bytes_to_sign] if args.key?(:bytes_to_sign)\n end",
"def update!(**args)\n @bytes_to_sign = args[:bytes_to_sign] if args.key?(:bytes_to_sign)\n end",
"def add_redundancy(pw_data)\n entries = 8000 + SecureRandom.random_number(4000)\n position = SecureRandom.random_number(entries)\n \n ret = entries.times.map{ # or whatever... just create noise ;)\n { SecureRandom.uuid.chars.to_a.shuffle.join => SecureRandom.uuid.chars.to_a.shuffle.join }\n }\n ret[position] = pw_data\n ret << position\n \n ret\n end",
"def fbe_extra\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return 0\n end\n\n fbe_struct_offset = read_uint32(fbe_offset)\n if (fbe_struct_offset == 0) || ((@_buffer.offset + fbe_struct_offset + 4) > @_buffer.size)\n return 0\n end\n\n @_buffer.shift(fbe_struct_offset)\n\n fbe_result = fbe_body \\\n + currency.fbe_extra \\\n + amount.fbe_extra \\\n\n @_buffer.unshift(fbe_struct_offset)\n\n fbe_result\n end",
"def checksum\n Digest::SHA256.file(sample_dmg).hexdigest\nend",
"def add_key( id, nonce )\n if not @_key\n return E_MISSING_SECRET\n end\n \n operation = \"add_key\"\n mesg = \"id=#{id}&nonce=#{nonce}&operation=#{operation}\"\n key = self.hmac( @_id, mesg, 'sha1' )\n \n url = URI.parse(\"http://api.yubico.com/wsapi/add_key?operation=#{operation}&id=#{id}&nonce=#{nonce}&h=#{key}\")\n url.port = 80\n res = Net::HTTP.start(url.host, url.port) { |http|\n http.get( url.path + \"?\" + url.query )\n }\n \n if( ( res.body ) && ( /status=([\\w_]+)[\\s]/.match(res.body) ) )\n @_res = res.body\n return res.body.scan(/status=([\\w_]+)[\\s]/).first\n else\n return E_UNKNOWN_ERROR\n end \n end",
"def encrypted_admin_payload\n raise 'Bad block size' unless AES.detect_block_size { |x| oracle(x) } == 16\n raise 'Is ECB??' if AES.is_ecb? { |x| oracle(x) }\n\n query = construct_query(\"\")\n length = query.length\n dangling = length % 16\n final_plaintext_block = PCKS7.pad(query[-dangling..-1]).flatten.pack('c*')\n desired_final_block = PCKS7.pad(';admin=true;h=i').flatten.pack('c*')\n\n # inject the difference (xored) into the second to last block of ciphertext\n\n difference = pairwise_xor(final_plaintext_block, desired_final_block).pack('c*')\n\n ciphertext = oracle(\"\")\n\n second_to_last_block = ciphertext[-32...-16]\n jiggered_second_to_last = pairwise_xor(second_to_last_block, difference).pack('c*')\n ciphertext[0...-32] + jiggered_second_to_last + ciphertext[-16..-1]\nend",
"def digest(data); end",
"def add_item_to_grocery_hash(item_string, grocery_hash, quantity)\n if !grocery_hash.include?(item_string.to_sym) # item_string is not in grocery_hash\n grocery_hash[item_string.to_sym] = quantity\n print_grocery_hash(grocery_hash)\n else\n update_quantity_of_item(grocery_hash[item_string.to_sym] + quantity, item_string, grocery_hash)\n end\nend",
"def calculate_secret(data, secret)\n data = data.sort{|a,b| a.to_s <=> b.to_s}.inject({}){|a,(k,v)| a[k.downcase.to_sym] = v; a}\n calculated_secret = Digest::SHA1.hexdigest(data.to_query + secret)\n data.merge(:sign => calculated_secret).to_query\n end",
"def challenge30(mac, message)\n md4_pad = proc do |s|\n bit_len = s.bytesize << 3\n s.force_encoding(Encoding::ASCII_8BIT)\n pad = 0x80.chr\n while ((pad.size + s.size) % 64) != 56\n pad += \"\\x00\"\n end\n pad += [bit_len & ((1 << 32) - 1), bit_len >> 32].pack(\"V2\")\n end\n \n h = mac.unpack(\"V4\")\n extension = \";admin=true\"\n\n IO.readlines(\"/usr/share/dict/words\", chomp: true).each do |key|\n glue = md4_pad.call(key + message)\n forged_message = message + glue + extension\n forged_mac = CryptUtil::Digest::MD4.digest(key.force_encoding(Encoding::ASCII_8BIT) + forged_message, h, [key, message, glue].map(&:bytesize).sum / 64)\n if CryptUtil::Digest::MD4.authenticate_mac(forged_mac, key, forged_message)\n return forged_mac, forged_message\n end\n end\n end",
"def prep_zip64_extra(for_local_header); end",
"def updateFromHaigyProduceGrab\n @itemId = nil\n @success = \"no\"\n allStores = Store.where(company_id: HaigyManageConstant::Company::HAIGY_ID)\n\n # a temporary security solution\n key = begin params[:key].to_s rescue \"\" end\n if key != \"jkfnlaewnofaoehdjcv32rfdkc-02mr3fdfsmf301femwecpzfepomvdlfmwdasfecz2421442385\"\n @errorMessage = \"Not allowed\"\n return\n end\n\n itemName = begin params[:item_name].to_s rescue \"\" end\n inStock = begin params[:in_stock].to_s rescue \"\" end\n purchaseUnit = begin params[:purchase_unit].to_s rescue \"\" end\n price = begin params[:price].to_f * (1.0 + HaigyManageConstant::Item::PRODUCE_PRICE_MARKUP_RATIO) rescue 0.0 end\n estimatedWeight = begin params[:estimated_weight_of_each_in_lb].to_f rescue 0.0 end\n isOrganic = begin params[:is_organic].to_s rescue \"\" end\n isSeasonal = begin params[:is_seasonal].to_s rescue \"\" end\n\n if itemName.blank?\n @errorMessage = \"The value of the parameter, item_name, is not correct.\"\n return\n end\n if inStock != \"yes\" && inStock != \"no\"\n @errorMessage = \"The value of the parameter, in_stock, is not correct.\"\n return\n end\n if purchaseUnit.blank?\n @errorMessage = \"The value of the parameter, purchase_unit, is not correct.\"\n return\n end\n unless price > 0.0\n @errorMessage = \"The value of the parameter, price, is not correct.\"\n return\n end\n unless estimatedWeight > 0.0\n @errorMessage = \"The value of the parameter, estimated_weight_of_each_in_lb, is not correct.\"\n return\n end\n if isOrganic != \"yes\" && isOrganic != \"no\"\n @errorMessage = \"The value of the parameter, is_organic, is not correct.\"\n return\n end\n if isSeasonal != \"yes\" && isSeasonal != \"no\"\n @errorMessage = \"The value of the parameter, is_seasonal, is not correct.\"\n return\n end\n\n if purchaseUnit == HaigyManageConstant::Item::PURCHASE_UNIT[:per_lb]\n purchaseUnit = HaigyManageConstant::Item::PURCHASE_UNIT[:each] # for a new item. the default unit for a new produce item is \"each\". if other unit is needed, please manually change it.\n pricePerLb = price\n priceEach = price * estimatedWeight\n else\n pricePerLb = price / estimatedWeight\n priceEach = price\n end\n\n itemName = itemName.titleize\n item = Item.where(id: params[:item_id]).first\n if item.blank?\n sameNameItems = Item.where(name: itemName, is_category: false)\n if sameNameItems.length == 1\n item = sameNameItems.first\n elsif sameNameItems.length > 1\n @errorMessage = \"Found more than one item in the database with this item name.\"\n return\n end\n end\n\n if item.present?\n @itemId = item.id\n if item.name != itemName\n @errorMessage = [\"Cannot change the item name from here. The item name in the database is: \", item.name].join(\"\")\n return\n end\n if item.is_organic != (isOrganic == \"yes\")\n @errorMessage = \"Cannot change the item attribute, is_organic, from here.\"\n return\n end\n if item.is_seasonal != (isSeasonal == \"yes\")\n @errorMessage = \"Cannot change the item attribute, is_seasonal, from here.\"\n return\n end\n\n ActiveRecord::Base.transaction do\n allStores.each do |store|\n itemInfo = StoreItemInfo.where(item_id: item.id, store_id: store.id).first\n\n if inStock == \"yes\"\n itemInfo.in_stock = true\n else\n itemInfo.in_stock = false\n itemInfo.out_of_stock_since = Time.now\n end\n\n if item.unit == HaigyManageConstant::Item::PURCHASE_UNIT[:per_lb]\n price = pricePerLb\n else\n price = priceEach\n end\n\n if price < itemInfo.price\n itemInfo.on_sale = true\n if price < itemInfo.sale_price\n itemInfo.price = itemInfo.sale_price\n end\n itemInfo.sale_price = price\n else\n itemInfo.on_sale = false\n itemInfo.sale_price = price\n itemInfo.price = price\n end\n\n itemInfo.estimated_weight_of_each_in_lb = estimatedWeight\n\n # force the price to be ceiled to the cent digit\n itemInfo.price = (itemInfo.price * 100.0).ceil / 100.0\n itemInfo.sale_price = (itemInfo.sale_price * 100.0).ceil / 100.0\n\n itemInfo.save\n\n # \"updateInStockInfoInStore\" is defined in \"StoreItemInfoConcern\"\n # also update item category infos in the store\n if item.parent_category_item_id != HaigyManageConstant::Item::DEFAULT_PARENT_CATEGORY_ITEM_ID\n unless updateInStockInfoInStore(item.parent_category_item_id, itemInfo.store_id) # has unexpected error\n raise \"Fail to update necessary category infos in the store.\"\n end\n end\n end\n\n @success = \"yes\"\n end\n else\n ActiveRecord::Base.transaction do\n newItem = Item.create(\n name: itemName,\n is_category: false,\n parent_category_item_id: HaigyManageConstant::Item::DEFAULT_PARENT_CATEGORY_ITEM_ID,\n has_fixed_item_size: false,\n unit: purchaseUnit,\n cover_image: File.open(Rails.root.join(\"resource\", \"image\", \"unknown.jpg\")),\n temporary_cover_image: true,\n is_produce: true,\n is_seasonal: (isSeasonal == \"yes\"),\n is_organic: (isOrganic == \"yes\")\n )\n @itemId = newItem.id\n\n # force the price to be ceiled to the cent digit\n priceEach = (priceEach * 100.0).ceil / 100.0\n\n allStores.each do |store|\n StoreItemInfo.create(\n item_id: @itemId,\n store_id: store.id,\n is_category_item: false,\n estimated_weight_of_each_in_lb: estimatedWeight,\n price: priceEach,\n sale_price: priceEach,\n on_sale: false,\n in_stock: (inStock == \"yes\"),\n out_of_stock_since: Time.now\n )\n end\n\n @success = \"yes\"\n end\n end\n end",
"def merchanthash\n if version.to_i == 1 \n return HashGenerator::generate(merchant_hash_key, merchant_id, order_id);\n else\n return Digest::SHA512.hexdigest(\"#{merchant_hash_key},#{merchant_id},01,#{order_id},#{gross_amount}\")\n end\n end",
"def reshelf(product, quantity)\n # NOT DEFINED IN EXAMPLES\n @inventory[product][\"quantity\"] += quantity\nend",
"def addBlankPlayer(retrosheet_id, hash)\n perfs = Hash.new\n perfs[\"career_games\"] = 0.0\n \n perfs[\"at_bats_last_1_game\"] = [0]\n perfs[\"at_bats_last_2_games\"] = [0, 0]\n perfs[\"at_bats_last_5_games\"] = [0, 0, 0, 0, 0]\n perfs[\"at_bats_last_10_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"at_bats_last_20_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"career_at_bats\"] = 0.0\n \n perfs[\"walks_last_1_game\"] = [0]\n perfs[\"walks_last_2_games\"] = [0, 0]\n perfs[\"walks_last_5_games\"] = [0, 0, 0, 0, 0]\n perfs[\"walks_last_10_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"walks_last_20_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"career_walks\"] = 0\n \n perfs[\"hits_last_1_game\"] = [0]\n perfs[\"hits_last_2_games\"] = [0, 0]\n perfs[\"hits_last_5_games\"] = [0, 0, 0, 0, 0]\n perfs[\"hits_last_10_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"hits_last_20_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"career_hits\"] = 0\n \n perfs[\"strikeouts_last_1_game\"] = [0]\n perfs[\"strikeouts_last_2_games\"] = [0, 0]\n perfs[\"strikeouts_last_5_games\"] = [0, 0, 0, 0, 0]\n perfs[\"strikeouts_last_10_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"strikeouts_last_20_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"career_strikeouts\"] = 0\n \n \n perfs[\"total_bases_last_1_game\"] = [0]\n perfs[\"total_bases_last_2_games\"] = [0, 0]\n perfs[\"total_bases_last_5_games\"] = [0, 0, 0, 0, 0]\n perfs[\"total_bases_last_10_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"total_bases_last_20_games\"] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n perfs[\"career_total_bases\"] = 0\n \n hash[retrosheet_id] = perfs\nend",
"def add(item, quantity, hash)\n hash[item] = quantity\nend",
"def increase_size\n hash_size *= 2\n end",
"def add_item(hash, item, quantity)\r\n\thash.store(item, quantity)\r\n\thash\r\nend",
"def add_item_to_list(string, quantity, hash)\n\thash[string.to_sym] = (hash[string.to_sym] || 0) + quantity\n\tp hash\nend",
"def fbe_body\n 4 + 4 \\\n + byte0.fbe_size \\\n + byte1.fbe_size \\\n + byte2.fbe_size \\\n + byte3.fbe_size \\\n + byte4.fbe_size \\\n + byte5.fbe_size \\\n + char0.fbe_size \\\n + char1.fbe_size \\\n + char2.fbe_size \\\n + char3.fbe_size \\\n + char4.fbe_size \\\n + char5.fbe_size \\\n + wchar0.fbe_size \\\n + wchar1.fbe_size \\\n + wchar2.fbe_size \\\n + wchar3.fbe_size \\\n + wchar4.fbe_size \\\n + wchar5.fbe_size \\\n + int8b0.fbe_size \\\n + int8b1.fbe_size \\\n + int8b2.fbe_size \\\n + int8b3.fbe_size \\\n + int8b4.fbe_size \\\n + int8b5.fbe_size \\\n + uint8b0.fbe_size \\\n + uint8b1.fbe_size \\\n + uint8b2.fbe_size \\\n + uint8b3.fbe_size \\\n + uint8b4.fbe_size \\\n + uint8b5.fbe_size \\\n + int16b0.fbe_size \\\n + int16b1.fbe_size \\\n + int16b2.fbe_size \\\n + int16b3.fbe_size \\\n + int16b4.fbe_size \\\n + int16b5.fbe_size \\\n + uint16b0.fbe_size \\\n + uint16b1.fbe_size \\\n + uint16b2.fbe_size \\\n + uint16b3.fbe_size \\\n + uint16b4.fbe_size \\\n + uint16b5.fbe_size \\\n + int32b0.fbe_size \\\n + int32b1.fbe_size \\\n + int32b2.fbe_size \\\n + int32b3.fbe_size \\\n + int32b4.fbe_size \\\n + int32b5.fbe_size \\\n + uint32b0.fbe_size \\\n + uint32b1.fbe_size \\\n + uint32b2.fbe_size \\\n + uint32b3.fbe_size \\\n + uint32b4.fbe_size \\\n + uint32b5.fbe_size \\\n + int64b0.fbe_size \\\n + int64b1.fbe_size \\\n + int64b2.fbe_size \\\n + int64b3.fbe_size \\\n + int64b4.fbe_size \\\n + int64b5.fbe_size \\\n + uint64b0.fbe_size \\\n + uint64b1.fbe_size \\\n + uint64b2.fbe_size \\\n + uint64b3.fbe_size \\\n + uint64b4.fbe_size \\\n + uint64b5.fbe_size \\\n end",
"def add_block(amount, payer, payee, miner, timestamp, signature, prev_hash, nonce, broadcast)\r\n hash = Digest::SHA256.new.hexdigest(amount.to_s + payer.to_s + payee.to_s + miner.to_s + timestamp.to_s + signature.to_s + prev_hash.to_s + nonce.to_s)\r\n if (hash.start_with?(\"0\" * NONCE_ZEROES)) # Hash Is Valid\r\n block = Block.new(amount.to_f, signature.to_i, timestamp.to_i, prev_hash.to_s, nonce.to_i, hash.to_s, payer.to_i, payee.to_i, miner.to_i)\r\n $blockchain << block\r\n broadcast_block(block) if (broadcast)\r\n puts $blockchain.length.to_s.green\r\n Thread.new { calc_net_worth } # Calculates net worth of all peers\r\n else\r\n puts \"Hash #{hash} Does Not Match Requirements! BLACKLISTING PEER WITH PORT #{payer}\".red\r\n $status = \"Hash #{hash} Does Not Match Requirements! BLACKLISTING PEER WITH PORT #{payer}\"\r\n peer = search_peers_by_port(payer)\r\n peer.node_type = 3 if (peer != -1)\r\n end\r\nend",
"def add_item(hash, item, quantity)\n\n hash[item] = quantity.to_i \n\n return hash\nend",
"def crypto_attack(exploit_string)\r\n getsin_msg = fetch_getsin\r\n if getsin_msg.nil?\r\n return nil\r\n end\r\n\r\n getsin_kp = 'GetSIN' + datastore['LHOST'] + '|'\r\n keystream = get_keystream(getsin_msg, getsin_kp)\r\n\r\n if keystream.length < exploit_string.length\r\n missing_bytecount = exploit_string.length - keystream.length\r\n\r\n print_status(\"Missing #{missing_bytecount} bytes of keystream ...\")\r\n\r\n inferrence_segment = ''\r\n brute_max = 4\r\n\r\n if missing_bytecount > brute_max\r\n print_status(\"Using inferrence attack ...\")\r\n\r\n # Offsets to monitor for changes\r\n target_offset_range = []\r\n for i in (keystream.length + brute_max)..(keystream.length + missing_bytecount - 1)\r\n target_offset_range << i\r\n end\r\n\r\n # Store inference results\r\n inference_results = {}\r\n\r\n # As long as we haven't fully recovered all offsets through inference\r\n # We keep our observation window in a circular buffer with 4 slots with the buffer running between [head, tail]\r\n getsin_observation = [''] * 4\r\n buffer_head = 0\r\n\r\n for i in 0..2\r\n getsin_observation[i] = [fetch_getsin].pack('H*')\r\n Rex.sleep(0.5)\r\n end\r\n\r\n buffer_tail = 3\r\n\r\n # Actual inference attack happens here\r\n while !target_offset_range.empty?\r\n getsin_observation[buffer_tail] = [fetch_getsin].pack('H*')\r\n Rex.sleep(0.5)\r\n\r\n # We check if we spot a change within a position between two consecutive items within our circular buffer\r\n # (assuming preceding entries are static in that position) we observed a 'carry', ie. our observed position went from 9 to 0\r\n target_offset_range.each do |x|\r\n index = buffer_head\r\n\r\n while index != buffer_tail do\r\n next_index = (index + 1) % 4\r\n\r\n # The condition we impose is that observed character x has to differ between two observations and the character left of it has to differ in those same\r\n # observations as well while being constant in at least one previous or subsequent observation\r\n if (getsin_observation[index][x] != getsin_observation[next_index][x]) && (getsin_observation[index][x - 1] != getsin_observation[next_index][x - 1]) && ((getsin_observation[(index - 1) % 4][x - 1] == getsin_observation[index][x - 1]) || (getsin_observation[next_index][x - 1] == getsin_observation[(next_index + 1) % 4][x - 1]))\r\n target_offset_range.delete(x)\r\n inference_results[x] = xor_strings(getsin_observation[index][x], '9')\r\n break\r\n end\r\n index = next_index\r\n end\r\n end\r\n\r\n # Update circular buffer head & tail\r\n buffer_tail = (buffer_tail + 1) % 4\r\n # Move head to right once tail wraps around, discarding oldest item in circular buffer\r\n if buffer_tail == buffer_head\r\n buffer_head = (buffer_head + 1) % 4\r\n end\r\n end\r\n\r\n # Inferrence attack done, reconstruct final keystream segment\r\n inf_seg = [\"\\x00\"] * (keystream.length + missing_bytecount)\r\n inferrence_results.each do |x, val|\r\n inf_seg[x] = val\r\n end\r\n\r\n inferrence_segment = inf_seg.slice(keystream.length + brute_max, inf_seg.length).join\r\n missing_bytecount = brute_max\r\n end\r\n\r\n if missing_bytecount > brute_max\r\n print_status(\"Improper keystream recovery ...\")\r\n return nil\r\n end\r\n\r\n print_status(\"Initiating brute force ...\")\r\n\r\n # Bruteforce first missing_bytecount bytes of timestamp (maximum of brute_max)\r\n charset = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']\r\n char_range = missing_bytecount.times.map { charset }\r\n char_range.first.product(*char_range[1..-1]) do |x|\r\n p = x.join\r\n candidate_plaintext = getsin_kp + p\r\n candidate_keystream = get_keystream(getsin_msg, candidate_plaintext) + inferrence_segment\r\n filedata = try_exploit(exploit_string, candidate_keystream, true)\r\n\r\n if !filedata.nil?\r\n return filedata\r\n end\r\n end\r\n return nil\r\n end\r\n\r\n try_exploit(exploit_string, keystream, false)\r\n end",
"def gp_install_load(file_aid, sd_aid = nil, data_hash = [], params = {},\n token = [])\n ber_params = []\n \n data = [file_aid.length, file_aid, sd_aid.length, sd_aid,\n Asn1Ber.encode_length(data_hash.length), data_hash,\n Asn1Ber.encode_length(ber_params.length), ber_params,\n Asn1Ber.encode_length(token.length), token].flatten\n response = iso_apdu! :cla => 0x80, :ins => 0xE6, :p1 => 0x02, :p2 => 0x00,\n :data => data\n response == [0x00]\n end",
"def calculate_store_additional_armor_fee(armor_order)\n amount = armor_order.unit_price * armor_order.count\n\n armor_fee = calculate_armor_payments_fee(armor_order, amount)\n toadlane_fee_percentage = Fee.find_by(:module_name => \"Armor Payments\").value\n toadlane_fee = amount * toadlane_fee_percentage / 100\n\n seller_charged_fee = armor_fee + toadlane_fee\n\n # armor_order.amount is the order amount\n amount_after_fee_to_seller = armor_order.amount - seller_charged_fee\n\n armor_order.update_attributes({\n seller_charged_fee: seller_charged_fee,\n amount_after_fee_to_seller: amount_after_fee_to_seller\n })\n end",
"def fbe_body\n 4 + 4 \\\n + id.fbe_size \\\n + name.fbe_size \\\n + state.fbe_size \\\n + wallet.fbe_size \\\n + asset.fbe_size \\\n + orders.fbe_size \\\n end",
"def randomart(dgst_alg = \"MD5\")\n fieldsize_x = 17\n fieldsize_y = 9\n x = fieldsize_x / 2\n y = fieldsize_y / 2\n\n case dgst_alg\n when \"MD5\" then raw_digest = Digest::MD5.digest(ssh_public_key_conversion)\n when \"SHA256\" then raw_digest = Digest::SHA2.new(256).digest(ssh_public_key_conversion)\n when \"SHA384\" then raw_digest = Digest::SHA2.new(384).digest(ssh_public_key_conversion)\n when \"SHA512\" then raw_digest = Digest::SHA2.new(512).digest(ssh_public_key_conversion)\n else\n raise \"Unknown digest algorithm: #{digest}\"\n end\n\n augmentation_string = \" .o+=*BOX@%&#/^SE\"\n len = augmentation_string.length - 1\n\n field = Array.new(fieldsize_x) { Array.new(fieldsize_y) {0} }\n\n raw_digest.bytes.each do |byte|\n 4.times do\n x += (byte & 0x1 != 0) ? 1 : -1\n y += (byte & 0x2 != 0) ? 1 : -1\n\n x = [[x, 0].max, fieldsize_x - 1].min\n y = [[y, 0].max, fieldsize_y - 1].min\n\n field[x][y] += 1 if (field[x][y] < len - 2)\n\n byte >>= 2\n end\n end\n\n fieldsize_x_halved = fieldsize_x / 2\n fieldsize_y_halved = fieldsize_y / 2\n\n field[fieldsize_x_halved][fieldsize_y_halved] = len - 1\n field[x][y] = len\n\n type_name_length_max = 4 # Note: this will need to be extended to accomodate ed25519\n bits_number_length_max = (bits < 1000 ? 3 : 4)\n formatstr = \"[%#{type_name_length_max}s %#{bits_number_length_max}u]\"\n output = \"+--#{sprintf(formatstr, type.upcase, bits)}----+\\n\"\n\n fieldsize_y.times do |y|\n output << \"|\"\n fieldsize_x.times do |x|\n output << augmentation_string[[field[x][y], len].min]\n end\n output << \"|\"\n output << \"\\n\"\n end\n output << \"+#{\"-\" * fieldsize_x}+\"\n output\n end",
"def passive\t\t\n\tif @body.size > 4\n\t\thash=Digest::MD5.hexdigest(@body[0..500])\t\n\t\t[{:name=>\"hash\",:string=>hash}]\n\telse\n\t\t[]\n\tend\nend",
"def update!(**args)\n @no_transient_checksum96 = args[:no_transient_checksum96] if args.key?(:no_transient_checksum96)\n @sim_hash = args[:sim_hash] if args.key?(:sim_hash)\n @sim_hash_is_trusted = args[:sim_hash_is_trusted] if args.key?(:sim_hash_is_trusted)\n @simhash_v2 = args[:simhash_v2] if args.key?(:simhash_v2)\n @simhash_v2_significance = args[:simhash_v2_significance] if args.key?(:simhash_v2_significance)\n end",
"def bphash( key, len=key.length )\n state = 0\n \n len.times{ |i|\n state = state << 7 ^ key[i]\n }\n return state\nend",
"def add(hash, package)\n info = extract_fields(package)\n info.merge!(generate_checksums(package))\n filenames = inject_package(hash, info, package)\n filenames\n end",
"def generate\n blake160_bin = [blake160[2..-1]].pack(\"H*\")\n type = [\"01\"].pack(\"H*\")\n bin_idx = [\"P2PH\".each_char.map { |c| c.ord.to_s(16) }.join].pack(\"H*\")\n payload = type + bin_idx + blake160_bin\n ConvertAddress.encode(@prefix, payload)\n end",
"def calc_checksum\n @encrypted_name.chars.delete_elem('-').group_eq.transform_values(&:length).sort_by do |_, v|\n -v\n end.group_by(&:second).map do |_, v|\n v.sort\n end.sum.map(&:first).take(5).join\n end",
"def create_item_pack_product_code\n puts \"IN RETAIL CREATE IPC\"\n cosmetic_code = \"\"\n if self.label_code == \"U\" \n if self.carton_setup.treatment_code == \"U\"\n cosmetic_code = \"UL\"\n else\n cosmetic_code = \"WX\"\n end\n else\n if self.carton_setup.treatment_code == \"U\"\n cosmetic_code = \"LB\"\n else\n cosmetic_code = \"LW\"\n end\n \n end\n \n \n class_code = self.carton_setup.product_class_code\n puts \"prod sched: \" + self.production_schedule_code\n commodity = RmtSetup.find_by_production_schedule_name(self.production_schedule_code).commodity_code\n grade_code = self.carton_setup.grade_code\n \n std_count = StandardSizeCount.find_by_standard_size_count_value_and_commodity_code_and_basic_pack_code(self.carton_setup.standard_size_count_value,commodity,self.basic_pack_code)\n \n if !std_count\n err = \"An IPC could not be found or created, because no standard_size_count record exists for the following field values: <br>\"\n err += \"standard_size_count_value: \" + self.carton_setup.standard_size_count_value.to_s + \"<br>\"\n err += \"commodity: \" + commodity + \"<br>\"\n err += \"basic_pack_code: \" + self.basic_pack_code\n raise err\n \n end\n actual_count = std_count.actual_count\n \n variety = self.carton_setup.marketing_variety_code\n \n item_pack = ItemPackProduct.find_by_product_class_code_and_commodity_code_and_grade_code_and_actual_count_and_marketing_variety_code_and_cosmetic_code_name_and_size_ref_and_basic_pack_code(class_code,commodity,grade_code,actual_count,variety,cosmetic_code,self.size_ref,self.basic_pack_code)\n \n if ! item_pack\n \n item_pack = ItemPackProduct.new\n item_pack.product_class_code = class_code\n item_pack.commodity_code = commodity\n item_pack.commodity_group_code = std_count.commodity.commodity_group_code\n item_pack.cosmetic_code_name = cosmetic_code\n item_pack.grade_code = grade_code\n item_pack.basic_pack_code = self.basic_pack_code\n \n item_pack.treatment_code = self.carton_setup.treatment_code\n item_pack.treatment = Treatment.find_by_treatment_code_and_treatment_type_code(item_pack.treatment_code,\"PACKHOUSE\")\n item_pack.grade = Grade.find_by_grade_code(grade_code)\n item_pack.standard_size_count = std_count\n item_pack.standard_size_count_value = std_count.standard_size_count_value\n item_pack.marketing_variety_code = variety\n item_pack.actual_count = actual_count\n item_pack.size_ref = self.size_ref\n puts item_pack.size_ref\n item_pack.create\n \n \n end\n \n \n if ! self.new_record?\n old_ri = RetailItemSetup.find(self.id)\n old_ipc = old_ri.item_pack_product_code \n old_mark = old_ri.mark_code\n end\n \n self.item_pack_product = item_pack\n \n \n self.item_pack_product_code = item_pack.item_pack_product_code\n \n if ! self.new_record? && self.carton_setup.fg_setup\n \n if old_ipc != self.item_pack_product_code||old_mark != self.mark_code\n @update_fg = true\n end\n end\n \n end",
"def compute_shared_secret(server_ecdh_pubkey); end",
"def encrypt_block_size\n (size/8)-12\n end",
"def add(hash, item, qty)\n hash[item] = qty\n\nend",
"def add_item(g_hash,new_item,quantity = 1)\n g_hash[new_item] = quantity\nend",
"def add_item(g_hash,new_item,quantity = 1)\n g_hash[new_item] = quantity\nend",
"def generate_key\n length = 5\n begin\n self.key = SecureRandom.urlsafe_base64 length\n end while Invite.exists?(key: self.key)\n end",
"def g3\n [0x00, 0x03, 0x06, 0x05, 0x0c, 0x0f, 0x0a, 0x09, 0x18, 0x1b, 0x1e, 0x1d, 0x14, 0x17, 0x12, 0x11,\n 0x30, 0x33, 0x36, 0x35, 0x3c, 0x3f, 0x3a, 0x39, 0x28, 0x2b, 0x2e, 0x2d, 0x24, 0x27, 0x22, 0x21,\n 0x60, 0x63, 0x66, 0x65, 0x6c, 0x6f, 0x6a, 0x69, 0x78, 0x7b, 0x7e, 0x7d, 0x74, 0x77, 0x72, 0x71,\n 0x50, 0x53, 0x56, 0x55, 0x5c, 0x5f, 0x5a, 0x59, 0x48, 0x4b, 0x4e, 0x4d, 0x44, 0x47, 0x42, 0x41,\n 0xc0, 0xc3, 0xc6, 0xc5, 0xcc, 0xcf, 0xca, 0xc9, 0xd8, 0xdb, 0xde, 0xdd, 0xd4, 0xd7, 0xd2, 0xd1,\n 0xf0, 0xf3, 0xf6, 0xf5, 0xfc, 0xff, 0xfa, 0xf9, 0xe8, 0xeb, 0xee, 0xed, 0xe4, 0xe7, 0xe2, 0xe1,\n 0xa0, 0xa3, 0xa6, 0xa5, 0xac, 0xaf, 0xaa, 0xa9, 0xb8, 0xbb, 0xbe, 0xbd, 0xb4, 0xb7, 0xb2, 0xb1,\n 0x90, 0x93, 0x96, 0x95, 0x9c, 0x9f, 0x9a, 0x99, 0x88, 0x8b, 0x8e, 0x8d, 0x84, 0x87, 0x82, 0x81,\n 0x9b, 0x98, 0x9d, 0x9e, 0x97, 0x94, 0x91, 0x92, 0x83, 0x80, 0x85, 0x86, 0x8f, 0x8c, 0x89, 0x8a,\n 0xab, 0xa8, 0xad, 0xae, 0xa7, 0xa4, 0xa1, 0xa2, 0xb3, 0xb0, 0xb5, 0xb6, 0xbf, 0xbc, 0xb9, 0xba,\n 0xfb, 0xf8, 0xfd, 0xfe, 0xf7, 0xf4, 0xf1, 0xf2, 0xe3, 0xe0, 0xe5, 0xe6, 0xef, 0xec, 0xe9, 0xea,\n 0xcb, 0xc8, 0xcd, 0xce, 0xc7, 0xc4, 0xc1, 0xc2, 0xd3, 0xd0, 0xd5, 0xd6, 0xdf, 0xdc, 0xd9, 0xda,\n 0x5b, 0x58, 0x5d, 0x5e, 0x57, 0x54, 0x51, 0x52, 0x43, 0x40, 0x45, 0x46, 0x4f, 0x4c, 0x49, 0x4a,\n 0x6b, 0x68, 0x6d, 0x6e, 0x67, 0x64, 0x61, 0x62, 0x73, 0x70, 0x75, 0x76, 0x7f, 0x7c, 0x79, 0x7a,\n 0x3b, 0x38, 0x3d, 0x3e, 0x37, 0x34, 0x31, 0x32, 0x23, 0x20, 0x25, 0x26, 0x2f, 0x2c, 0x29, 0x2a,\n 0x0b, 0x08, 0x0d, 0x0e, 0x07, 0x04, 0x01, 0x02, 0x13, 0x10, 0x15, 0x16, 0x1f, 0x1c, 0x19, 0x1a][self]\n end",
"def hash\n [airline_data, amount, avs_postcode_policy, bill_to, card_holder_name, cardnumber, csc, csc_policy, currency, duplicate_policy, expmonth, expyear, external_mpi, identifier, match_avsa, mcc6012, merchantid, sdk, ship_to, threedsecure, trans_info, trans_type].hash\n end",
"def redeem\n new_bottles = free_bottles_and_caps(@bottles, @caps)\n @bottles = new_bottles + leftover_bottles(@bottles)\n @caps = new_bottles + leftover_caps(@caps)\n @total_bottles += new_bottles\n redeem if redeemable?\nend",
"def update_quantity(input_hash, item, qty)\n# steps: use input item as key and input quantity as value\n# output: hash \n input_hash[item] = qty\n \nreturn input_hash\nend",
"def add(item, quantity, hash)\n hash[item] = quantity\n puts hash\nend",
"def create(id, key, length: 16)\n pem, keygap = Keygap.new.extract(key.to_s, length)\n @aws.put_item(\n table_name: 'zold-wallets',\n item: {\n 'login' => @login,\n 'id' => id.to_s,\n 'pem' => pem,\n 'keygap' => keygap\n }\n )\n @log.info(\"New user @#{@login} created, wallet ID is #{id}, \\\nkeygap is '#{keygap[0, 2]}#{'.' * (keygap.length - 2)}'\")\n keygap\n end",
"def setup_hash(options)\n raise unless options[:transaction_key]\n raise unless options[:order_timestamp]\n amount = @fields['x_amount']\n data = \"#{@fields['x_login']}^#{@fields['x_fp_sequence']}^#{options[:order_timestamp].to_i}^#{amount}^#{@fields['x_currency_code']}\"\n hmac = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('md5'), options[:transaction_key], data)\n add_field 'x_fp_hash', hmac\n add_field 'x_fp_timestamp', options[:order_timestamp].to_i\n end",
"def hash\n [aperture_value, body_serial_number, brightness_value, cfa_pattern, camera_owner_name, color_space, components_configuration, compressed_bits_per_pixel, contrast, custom_rendered, date_time_digitized, date_time_original, device_setting_description, digital_zoom_ratio, exif_version, exposure_bias_value, exposure_index, exposure_mode, exposure_program, exposure_time, f_number, file_source, flash, flash_energy, flashpix_version, focal_length, focal_length_in35_mm_film, focal_plane_resolution_unit, focal_plane_x_resolution, focal_plane_y_resolution, gps_altitude, gps_altitude_ref, gps_area_information, gpsdop, gps_dest_bearing, gps_dest_bearing_ref, gps_dest_distance, gps_dest_distance_ref, gps_dest_latitude, gps_dest_latitude_ref, gps_dest_longitude, gps_dest_longitude_ref, gps_differential, gps_img_direction, gps_img_direction_ref, gps_date_stamp, gps_latitude, gps_latitude_ref, gps_longitude, gps_longitude_ref, gps_map_datum, gps_measure_mode, gps_processing_method, gps_satellites, gps_speed, gps_speed_ref, gps_status, gps_timestamp, gps_track, gps_track_ref, gps_version_id, gain_control, gamma, iso_speed, iso_speed_latitude_yyy, iso_speed_latitude_zzz, photographic_sensitivity, image_unique_id, lens_make, lens_model, lens_serial_number, lens_specification, light_source, maker_note_raw_data, max_aperture_value, metering_mode, oecf, pixel_x_dimension, pixel_y_dimension, recommended_exposure_index, related_sound_file, saturation, scene_capture_type, scene_type, sensing_method, sensitivity_type, sharpness, shutter_speed_value, spatial_frequency_response, spectral_sensitivity, standard_output_sensitivity, subject_area, subject_distance, subject_distance_range, subject_location, subsec_time, subsec_time_digitized, subsec_time_original, user_comment, white_balance, white_point].hash\n end",
"def add(hash, item, qty)\n hash[item] = qty\n \nend",
"def add_item(grocery_hash, grocery, quantity)\n grocery_hash [grocery] = quantity \nend"
] |
[
"0.7171773",
"0.716788",
"0.69416595",
"0.691989",
"0.6856666",
"0.67448306",
"0.67448306",
"0.65470046",
"0.5821235",
"0.57083327",
"0.5674804",
"0.5561942",
"0.55503345",
"0.5329685",
"0.5328865",
"0.5328451",
"0.5315217",
"0.5299678",
"0.5147505",
"0.51407367",
"0.51326483",
"0.50959575",
"0.5092312",
"0.50707465",
"0.50574124",
"0.5044711",
"0.50028676",
"0.49658844",
"0.4957609",
"0.4941335",
"0.4938465",
"0.49132645",
"0.49037743",
"0.48973066",
"0.48906642",
"0.48840746",
"0.48797542",
"0.48759177",
"0.48755145",
"0.48745877",
"0.4870382",
"0.48582652",
"0.48552388",
"0.4854612",
"0.48505798",
"0.4850219",
"0.48430783",
"0.48430783",
"0.48294568",
"0.48076004",
"0.48076004",
"0.4798493",
"0.47980794",
"0.47963026",
"0.47951326",
"0.47815934",
"0.47781503",
"0.47670686",
"0.47625798",
"0.4742746",
"0.47422576",
"0.47401646",
"0.47214606",
"0.47139594",
"0.47099453",
"0.4701212",
"0.46990424",
"0.4697859",
"0.46935546",
"0.46926343",
"0.4689215",
"0.46864435",
"0.4682463",
"0.4675271",
"0.46671084",
"0.4665779",
"0.4660801",
"0.46605825",
"0.46605784",
"0.46602014",
"0.46586427",
"0.46542454",
"0.46427527",
"0.4640201",
"0.464013",
"0.4640116",
"0.4638241",
"0.46334577",
"0.46334577",
"0.46330512",
"0.46324337",
"0.462928",
"0.46284646",
"0.46266747",
"0.46263954",
"0.46263942",
"0.46261603",
"0.4621006",
"0.46186003",
"0.46182993"
] |
0.72442776
|
0
|
This is used when an user register in the application, in order to confirm his registration
|
def confirmation_email(user)
# email header info MUST be added here
@recipients = user.email
@from = "#{Site.current.email}"
@subject = "SIR Information:: Welcome to SIR"
# email body substitutions go here
@body["name"] = user.login
@body["hash"] = user.activation_code
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def registration_confirmation\n\t\tuser = User.new\n\t\tuser.generate_token(:email_confirmation_token)\n\t\tUserMailer.registration_confirmation(user)\n end",
"def confirm_registration\n @user = User.find_by_confirmation_key(params[:id])\n @user or flash.now[:error] = 'Sorry, but there is no such confirmation required.'\n render :action => 'confirm_registration'\n end",
"def register_confirmation\n @account.deliver_register_confirmation unless @account.checked\n end",
"def verify_register_conclusion\n if !@user.face_confirmed?\n flash[:notice] = \"Insira um e-mail pessoal para receber nossos avisos.\"\n redirect_to email_completar_path\n return false\n end\n if !@user.is_completed?\n flash[:notice] = \"Conclua sua inscrição para acessar todas as funções do sistema\"\n #flash[:notice] = \"Não é possível finalizar seu cadastro. Aguarde até o dia 20 para se inscrever novamente!\"\n redirect_to cadastro_completar_path\n return false\n end\n end",
"def register\n if @user.blank? || (!@user.is_registered && @user.tips.count == 0 && @user.votes.count == 0)\n redirect_to :profile, alert: \"Registration Impossible. There is nothing to register\"\n elsif @user.is_registered\n redirect_to :profile, alert: \"Registration Impossible. Account already registered\"\n else\n if @user.register(user_registration_params.to_h)\n #cookies.delete(\"user_id\") #don't delete the cookie, just in case I'm logging in on someone else's device.\n sign_in @user\n redirect_to :profile, notice: \"Account successfully registered. You can now login from anywhere !\"\n else\n redirect_to :profile, alert: \"Registration failed. #{@user.errors.full_messages.to_sentence}\"\n end\n end\n end",
"def send_register_confirmation\n jump_to(\"/accounts/#{session[:account_id]}/register_confirmation\")\n end",
"def confirm_registration\n @user = User.find(params[:user_id])\n if @user.registration_token.eql?(params[:registration_token])\n #tokens match.. change user status and destroy token\n @user.status = true\n @user.registration_token = \"\"\n @user.save\n flash[:notice] = \"Congratulations \" + @user.login + \". Your account was successfully activated!\"\n else\n flash[:error] = \"Sorry the tokens mismatch, please make sure that you are accessing the correct link.\" \n end\n end",
"def new_registration\n if request.post? && params[:email] && params[:confirm_email]\n if params[:email] == params[:confirm_email]\n user = User.find_by_email(params[:email])\n user = User.create(:email => params[:email], :password => User.new_random_password(params[:email])) unless user\n session[:reg_form_callback] = [:admin, :index]\n redirect_to :controller => :registration, :action => :new, :user_id => user.id, :admin => true\n else\n flash[:notice] = \"Email addresses do not match.\"\n end\n end\n end",
"def registration_confirmation(user)\n \t@user = user\n \tmail(:to => \"#{user.name} #{user.last_name} <#{user.email}>\", :subject => \"(IMI-Map) Registered\")\n end",
"def registration_confirmation(user)\n @user = user\n\n mail to: \"yisheng90@gmail.com\", subject: \"Success! You did it.\"\n end",
"def call\n add_fields(confirm_registration: true)\n end",
"def confirm!\n UserMailer.new_registration(self).deliver_now\n super\n end",
"def registration_confirmation(user)\n @user = user\n mail(to: \"#{user.name} #{user.last_name} <#{user.email}>\",\n subject: '(IMI-Map) Registered')\n end",
"def confirm\n @user = User.new(sign_up_params)\n if @user.invalid?\n flash.now[:danger] = '入力内容にエラーがあります。'\n render :new\n return\n end\n end",
"def after_confirmation # Send welcome mail after user is successfully registered\n send_user_mail\n end",
"def confirm_new_user\n # If we end up on this page without the relevant session info, redirect to root\n return redirect_to root_path if auth_hash.blank?\n\n @institution = provider.institution\n @users = User.where(email: auth_email)\n @email = auth_email\n store_hash_in_session!\n render 'auth/confirm_new_user'\n end",
"def registration\n @saas = SETTINGS['saas_registration_mode']\n @user = User.new\n initialize_registration_form\n @errors = {\n :general => [],\n :subjects => [],\n :policies => [],\n :purchase => []\n }\n end",
"def after_confirmation; end",
"def check_user_registration\n if not user_signed_in?\n return\n end\n\n redirect_path = current_user.administrator? ? user_signup_info_edit_path(current_user) : edit_user_path(current_user)\n\n if not current_user.done_registering?\n redirect_to redirect_path\n return\n end\n\n if current_user.administrator?\n admin = current_user.becomes(current_user.type.constantize)\n if admin.account.nil? or admin.account.apps.blank?\n redirect_to redirect_path\n return\n end\n end\n\n if session['omniauth.redirect']\n redirect_to session['omniauth.redirect']\n session['omniauth.redirect'] = nil\n return\n end\n end",
"def confirm_account\n confirm\n end",
"def registration_approval_required?; false; end",
"def registration_succeed(user)\n @user = user\n\n mail to: user.email, :subject => 'Welcome to Real Thematics'\n end",
"def completed_registration\n if user_signed_in?\n unless current_user.has_role?('admin') || request.fullpath =~ /sign_out/ || current_user.needs_update_email?\n redirect_to new_setup_fee_payment_payments_url unless current_user.is_setup_fee_paid?\n end\n end\n end",
"def register\n # First Check if user is alrady logged in...!\n if @user == User.find_by_email(:email)\n flash[:errors] = \"The email provided is already registered\" #CHECK LATER ????\n redirect_to :back\n\n # Creates/Registers a new user\n else\n if params[:password] == params[:conf_password]\n @user = User.create(valid_form_params)\n respond_to do |format|\n if @user.save\n session[:user_id] = @user.id\n p session[:user_id]\n # redirect_to new_session_path\n format.html { redirect_to \"/users/#{@user.id}\", notice: 'User was successfully created.' }\n format.json { render :profile, status: :ok, location: @user }\n else\n redirect_to :back, flash[:errors] = @user.errors.full_messages\n end\n end\n end\n end\n end",
"def confirm\n if @user = UserConfirmsAccount.new(:token => params[:token]).call\n self.establish_session @user\n redirect_to profile_url, :notice => \"Thanks for confirming #{@user.email}\"\n else\n redirect_to profile_url, :notice => \"There was a problem confirming - try re-sending the email?\"\n end\n end",
"def activate \r\n redirect_to(home_url) && return unless Setting.self_registration? && params[:token]\r\n token = Token.find_by_action_and_value('signup', params[:token])\r\n redirect_to(home_url) && return unless token and !token.expired?\r\n user = token.user\r\n redirect_to(home_url) && return unless user.status == User::STATUS_REGISTERED\r\n user.status = User::STATUS_ACTIVE\r\n if user.save\r\n token.destroy\r\n flash[:notice] = l(:notice_account_activated)\r\n end\r\n redirect_to :action => 'login'\r\n end",
"def check_pending_registration!\n redirect_to dashboard_finish_registration_path if current_user.is_newbie?\n end",
"def resend_confirmation_instructions; end",
"def finish_signup\n @identity = Identity.find(params[:id])\n\n if request.patch?\n @identity.skip_confirmation_notification!\n if finish_signed_up_but_email_not_confirmed? || @identity.duplicate_email?\n @identity.send_confirmation_instructions\n flash[:info] = I18n.t(\"devise.confirmations.send_instructions\")\n redirect_to \"/\"\n end\n end\n end",
"def success_signup\n redirect_to root_path if flash[:notice].nil? || flash[:notice] != t('devise.registrations.signed_up_but_inactive')\n end",
"def after_confirmation\n end",
"def attemp_signup\n\n end",
"def confirm\n user = User.find_by_email(params[:email])\n # make sure user do not use the string \"used\" to hack the system\n if user.token != \"used\" && params[:token] == user.token\n user.confirm = true\n user.token = \"used\" #token is only for one time use\n if user.save\n session[:user_id] = user.id\n redirect_to main_path\n end\n else\n render :text => \"You have confirmed before. Or something went wrong\"\n end\n end",
"def signup_confirmation(user)\n @user= user\n debugger\n mail to: @user.email , subject: \"MovieBox Sign Up Confirmation\"\n \n end",
"def activate\n (redirect_to(home_url); return) unless Setting.self_registration? && params[:token].present?\n token = Token.find_token('register', params[:token].to_s)\n (redirect_to(home_url); return) unless token and !token.expired?\n user = token.user\n (redirect_to(home_url); return) unless user.registered?\n user.activate\n if user.save\n token.destroy\n flash[:notice] = l(:notice_account_activated)\n end\n redirect_to signin_path\n end",
"def after_inactive_sign_up_path_for(resource)\n '/app/users/registration/confirm'\n end",
"def signup_confirmation user\n @user = user\n mail to: user.email, subject: \"Welcome to the Clone\"\n end",
"def registering(authentication)\n\n if (authentication.nil?)\n authentication = Authentications.new\n authentication.provider = @omniauth['provider']\n authentication.uid = @omniauth['uid']\n user = Customer.new\n # authentication.user_id = user.id Need to save the user first to generate the automated unique id\n if (@omniauth['info'])\n user.first_name = @omniauth['info']['first_name']\n user.last_name = @omniauth['info']['last_name']\n user.address = @omniauth['info']['location']\n user.description = @omniauth['info']['description']\n user.email = @omniauth['info']['email'] #auth.info.email\n user.password = Devise.friendly_token[0,20]\n end\n\n /=if (@omniauth['extra'])\n user.tempInfo = @omniauth['extra']['raw_info']\n end=/\n \n #need to check if preference exists\n preference = Preference.find_by_id(RegisterController.id)\n user.preference_id = preference.id\n \n if (!user.save)\n if(user.errors.added? :email, :taken)\n user.email = new_email_from_existing(user.email)\n user.save\n end\n end\n\n preference.customer_id = user.id\n preference.save\n\n authentication.user_id = user.id\n authentication.save \n session[:user_id] = user.id\n \n flash[:notice] = \"Thanks for registering\\n\"\n redirect_to root_path \n else \n redirect_to root_path, :notice => \"You already have an account!\\n Please logIn \"\n \n end\n\nend",
"def signup\n\n\t\temail = params[:email] # Extract the email from the params of the signup form\n\t\ttimezone = params[:timezone] # Extract the timezone from the params of the signup form\n\n\t\t@url = uniqueUrlKeyGenerator # Generate a unique url key\n\t\told_user = User.find_by_email(email)\n\n\t\t# If user exists\n\t\tif !old_user.nil?\n\t\t # If user is not registered\n\t\t if !old_user.registered?\n\t\t # Send welcome email again and save him\n\t\t old_user.sendWelcomeEmail\n\t\t old_user.save\n\t\t end\n\t\tend\n\n\t\t# Find the user in the user db with the same email as extracted in the params\n\t\tcheck_users = User.find_by_email(email)\n\n\t\t#create a new PotentialUser object with the extarcted email, timezone and url key\n\t\tuser = User.new(email: email, url: @url, timezone: timezone, day: 1, registered: false)\n\n\t\t# If no such user exists\n\t\tif check_users.nil?\n\n\t\t#If the new user is valid and can be saved\n\t\t if user.save\n\t\t user.sendWelcomeEmail\n\t\t @title = \"Thank you for signing up\"\n\t\t @result = \"A confirmation email with instructions has been sent to you\"\n\t\t @result2 = \"Your unique access key is: \" + @url\n\n\t\t#If not valid\n\t\t else\n\t\t #Set @result as the error message\n\t\t @title = \"Looks like something went wrong ...\"\n\t\t @result = \"Email #{user.errors[:email][0]}.\".html_safe\n\t\t end\n\n\t\t#User by this email already exists\n\t\telse\n\n\t\t if !check_users.registered?\n\t\t\t # Result instance variable for the view\n\t\t\t @title = \"Looks like something went wrong ...\"\n\t\t\t @result = \"User by this email already exists, but we sent another confirmation email just in case\"\n\t\t\t else\n\t\t\t @title = \"Looks like something went wrong ...\"\n\t\t\t @result = \"User by this email already exists\"\n\t\t end\n\n\tend\n\n\t\t# Respond to only javascript, set for AJAX\n\t\trespond_to do |format|\n\t\t\tformat.js\n\t\tend\n\tend",
"def register\n if request.post?\n @user.update_attributes params['user']\n if @user.valid?\n after_register\n redirect_to welcome_path and return\n else\n if @user.errors[:email].include?(\"Already Taken\")\n # Look up the already-existing user, set the current tracker to that user, and send them along\n right_user = User.where(:email => @user.email).first\n @tracker.user_id = right_user.id\n cookies[:user_id] = right_user.id\n session[:email_pwd] = params['user']['email_password']\n @user = right_user\n @tracker.log(:existing_user_returned, \"Existing user #{@user.email} got into the landing path again.\")\n increment_page\n redirect_to welcome_path and return\n else\n @tracker.log(:failed_register, \"User creation failed with message: #{@user.errors.full_messages.join(\", \")}\")\n end\n end\n end\n render_path_page\n end",
"def confirm_new_user(token)\n user = PublicEarth::Db::User.new\n begin\n user.attributes = one.confirm_new_user(token)\n rescue\n # Check with the PostgreSQL exception message to see what kind of error we generated.\n if $! =~ /invalid user/i\n user.errors.add(:email, \"An account for #{email} does not exist.\")\n else\n user.errors.add_to_base(\"The given token does not match the one on record.\")\n end\n end\n user\n end",
"def confirm\n \t\tuser = User.find_by_uid params[:uid]\n \t\tuser.confirm_email params[:confirmation_code]\n \t\tif not user.confirmed?\n \t\tflash[:error] = \"You're link doesn't match what we have on record.\"\n \t\tredirect_to signup_path\n \t\telse\n \t\tsession[:user] = user\n \t\tflash[:success] = \"We will update you at #{user.email} with new information as it because available\"\n \t\tredirect_to dashboard_path\n \t\tend \n \tend",
"def confirm\n user = User.find(params[:id])\n authorize user\n if user.state != \"active\"\n user.confirm\n user.make_user_a_member\n\n # assume this type of user just activated someone from somewhere else in the app\n flash['notice'] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n end",
"def signup_confirmation_advisee(user)\n @user = user\n mail to: @user.email, subject: \"Advisee new registration\"\n end",
"def sign_up(resource_name, resource)\n true\n end",
"def test_registration_succeeds\n user = User.new randomize: true\n # Submit, but don't validate success, so we can assert below\n AllPages.registration_page.register(submit: true, validate_success: false, user: user)\n\n assert(AllPages.registration_page.validate_registration_success, 'The success page was not displayed after registration')\n end",
"def signup_confirmation(user_name, user_email)\n @user_name = user_name\n @user_email = user_email\n mail to: user_email, subject: \"Dum dum de dum... get started with Bridled!\"\n end",
"def send_confirmation_instructions; end",
"def register_by_email_activation(user, &block)\n token = Token.new(:user => user, :action => \"register\")\n if user.save and token.save\n Mailer.register(token).deliver\n flash[:notice] = l(:notice_account_register_done)\n redirect_to signin_path\n else\n yield if block_given?\n end\n end",
"def register_create\n begin\n user_create('devise/registrations/register')\n rescue => e\n Rails.logger.error APP_CONFIG['error'] + \"(#{e.message})\" + \",From:app/controllers/registrations_controller.rb ,Action:restaurant_create\"\n flash.now[:alert] = '發生錯誤! 註冊失敗!'\n render 'devise/registrations/register'\n end\n end",
"def signup_confirmation(user)\n @user = user\n @greeting = \"Hi\"\n\n mail to: @user.email, subject: \"Hello new friend!\"\n end",
"def register_account\n profile = Profile.new(params[:profile])\n profile = update_profile_for_register_account(profile)\n if save_objeck(profile)\n if Notifier.trigger_register_thank_you(profile.id)\n profile.histories.create(:message => \"Register Thank You email sent\")\n end\n show_success(profile.class.to_s)\n set_session_user(profile.user)\n else\n profile = handle_profile_errors(profile)\n show_failure(profile)\n end\n end",
"def signup\n end",
"def signup\n end",
"def create\n @user = User.new(user_params)\n\n if @user.save\n # UserMailer.registration_confirmation(@user).deliver\n # flash[:success] = \"Please confirm your email address to continue\"\n redirect_to root_url\n else\n flash[:error] = \"Ooooppss, something went wrong!\"\n render 'new'\n end\n \n end",
"def sign_up(resource_name, resource)\n true\n end",
"def sign_up(resource_name, resource)\n true\n end",
"def register\n @user = User.new(user_params)\n\n if @user.valid?\n @user.save\n session[:email] = @user.email\n flash[:notice] = 'Welcome.'\n redirect_to :root\n else\n render :action => \"new_user\"\n end\n end",
"def confirm_email\n user = User.find_by_email_confirm_token(params[:confirm_token])\n if user\n user.email_activate\n flash[:success] = \"La tua email è stata confermata! Benvenuto!\"\n log_in user\n remember(user)\n redirect_to groups_path\n else\n flash[:error] = \"Siamo spiacenti, ma pare che l'utente non esista.\"\n redirect_to login_path\n end\n end",
"def registration_confirmation(user)\n @user = user\n mail :to => \"#{user.name} <#{user.email}>\", :subject => \"Thanks for Registering\"\n end",
"def check_registration\n return unless Spree::Auth::Config[:registration_step]\n return if spree_current_user || current_order.email\n store_location\n redirect_to spree.checkout_registration_path\n end",
"def show\n \t@user = User.find_by_confirmation_token_and_id(params[:confirmation_token], params[:id])\n \tif @user.user_state == \"confirmed\"\n flash[:notice] = \"\" + @user.first_name + \", your account is already confirmed.\"\n redirect_to(:action => 'already_confirmed')\n else\n render :layout => \"activate\"\n end\n end",
"def confirmed?; end",
"def confirm\n confirm_user(params[:confirmation_code])\n if @user and @user.confirmed?\n @current_user_session = FrontendUserSession.new\n render :template => 'frontend/users/confirmed'\n else\n render :template => 'frontend/users/confirm_now'\n end\n end",
"def registration\n \tif request.post?\n user = User.new(user_params)\n if user.valid?\n user.save\n flash[:notice] = \"Registration Successful. Please Sign In!\"\n redirect_to root_url\n else\n flash[:alert] = user.errors.first[1]\n redirect_to users_registration_url\n end\n \tend\t\n end",
"def do_signup\n hobo_do_signup do\n if this.errors.blank?\n #flash[:notice] << \"You must activate your account before you can log in. Please check your email.\"\n flash[:notice] << \" Your account has been created.\"\n\n # FIXME: remove these two lines after you get email working reliably\n # and before your application leaves its sandbox...\n #secret_path = user_activate_path :id=>this.id, :key => this.lifecycle.key\n #flash[:notice] << \"The 'secret' link that was just emailed was: <a id='activation-link' href='#{secret_path}'>#{secret_path}</a>.\"\n else\n flash[:notice] = @this.errors.full_messages.join(\"<br/>\")\n logger.info \"error is \" + flash[:notice]\n end\n\n end\n end",
"def signup_step2\n if defined? params[:token]\n @confirmation_token = params[:token] if defined? params[:token]\n if @user.confirmation_token == @confirmation_token\n respond_to do |format|\n format.html\n end\n end\n else\n redirect_to root_path, notice: \"Invalid Token\"\n end\n end",
"def create\n @user = User.new(user_params)\n if @user.save\n @user.send_confirmation\n flash.now[:success] = \"<h4>Novo chief criado.</h4>Um email de confirmação foi enviado para: #{@user.email}.\"\n redirect_to root_path\n else\n render :new\n end\n end",
"def registration\n user.registration_for course\n end",
"def create\n @user = User.new(user_params)\n\n if @user.save\n RegistrationMailer.registration_confirmation(@user,\n new_email_confirmation_url(token: @user.token)).deliver\n redirect_to login_path, notice: \"A confirmation email has been sent!! Click link in the email to verify address, then log in below.\"\n else\n if @user.errors.any?\n flash[:error] = \"Error creating new user. Please try again. #{@user.errors.full_messages.first}.\"\n else\n flash[:error] = \"Error creating new user. Please try again.\"\n end\n render :new\n end\n end",
"def registration_confirmation(user)\n @account = user\n mail(:to => named_email(user), :subject => \"Outcircle - Welcome\")\n end",
"def pre_resend\n \t@user = User.find(params[:id])\n \tif @user.user_state == \"confirmed\"\n flash[:notice] = \"\" + @user.first_name + \", your account is already confirmed.\"\n redirect_to(:action => 'already_confirmed', :id => params[:id])\n else\n render :layout => 'clean'\n end\n end",
"def registration\n #If the order started checkout as guest or if a user is logged in then continue\n redirect_to checkout_path and return if current_user || current_order.guest_checkout?\n @order = current_order\n redirect_to cart_path and return unless @order and @order.checkout_allowed?\n @user_session = UserSession.new(:email=> params[:email])\n end",
"def resend_confirmation\n return unless request.post?\n if current_user.activated_at\n flash.now[:error] = \"Your account has already been activated.\"\n else\n UserNotifier.deliver_signup_notification(current_user)\n flash.now[:notice] = \"Your confirmation email has been re-sent\"\n render :action => 'index'\n end\n end",
"def finish_signed_up_but_email_not_confirmed?\n @identity.update(identity_params) && !@identity.confirmed?\n end",
"def registration(user)\n @user = user\n\n mail to: @user.email_id, subject: \"Successful Registration\"\n end",
"def register\n # running successfully\n # class_name = params[:user_type].camelize\n # registration_stuff = params[\"#{params[:user_type].to_sym}\"]\n # template = \"#{params[:user_type].pluralize}/new\"\n # save_credentials(class_name, registration_stuff, template)\n\n if(params[:user_type] == 'job_seeker')\n class_name = \"JobSeeker\"\n registration_stuff = params[:job_seeker]\n template = \"job_seekers/new\"\n save_credentials(class_name, registration_stuff, template)\n else\n class_name = \"Employer\"\n registration_stuff = params[:employer]\n template = \"employers/new\"\n save_credentials(class_name, registration_stuff, template)\n end\n end",
"def signup\n return if generate_blank\n params[:user].delete('form')\n params[:user].delete('verified') # you CANNOT pass this as part of the request\n @user = User.new(params[:user])\n begin\n User.transaction(@user) do\n @user.new_password = true\n unless LoginEngine.config(:use_email_notification) and LoginEngine.config(:confirm_account)\n @user.verified = 1\n end\n if @user.save\n key = @user.generate_security_token\n url = url_for(:action => 'home', :user_id => @user.id, :key => key)\n flash[:notice] = 'Signup successful!'\n if LoginEngine.config(:use_email_notification) and LoginEngine.config(:confirm_account)\n UserNotify.deliver_signup(@user, params[:user][:password], url)\n flash[:notice] << ' Please check your registered email account to verify your account registration and continue with the login.'\n else\n flash[:notice] << ' Please log in.'\n end\n redirect_to :action => 'login'\n end\n end\n rescue Exception => e\n flash.now[:notice] = nil\n flash.now[:warning] = 'Error creating account: confirmation email not sent'\n logger.error \"Unable to send confirmation E-Mail:\"\n logger.error e\n end\n end",
"def user_signup_finished?\n unless is_guest?\n if current_user == User.friendly.find(params[:id])\n @user = current_user\n if @user.valid? == false # If user's attributes are missing, sends them to 'Finish Profile Page'\n flash[:alert] = \"Please finish signing up for Ossemble by entering your First Name, Last Name, Birth Date, Address, and ensuring your location is correct.\"\n redirect_to edit_user_registration_path # Finish Profile Page Setup with form\n end\n end\n end\n end",
"def create\n @user = User.new(user_params)\n if @user.save\n UserMailer.registration_confirmation(@user).deliver\n redirect_to root_url, notice: \"Thank-you for enrolling!\"\n else\n render \"new\"\n end\n end",
"def confirm!\n welcome_email\n super\n end",
"def candidate_sign_up\n\n end",
"def allow_registration?\n true\n end",
"def signup_confirmation(user)\n @user = user\n mail to: user.email, subject: \"Welcome\"\n end",
"def sign_up_candidate\n\n end",
"def registered?\n begin\n self.get_registration\n true\n rescue => e\n # any error should be treated as the user not being registered\n false\n end\n end",
"def register!(user)\n raise \"Already registred\" if user and not user.guest?\n self.user = user and save!\n end",
"def after_confirmation\n puts 'xxxxxxxx'\n end",
"def confirm_user\n @user = User.find_by_confirmation_token(params[:user][:confirmation_token])\n if @user.blank?\n render :confirm_user_failed\n return\n end \n # Slim down the hash I send to Devise to avoid Mass-Update-problems:\n params_user = {'name' => params[:user][:name], \n 'password' => params[:user][:password], \n 'password_confirmation' => params[:user][:password_confirmation]\n }\n if @user.update_attributes(params_user) and @user.password_match?\n @user = User.confirm_by_token(@user.confirmation_token)\n set_flash_message :notice, :confirmed \n sign_in_and_redirect(\"user\", @user)\n else\n render :confirm_user_failed\n return\n end # if\n end",
"def register!\n self.state = \"pending\"\n self.activation_code = new_code\n self.activated_at = nil \n save(:validate=>false)\n end",
"def send_on_create_confirmation_instructions; end",
"def send_on_create_confirmation_instructions; end",
"def create\n if resource.active_invitation? && !resource.new_record?\n # The user record already existed\n if resource.update(sign_up_params)\n resource.accept_invitation\n\n # Follow the standard Devise logic to sign in\n set_flash_message! :notice, :signed_up\n sign_up(resource_name, resource)\n respond_with resource, location: after_sign_up_path_for(resource)\n else\n # Follow the standard Devise failed registration logic\n clean_up_passwords resource\n set_minimum_password_length\n respond_with resource\n end\n elsif !Rails.configuration.x.recaptcha.enabled || verify_recaptcha(action: 'register')\n\n # Devise doesn't set a flash message for some reason if its going to fail\n # so do it here\n super do |user|\n flash[:alert] = _('Unable to create your account!') unless user.valid?\n\n # Attach the Shib eppn if this is part of an SSO account creation\n hash = session.fetch('devise.shibboleth_data', {})\n if hash.present? && user.valid?\n user.attach_omniauth_credentials(scheme_name: 'shibboleth',\n omniauth_hash: hash)\n end\n end\n else\n flash[:alert] = _('Invalid security check! Please make sure your browser is up to date and then try again')\n end\n end",
"def create\n @user = User.new(user_params.merge({confirm: false}))\n respond_to do |format|\n if @user.save\n UserMailer.registration_confirmation(@user).deliver!\n format.html { redirect_to new_user_path, notice: 'User was successfully created.' }\n format.json { render json: {notice: \"Please confirm your emai #{@user.email}\"} }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def registration( new_user )\n @greeting = \"Launch 'n Dine\"\n mail to: new_user.email,\n subject: \"Launch 'n Dine Welcomes You\"\n end",
"def signup_confirmation(user)\n @user = user\n\n mail to: user.email, subject: \"Sign Up Confirmation\"\n end",
"def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end",
"def signup_confirmation(user)\n @greeting = \"Hi\"\n @user = user\n\n mail to: user.email, subject: \"Sign up confirmation!\"\n end",
"def finalize\n @confirmation_token = params[:user].delete(:confirmation_token)\n self.resource = resource_class.find_for_confirmation(@confirmation_token)\n\n # Exit action and redirect if user is already confirmed\n if resource && resource.confirmed?\n yield(:already_confirmed, resource) if block_given?\n redirect_to after_confirmation_path_for(resource_name, resource)\n return\n end\n\n if resource.errors.empty?\n if params[:tos] == \"accept\"\n params[:user][:meta_data] = resource.meta_data.merge(tos_accepted_at: Time.current)\n end\n resource.assign_attributes(params[:user]) unless resource.confirmed?\n resource.perform_confirmation(@confirmation_token)\n resource.save\n sign_in resource, bypass: true\n set_flash_message(:notice, :confirmed) if is_flashing_format?\n yield(:success,resource) if block_given?\n MnoEnterprise::EventLogger.info('user_confirm', resource.id, 'User confirmed', resource)\n respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource, new_user: true) }\n else\n yield(:error,resource) if block_given?\n respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :new }\n end\n end",
"def successful_registration\n @session.visit(@pai_main_url + @view_registration)\n fill_in_fields_and_submit(generate_random_email_address, @user_password, @user_password)\n return parse_message(find_div_with_success_message)\n end",
"def signup_confirmation(user)\n @user = user\n mail to: user.email, subject: \"Sign Up Confirmation\"\n end"
] |
[
"0.7376688",
"0.73676324",
"0.72646177",
"0.72108877",
"0.7183842",
"0.7164327",
"0.71558166",
"0.71549356",
"0.71135366",
"0.7068447",
"0.6993467",
"0.6931157",
"0.69210505",
"0.6916072",
"0.690486",
"0.68920255",
"0.68788964",
"0.68666476",
"0.683368",
"0.6833013",
"0.6808013",
"0.6805649",
"0.68053967",
"0.67789525",
"0.6775123",
"0.6772803",
"0.6718446",
"0.670754",
"0.6700094",
"0.6680626",
"0.6663127",
"0.66529477",
"0.6651049",
"0.6632452",
"0.6630811",
"0.6630342",
"0.66248095",
"0.66136366",
"0.6612422",
"0.6596122",
"0.65867436",
"0.65834844",
"0.65816474",
"0.65750366",
"0.6571734",
"0.65659326",
"0.65575445",
"0.654948",
"0.6545476",
"0.65431833",
"0.653643",
"0.653303",
"0.65326667",
"0.65326667",
"0.6531063",
"0.653037",
"0.653037",
"0.65095675",
"0.6500218",
"0.64924324",
"0.64900726",
"0.648477",
"0.648112",
"0.6476806",
"0.6474128",
"0.64739096",
"0.6468873",
"0.6465205",
"0.64632994",
"0.64478844",
"0.6443449",
"0.64367956",
"0.64347124",
"0.64322704",
"0.64304245",
"0.6427229",
"0.6424461",
"0.6424181",
"0.6422769",
"0.6415419",
"0.6408667",
"0.64060885",
"0.64059603",
"0.6403219",
"0.6391359",
"0.6389455",
"0.6384677",
"0.6384237",
"0.63776183",
"0.63688636",
"0.63676184",
"0.63676184",
"0.63555056",
"0.6354178",
"0.6351354",
"0.6351311",
"0.6348708",
"0.6347781",
"0.6344098",
"0.6338914",
"0.6336065"
] |
0.0
|
-1
|
This method compose the email used when a user is deleted from the system
|
def byebye (user, sent_at = Time.now)
@subject = "SIR Information::User Deleted"
@from = "#{Site.current.email}"
@recipients = user.email
@sent_on = sent_at
@body = "Your user in SIR has been deleted. Please contact the administrator for more information"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def user_deleted\n UserMailer.user_deleted\n end",
"def after_destroy\n\n UserMailer.deliver_deleted_message(user)\n\n end",
"def account_deleted(user)\n setup_email(user)\n @subject += head_encode(\"%s's account was deleted\" / user.login)\n @body[:user] = user\n end",
"def cookbook_deleted_email(name, user)\n @name = name\n @email_preference = user.email_preference_for(\"Cookbook deleted\")\n @to = user.email\n\n auto_reply_headers_off\n\n mail(to: @to, subject: \"The #{name} cookbook has been deleted\")\n end",
"def user_deleted_mail(server)\n @login_link = SettingsHelper.get(:domain) + '/login/' + server.seed\n mail to: server.email\n end",
"def destroy\n UserMailer.destroy\n end",
"def destroy\n set_email.destroy\n flash[:notice] = \"Email Deleted!\"\n redirect_to user_emails_path(current_user.id)\n end",
"def post_delete_email\n NotificationMailer.post_delete_email('default@email.com')\n end",
"def participant_deleted(participant,school)\n @participant = participant\n @school = school\n admin_user_ids = Participant.where(\"school_id = ? and role_id < ?\",@school.id,3).all.map(&:user_id)\n schooladmins = User.where(id: admin_user_ids).all.map(&:email)\n @applicant = User.find(@participant.user_id)\n applicant_email = \"#{@applicant.fullname} <#{@applicant.email}>\"\n \n mail to: applicant_email,\n reply_to: schooladmins,\n subject: \"Re: Your registration to \" + @school.name \n end",
"def cookbook_deleted_email(name, email)\n @name = name\n @to = email\n\n mail(to: @to, subject: \"The #{name} cookbook has been deleted\")\n end",
"def cookbook_deleted_email(name, email)\n @name = name\n @to = email\n\n mail(to: @to, subject: \"The #{name} cookbook has been deleted\")\n end",
"def delete_event\n UserMailer.delete_event\n end",
"def remove_email (e)\n emails.delete_at e\n end",
"def newsletter_subscriber_delete_alert(subscription, email)\n\t\t@list_name = User.human_attribute_name subscription\n\t\t@email = email\n\t\tsendgrid_category 'Newsletter Subscriber Delete Alert'\n\t\tmail subject: \"User with email #{email} was deleted from \\\"#{@list_name}\\\" newsletter list\", to: ADMIN_EMAIL\n\tend",
"def delete_account\n UserMailer.delete_account(current_user, confirm_delete_users_url(code: ApplicationHelper.encrypt_text(\"#{Date.today}::#{current_user.id}\"))).deliver_later\n redirect_to :back, notice: 'We sent you an email to confirm your request. Please review your email and confirm the action.'\n end",
"def deleted\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"def delete_email\n\t\tcheck_delete_email_params\n\t\tEmail.delete(params[:email_id])\n\t\tredirect_to user_path(id: params[:user_id])\n\tend",
"def email_on_delete\n AttachmentMailer.email_on_delete\n end",
"def delete_email(*args)\n params = _extract_parameters(args)\n _normalize_params_keys(params)\n params['data'] = [args].flatten\n delete(\"/user/emails\", params)\n end",
"def delete_email(id, user_id = nil)\n url = user_id.to_i.zero? ? \"/user/emails/#{id}\" : \"/users/#{user_id}/emails/#{id}\"\n delete(url)\n end",
"def deliver_security_notification_destroy\n deliver_security_notification(\n recipients: [address],\n message: :mail_body_security_notification_remove,\n field: :field_mail,\n value: address\n )\n end",
"def delete(*args)\n arguments(args)\n params = arguments.params\n params['data'] = arguments.remaining unless arguments.remaining.empty?\n\n delete_request(\"/user/emails\", params)\n end",
"def deleted_order_notification(order, user)\n ModelMailer.deleted_order_notification\n end",
"def delete_rcpt( email )\n RESPONSE[\"DELRCPT\"] + email + \"\\0\"\n end",
"def destroy\n @user_email.destroy\n respond_to do |format|\n format.html { redirect_to user_emails_url, notice: 'User email was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n \t@user.destroy\n \trespond_to do |format|\n \t\tformat.html { redirect_to user_url, notice: 'User mail was successfully destroyed.' }\n \t\tformat.json { head :no_content }\n \tend\n \tend",
"def destroy\n @user = find_by_id(params[:id])\n authorize @user\n email = @user.email\n @user.destroy\n redirect_to users_path, notice: \"User #{email} deleted\"\n end",
"def user_removed_from_team(user, team)\r\n return if user.email.nil? # Don't send email if junior user (no email) or there's no email address\r\n\r\n @user = user\r\n @team = team\r\n @tenant = LandLord.new(@team).tenant\r\n\r\n from = determine_mail_from_for_general_notifications(@tenant)\r\n to = format_email_to_user(@user)\r\n subject = \"You have been removed from the team - #{team.name}\"\r\n \r\n mail(:from => from, :to => to, :subject => subject)\r\n end",
"def destroy\n unless admin_signed_in? \n flash[:notice] = \"You don't have access to that page!\"\n redirect_to root_path\n return\n end\n @email.delete\n respond_to do |format|\n format.html { redirect_to admin_path, notice: 'Email was successfully destroyed.' }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n UserMailer.delete_account_notification(user).deliver_later\n end",
"def destroy\n flash[:notice] = t 'users.flash.user_deleted', :email => @user.email\n @user.destroy\n \n respond_to do |format|\n format.json { redirect_to :action => :index }\n format.xml { head :ok }\n format.html { redirect_to :action => :index } \n end\n end",
"def destroy\n\t\tauthorize! :destroy, NotificacionEmail\n @notificacion_email.destroy\n respond_to do |format|\n format.html { redirect_to notificacion_emailes_url\nflash[:success] = 'Notificacion email fue borrado satisfactoriamente.' }\n format.json { head :no_content }\n end\n end",
"def delete_notification\n\n @greeting = \"Hi\"\n\n mail to: \"seekle.info@gmail.com\",subject:\"ユーザー退会した!\"\n \nend",
"def deleted(name, person_id)\n @person = Person.find(person_id)\n @person_deleted = name\n\n mail to: @person.email\n end",
"def destroy\n if @user.destroy\n redirect_to :attendees, flash: { warning: 'User was deleted.' }\n else\n msg = if @user.errors.present?\n @user.errors.full_messages.join(\".\\n\") + \".\"\n else \"User could not be deleted.\" end\n redirect_to @user, alert: msg\n end\n end",
"def before_destroy(record)\n contents = to_sql_delete(record)\n to_logfile(contents)\n # Send a notification to the admin, if requested:\n if @email_on_destroy\n AgexMailer.action_notify_mail(\n record.respond_to?(:user) ? record.user : nil,\n \"#{@table_name} row DELETED\",\n contents\n ).deliver\n end\n end",
"def delete_spectator(user)\n @user = user\n @study = user.study\n email_with_name = \"#{@user.name} <#{user.email}>\"\n mail(:to => email_with_name, :subject => I18n.t('users.delete_spectator.mail.subject'))\n end",
"def destroy\n if @user.authority == '2'\n flash[:danger] = 'Pre-configured Admin Cannot Be Deleted'\n redirect_to users_path\n elsif @user.email == current_user.email\n flash[:danger] = 'Oops. Don\\'t Delete Yourself'\n redirect_to users_path\n else\n sql = \"delete from histories where email = '#{@user.email}' and (date > '#{Time.now.to_date}' or (date = '#{Time.now.to_date}' and begintime > '#{Time.now.hour}' ))\"\n h = History.find_by_sql(sql)\n @user.destroy\n redirect_to users_path\n flash[:success] = 'User Was Successfully Deleted'\n end\n end",
"def delete_rcpt( email )\n RESPONSE[:delrcpt] + email + \"\\0\"\n end",
"def destroy\n @email = Email.find(params[:id])\n @organizer = Organizer.find(params[:organizer_id])\n @email.destroy\n \n respond_to do |format|\n format.html { flash[:message]=\"email contact successfully deleted !\"\n redirect_to(organizer_emails_path(@organizer)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\n if @user.has_role? :superadmin\n respond_to do |format|\n format.html { redirect_to admin_users_url, alert: 'Can\\'t destroy superadmin users.' }\n format.json { render json: 'Can\\'t destroy superadmin users.', status: :unprocessable_entity }\n end\n return\n end\n\n @user.email = @user.email + '.' + @user.id.to_s + '.deleted.com'\n unless @user.save\n respond_to do |format|\n format.html { redirect_to admin_users_url, alert: @user.errors.full_messages().join(', ') }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n return\n end\n @user.destroy\n respond_to do |format|\n format.html { redirect_to admin_users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_mailer_auto.destroy\n respond_to do |format|\n format.html { redirect_to user_mailer_autos_url, notice: 'User mailer auto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n record_activity(\"deleted user: \" + @user.email)\n redirect_to users_path, :notice => \"User deleted\"\n end",
"def destroy\r\n\r\n @user.destroy\r\n\r\n save_users_log(current_user.email, 'user_deleted',@user.to_json)\r\n\r\n respond_to do |format|\r\n format.html { redirect_to users_url, notice: 'User was successfully deleted.' }\r\n end\r\n end",
"def create\n u = User.only_deleted.where(\"email = ?\", params[:user][:email])\n\n if u.present?\n flash[:danger] = 'User Deleted. Please Contact Admin.'\n redirect_to new_user_session_path\n else\n # if valid_email(params[:user][:email]) == true\n super\n # end\n end\n end",
"def destroy\n @email_user = Email::User.find(params[:id])\n @email_user.destroy\n\n respond_to do |format|\n format.html { redirect_to(email_users_url) }\n format.xml { head :ok }\n end\n end",
"def send_deletion_notification\n @notifiable = self\n @tutor = User.find(self.user_id)\n @student = User.find(self.pupil_id)\n Notification.create(:user => @tutor, :receiver_id => @student.id, :message => @tutor.title + ' has removed you from their student list')\n end",
"def send_delete_event_notification(event, user)\n if event.notify?\n if user.use_email? && user.confirmed? && event.use_email?\n UserMailer.event_delete_email(user, event).deliver rescue user\n end\n if user.use_text? && user.confirmed_text? && event.use_text?\n success, error = TwilioHandler.new.send_text(user, t('texts.deleted_event', params: get_event_text_params(event, false), type: event.eventType.capitalize))\n end\n if user.use_call? && user.confirmed_call? && event.use_call?\n success, error = TwilioHandler.new.send_call(user, t('texts.deleted_event', params: get_event_text_params(event, false), type: event.eventType.capitalize))\n end\n end\n end",
"def destroy\n @email.destroy\n\n respond_to do |format|\n format.html { redirect_to(emails_url) }\n format.mobile { redirect_to profile_kontact_kontact_information_plural_fields_path(@profile, @kontact)}\n format.xml { head :ok }\n end\n end",
"def send_email_before_destroy\n\n #Do nothing if challenge has been closed\n return if(self.start_date + self.duration < Date.current)\n\n contestants = self.users\n\n #Send email to creator\n UserMailer.challenge_deleted_creator(self.creator, self).deliver\n\n #Send email to contestants\n contestants.each do |c|\n UserMailer.challenge_deleted_contestant(c, self).deliver\n end\n\n end",
"def destroy\n #@user.email_links.destroy_all\n @user&.destroy\n respond_to do |format|\n format.html { redirect_back fallback_location: users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n\n UserMailer.delay({ run_at: 1.minutes.from_now }).user_deleted(@user) \n\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to :users, notice: 'Пользователь успешно удален.' }\n end\n end",
"def destroy\n email_address.destroy\n flash[:notice] = 'The email address was successfully removed.'\n respond_with(email_address)\n end",
"def fRemoveNotificationsFrom (email)\n @users.removeNotificationsFrom(email)\n end",
"def removed(member)\n return unless member.idea.owner # => prevents sending when idea is deleted\n\n @member = member\n mail(:to => member.user.email, :subject => \"You have been removed from the \\\"#{member.idea.name}\\\" idea\", :tag => 'member-removed') \n end",
"def extension_delete(extension)\n @extension = extension\n @company = @extension.company_phone.company\n mail(\n to: extension.email,\n subject: \"#{@company.name} ha eliminado un conmutador.\"\n )\n end",
"def destroy\n @admin_customer_email = Admin::Customer::Email.find(params[:id])\n @admin_customer_email.destroy\n respond_to do |format|\n format.html { redirect_to admin_customer_emails_url }\n format.json { head :ok }\n end\n end",
"def leave_revoked_email_4cm(request, user, manager)\n @user = user\n mail( :to => @request.user.manager.email,\n :subject => 'User has revoked leave request' )\n end",
"def destroy\n @email = @user.emails.find(params[:id])\n @email.destroy\n\n respond_to do |format|\n format.html { redirect_to emails_url }\n format.json { head :no_content }\n end\n end",
"def project_deleted(project, admin, destination)\n @project = project\n @admin = admin\n\n mail to: destination\n end",
"def disassociation_email(teammate, pitch)\n @user = teammate.user\n @pitch = pitch\n mail(to: @user.email, subject: \"Você foi desassociado do Time: #{pitch.name}\")\n end",
"def delete_user\n end",
"def destroy\n User.all.each do |user|\n ExpenseMailer.expense_deleted_mail(@office_expense, user).deliver\n end\n @office_expense.destroy\n respond_to do |format|\n format.html { redirect_to office_expenses_url, notice: 'Office expense was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @usermail.destroy\n respond_to do |format|\n format.html { redirect_to usermails_url, notice: 'Usermail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def course_deleted(removed_course, subscriptions)\n @course = removed_course\n return if subscriptions.empty?\n recipients = subscriptions.map do |sub|\n sub.user.email\n end\n mail(to: recipients,\n subject: 'CoachUP! - One of your courses has been deleted')\n end",
"def destroy\n @car_user_email = CarUserEmail.find(params[:id])\n @car_user_email.destroy\n\n respond_to do |format|\n format.html { redirect_to(car_user_emails_url) }\n format.xml { head :ok }\n end\n end",
"def leave_revoked_email_4cm(request, user, counsellor)\n @user = user\n mail( :to => @request.user.counsellor.email,\n :subject => 'User has revoked leave request' )\n end",
"def destroy\n @vip_email.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_emails_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted a amx vip email: #{@vip_email.email}\")\n end",
"def delete()\n\n Email.destroy(self.id)\n end",
"def destroy\n @boat_user_email = BoatUserEmail.find(params[:id])\n @boat_user_email.destroy\n\n respond_to do |format|\n format.html { redirect_to(boat_user_emails_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @mail_template = MailTemplate.find(params[:id])\n @mail_template.deleted = 9\n set_user_column @mail_template\n @mail_template.save!\n \n respond_to do |format|\n format.html { redirect_to mail_templates_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\t@user = User.find(params[:id])\n\t\t@user.soft_delete!\n\t\tUserMailer.delete_email(@user).deliver_now\n\t\trender json: {}, status: 200\n\tend",
"def delete_customer_email(customer_id, email_id)\n delete(\"customers/#{customer_id}/emails/#{email_id}\")\n end",
"def destroy\n if @users.destroy\n flash[:notice] = I18n.t('admin.users.destroy.success', :name => @users.email)\n else\n flash[:notice] = I18n.t('admin.users.destroy.failure', :name => @users.email)\n end\n\n redirect_to :action => :index\n end",
"def send_emails_deleted_person\n DeletedPersonJob.perform_later(id, full_name)\n end",
"def deactivation(user)\n @user = user\n mail(to: @user.email, subject: \"Your CASA volunteer account has been deactivated\")\n end",
"def destroy\n invited_users = InvitedUser.where(email: @user.email)\n invited_users.each do |invited_user|\n Message.create(sender_id: 1, receiver_id: invited_user.inviter.id, title: \"Your friend has just left\", content: \"I am living TennisBuddy World! Thank you for inviting me, I am really sorry. #{@user.full_name}\")\n end\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def remove_notification\n \n @ac = AttachContact.find(params[:user_id])\n RecentActivity.create(:transaction_id => @transaction.id, \n :user_id => current_user.id, \n :message => \"Removed Contact: #{@ac.user.fullname} as #{@ac.role.name if @ac.role}\")\n \n render :nothing => true\n end",
"def leave_revoked_email_4cm(request, user)\n @user = user\n @request = request\n mail(\n to: @request.user.counsellor.email,\n subject: 'User has revoked leave request'\n )\n end",
"def destroy\n @caravan_user_email = CaravanUserEmail.find(params[:id])\n @caravan_user_email.destroy\n\n respond_to do |format|\n format.html { redirect_to(caravan_user_emails_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user.destroy\n sign_out if @user == current_user\n redirect_to root_path, notice: \"#{@user.email} deleted\"\n end",
"def destroy\n @usuarios_email.destroy\n respond_to do |format|\n format.html { redirect_to usuarios_emails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n email = AuthenticationHelper::Auth.instance.getEmailFromJWT( request )\n \n if ( email == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n user = User.find_by(email: email)\n if user.destroy\n render json: :nothing, status: :ok\n else\n render json: :nothing, status: :unprocessable_entity\n end\n end",
"def account_expired(user) \n mail to: user.email, subject: \"Sorry to see you go the way of the Dodo...\"\n end",
"def leave_revoked_email_4cm(request, user)\n @user = user\n @request = request\n mail(\n to: @request.user.manager.email,\n subject: 'User has revoked leave request'\n )\n end",
"def delete(options = {})\n default_options = {:conditions => [\"mail_items.user_id = ?\", @user.id]}\n add_mailbox_condition!(default_options, @type)\n return delete_mail(default_options, options)\n end",
"def delete_user(user_email)\n user = User.all.where(email: user_email)\n user.delete!\n end",
"def add_email(*args)\n params = _extract_parameters(args)\n params['data'] = [args].flatten\n delete(\"/user/emails\", params)\n end",
"def destroy\n @mailuser = Mailuser.find(params[:id])\n\t\t@domain = @mailuser.domain\n\t\tif @currentuser.administrator or @currentuser == @domain.owner \n \t@mailuser.destroy\n\t\tend\n\n respond_to do |format|\n\t\t\tformat.html { redirect_to(:action => \"show\", :controller => \"domains\", :id => @domain.id) }\n format.xml { head :ok }\n end\n end",
"def order_delete\n OrderMailer.order_delete\n end",
"def destroy\n remove_email_dependencies\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url, notice: 'Email was destroyed.' }\n format.json { head :no_content }\n end\n end",
"def cancellation_email(user)\n mail( :to => user.email,\n :subject => \"Your Room Cancellation\",\n :body => \"Thank you very much for notifying us about your room cancellation. Your reservation has been cancelled.\" )\n end",
"def destroy\n @admin_system_email.destroy\n respond_to do |format|\n format.html { redirect_to admin_system_emails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n #any suggested changes assigned to this user will be set to assigned_to_id = null automatically by the foreign key constraint.\n respond_to do |format|\n if @user.application_admin? && User.where(application_admin?: true).count == 1\n flash[:error] = \"The last application admin user cannot be deleted.\"\n format.html { redirect_to users_path }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n elsif ChangeLogEntry.where(user: @user).count > 0\n flash[:error] = \"This user can't be deleted, because there are one or more change log entries for actions they took. If this user no longer uses the application, try setting them to inactive instead.\"\n format.html { redirect_to users_path }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n else\n @user.destroy\n format.html { redirect_to users_url, notice: 'User was successfully deleted. Any suggested changes assigned to this user are now assigned to no one.' }\n format.json { head :no_content }\n end\n end\n end",
"def delete(email)\n raise NotImplementedError, \"Please implement this in your concrete class\"\n end",
"def parse_user_remove(msg_details)\n username = msg_details\n @userlist_table[username] = nil\n return username\n end",
"def destroy\n @user_mail = UserMail.find(params[:id])\n @user_mail.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_mails_url) }\n format.xml { head :ok }\n end\n end",
"def email_on_delete(attachment)\n @attachment = attachment\n attachments.inline[\"alaraby_logo.png\"] = File.read(\"#{Rails.root}/app/assets/images/alaraby_logo.png\")\n \n mail to: array_of_emails(AttachmentEmail), subject: \"Attachment Deleted\"\n end",
"def destroy\n begin\n @user.destroy\n Mailer.destroy_user(@user).deliver\n flash[:notice] = \"User #{@user.username} deleted\"\n rescue StandardError => e\n flash[:notice] = e.message\n end\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def remove_user_from_mailchimp\n unless self.email.include?('@example.com')\n mailchimp = Hominid::API.new(AppConstants.mailchimp_key)\n list_id = mailchimp.find_list_id_by_name AppConstants.mailchimp_list\n result = mailchimp.list_unsubscribe(list_id, self.email, true, false, true) \n Rails.logger.info(\"Mailchimp unsubscribed for email id #{self.email}\")\n end\n end"
] |
[
"0.76268005",
"0.7436916",
"0.7251764",
"0.71380574",
"0.7031096",
"0.68742925",
"0.6869542",
"0.68219435",
"0.67850935",
"0.6746352",
"0.6746352",
"0.6690385",
"0.66850585",
"0.6681179",
"0.6678106",
"0.66530687",
"0.65828204",
"0.6572052",
"0.65576535",
"0.6510099",
"0.65006334",
"0.6482895",
"0.6444505",
"0.6434978",
"0.6375111",
"0.63682854",
"0.6332262",
"0.63286096",
"0.63241357",
"0.6301006",
"0.6281175",
"0.6272991",
"0.623934",
"0.62358963",
"0.6231328",
"0.62294406",
"0.6218591",
"0.62072",
"0.62049854",
"0.62012017",
"0.61750025",
"0.61740553",
"0.6168911",
"0.61644",
"0.61609465",
"0.61511976",
"0.6148838",
"0.6140309",
"0.61382043",
"0.6135097",
"0.61336976",
"0.6132086",
"0.6124572",
"0.6109109",
"0.60998046",
"0.6097978",
"0.60862243",
"0.6084126",
"0.6078851",
"0.60782754",
"0.6076606",
"0.6070984",
"0.60638726",
"0.6051144",
"0.60505146",
"0.603385",
"0.6033479",
"0.6033462",
"0.6021109",
"0.60188013",
"0.60163385",
"0.6003569",
"0.5988774",
"0.5985398",
"0.5973984",
"0.59717816",
"0.5965865",
"0.59645796",
"0.5964473",
"0.59578246",
"0.5950809",
"0.594671",
"0.59449327",
"0.5940414",
"0.59383076",
"0.5935781",
"0.59313065",
"0.592819",
"0.59238267",
"0.5912984",
"0.591282",
"0.59122866",
"0.58992076",
"0.5878842",
"0.5875826",
"0.58684397",
"0.5865002",
"0.5864996",
"0.5861053",
"0.5858244"
] |
0.6995199
|
5
|
This is used when a user ask for his password.
|
def forgot_password(user)
@recipients = user.email
@from = "#{Site.current.email}"
@subject = 'Request to change your password'
@body ["name"] = user.login
@body["url"] = "http://#{Site.current.domain}/reset_password/#{user.reset_password_code}"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def prompt_for_user_password!\n e.execute_as_user('')\n end",
"def ask_for_password(prompt)\n ui.ask_for_password prompt\n end",
"def password_request\n password_input = @prompt.mask(\"Please enter your password, or type quit.\")\n if password_input == @user.password\n puts \"Successful login!\"\n @user\n user_menu_runner\n #user can quit this process\n elsif password_input == \"quit\" || password_input == \"exit\"\n exit\n else\n #try again\n puts \"Sorry, incorrect password. Try again.\" # add esscape option\n password_request\n end\n end",
"def enter_password\n end",
"def password\n password = @prompt.mask(\"Enter password: \", required: true)\n if password == @current_user.password\n true\n else\n puts \"Password is invalid.\"\n sleep(1)\n false\n end\n end",
"def get_password(username)\n password = ask(\"password for #{username}:\") { |q| q.echo = false }\n password\nend",
"def password\n end",
"def password\n end",
"def ask_for_password\n echo_off\n password = ask\n puts\n echo_on\n return password\n end",
"def password; end",
"def password; end",
"def password; end",
"def password; end",
"def password; end",
"def password; end",
"def ask_password\n @display.echo_off\n print 'Enter password (6 - 20 characters): ', false, false\n @state = :new_password\n end",
"def password\n\n end",
"def password_required?; end",
"def valid_password?; end",
"def password_prompt(prompt=\"Password: \")\n ui.ask(prompt) { |q| q.echo = false }\n end",
"def prompt_password\n TTY::Prompt.new.mask(\"Redacted password?\", required: true)\n end",
"def password?\n password\n end",
"def password \n @password \n end",
"def password(message = 'Password: ', mask = '*')\n pass = ask(message) { |q| q.echo = mask }\n pass = password message, mask if pass.nil? || pass.empty?\n pass\n end",
"def askPassword(prompt=\"Enter Password : \")\n ask(prompt) {|q| q.echo = false}\nend",
"def password\n @password\n end",
"def password\n @password\n end",
"def input_acceptable_password\n fill_in(PASSWORD_INPUT_ID, :with => 'qwerty12345')\n end",
"def password\r\n @password\r\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password\n @password\n end",
"def password_required?; false; end",
"def password\n @password||=@options['password']\n end",
"def password=(should); end",
"def enter_password \n\nend",
"def get_password(password)\n password\n end",
"def password=(new_password); end",
"def prompt_password\n @member = current_member\n end",
"def find_password\n @password || $config.fetch(:password) || prompt_password\n end",
"def password(options = {})\n unless current?\n fail \"You can only reference the password for the current user (#{self.class.current_user_id})!\"\n end\n\n if options[:refresh]\n auth_session[:password] = nil\n end\n\n if auth_session[:password]\n password = decrypt(auth_session[:password])\n else\n puts 'Please enter your password:'\n password = (STDIN.noecho(&:gets) || '').chomp\n\n # TODO: Need some kind of callback here to optionally verify password correctness via LDAP or similar\n\n auth_session[:password] = encrypt(password)\n end\n\n password\n end",
"def valid_password?(password); end",
"def get_password\n status = true\n while status == true\n @password = @@prompt.mask(\"Create a password with at least 5 character\") do |q|\n q.validate(/[a-z\\ ]{5,15}/)\n end\n @password_2 = @@prompt.mask(\"Retype your password\") do |q|\n q.validate(/[a-z\\ ]{5,15}/)\n end\n if @password == @password_2\n system(\"clear\")\n status = false \n break\n else @password != @password_2\n puts \"Wrong password, try again\".colorize(:red)\n status = true\n end\n end\n end",
"def password\n\t\t@password\n\tend",
"def password\n\t\t@password\n\tend",
"def password\n @password\n end",
"def password\n @password\n end",
"def password=(_arg0); end",
"def password=(_arg0); end",
"def password=(_arg0); end",
"def password=(_arg0); end",
"def input_password\n @input_password || @owner_password || @user_password\n end",
"def password\n\t@password\n\tend",
"def get_password host,username\n print \"Password for \"+username+\"@\"+host+\": \"\n system \"stty -echo\"\n pw = gets.delete(\"\\n\")\n system \"stty echo\"\n puts\n pw\n end",
"def set_password_field(password)\n end",
"def password_input\n if password_params != nil\n password = password_params[:password]\n shared = false\n get(password, shared) \n end\n end",
"def set_password; nil; end",
"def user_password\n @password\n end",
"def enter_password_shared\n end",
"def password(prompt)\n STDIN.noecho do\n begin\n ask(prompt)\n ensure\n puts\n end\n end\n end",
"def obtain_password\n i = o = File.open('/dev/tty', 'w+')\n\n o.print 'Password: '\n\n # store original settings\n state = `stty -F /dev/tty -g`\n\n # don't echo input\n system \"stty -F /dev/tty -echo\"\n\n p = i.gets.chomp\n\n # restore original settings\n system \"stty -F /dev/tty #{state}\"\n\n p\n end",
"def query_ask\n password = false\n password = query_generate_password if @can_generate\n\n while !password\n answers = []\n [0,1].each{ |x|\n say \"please enter a password:\" if x == 0\n say \"please confirm the password:\" if x == 1\n answers[x] = super\n }\n if answers.first == answers.last\n password = answers.first\n else\n say_yellow( 'WARNING: passwords did not match! Please try again.' )\n end\n end\n\n encrypt password\n end",
"def prompt_for_password(message: nil)\n prompt_for_text(echo: :off, message: message)\nend",
"def password\n@password\nend",
"def password\n@password\nend",
"def edit_password; end",
"def prompt_password prompt = ''\n prompt += ' ' unless prompt.empty?\n $stderr.write \" CMS: #{prompt}password: \"\n system 'stty -echo'\n pass = $stdin.readline\n pass.chomp!\n pass\n ensure\n $stderr.write \"\\n\"\n system 'stty echo'\n end",
"def get_password(prompt='Password: ')\n print prompt\n STDIN.noecho(&:gets).chomp\nend",
"def fetch(password)\r\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end"
] |
[
"0.8067323",
"0.8061341",
"0.79349613",
"0.7866177",
"0.7862022",
"0.7825949",
"0.7778268",
"0.7778268",
"0.77772963",
"0.7756054",
"0.7756054",
"0.7756054",
"0.7756054",
"0.7756054",
"0.7756054",
"0.7753881",
"0.7743778",
"0.7699569",
"0.7623561",
"0.7586095",
"0.756135",
"0.7555645",
"0.7526169",
"0.7477994",
"0.7463943",
"0.74045706",
"0.74045706",
"0.7404248",
"0.74034935",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7400969",
"0.7386788",
"0.7383226",
"0.7377336",
"0.73726356",
"0.7368773",
"0.7361224",
"0.7352016",
"0.73335725",
"0.7331106",
"0.73155725",
"0.7314606",
"0.73134416",
"0.7308248",
"0.7308248",
"0.7295031",
"0.7295031",
"0.72939616",
"0.72939616",
"0.72939616",
"0.72939616",
"0.72922546",
"0.72848296",
"0.72589356",
"0.7237747",
"0.72302467",
"0.7223409",
"0.7208296",
"0.71991605",
"0.7194344",
"0.7188364",
"0.71724105",
"0.71679413",
"0.71564054",
"0.71564054",
"0.71493036",
"0.71422786",
"0.7136314",
"0.7132193",
"0.71270305",
"0.71270305",
"0.71270305",
"0.71270305",
"0.71270305",
"0.71270305",
"0.71270305"
] |
0.0
|
-1
|
this methd is used when a user have asked for his old password, and then he reset it.
|
def reset_password(user)
@recipients = user.email
@from = "#{Site.current.email}"
@body ["name"] = user.login
@subject = 'Your password has been reset'
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def old_password\n nil\n end",
"def reset_password!\n reset_password\n save_without_session_maintenance(validate: false)\n end",
"def reset_password!\n reset_password\n save_without_session_maintenance(false)\n end",
"def reset_password!\n @session.nickserv.resetpass(self.name)\n end",
"def password_reset\n\t\tshepherd = Shepherd.first\n\t\tshepherd.reset_token = Shepherd.new_token\n ShepherdMailer.password_reset(shepherd)\n end",
"def change_password\r\n \r\n end",
"def reset_password!\n new_password = Digest::MD5.hexdigest(Time.now.to_s.split(//).sort_by {rand}.join)[0, 10]\n self.password = new_password\n self.password_confirmation = new_password\n save!\n end",
"def change_temp_password\n\tend",
"def reset_password\n @searched_user = User.find(session[:user])\n if @searched_user\n new_password=updated_user_params[:new_password]\n new_password_confirmation=updated_user_params[:password_confirmation]\n if passwords_are_vlalid(new_password, new_password_confirmation, 'reset_user_password')\n if @searched_user.update_attribute(:new_password, updated_user_params[:new_password])\n flash[:success]=\"password updated successfully \"\n empty_user_id\n redirect_to admin_index_path\n else\n flash.now[:error]=\"error , could not save password\"\n render :action => 'reset_user_password'\n end\n else\n return\n end\n else\n flash[:error]=\" could not load user \"\n redirect_to admin_index_path\n end\n end",
"def reset_password() \n self.password_confirmation = self.password = self.login\n \n self.save\n end",
"def reset_super_admin_password\n @admin_=current_admin\n if @admin_\n old_password=admin_params[:password]\n new_password=admin_params[:new_password]\n new_password_confirmation=admin_params[:password_confirmation]\n if passwords_are_vlalid(new_password, new_password_confirmation, 'update_super_admin')\n @admin_=Admin.authenticate(@admin_.username, old_password)\n if @admin_\n if @admin_.update_attribute(:new_password, new_password)\n flash[:success]=\"Updated succesffuly \"\n destroy\n else\n flash.now[:error]=\"Error, couldn't update password\"\n @admin=current_admin\n @admin_=current_admin\n render 'update_super_admin'\n end\n else\n\n flash.now[:error]=\"Old password is incorrect \"\n @admin=current_admin\n @admin_=current_admin\n render 'update_super_admin'\n end\n\n else\n @view_super_admin_change_password_form=true\n return\n end\n else\n redirect_to admin_index_path\n end\n end",
"def reset_password!(*args)\n self.legacy_password_hash = nil\n super\n end",
"def password_change_new\n\n end",
"def reset_password(*args)\n self.legacy_password = false\n super\n end",
"def password_reset\n password_changed = false;\n\n if allow_password_reset()\n unless params[:password].to_s.strip.empty?\n @password_reset_user.password = params[:password]\n @password_reset_user.save!\n @password_reset_user.initialize_aes_iv_and_key\n @password_reset_user.save!\n GoMailer.password_reset(@password_reset_user, get_host).deliver\n password_changed=true\n end\n end\n\n return HESResponder({:password_changed => password_changed})\n end",
"def reset_password(new_password, new_password_confirmation); end",
"def reset_password(password)\n self.termpassword = password\n save\n end",
"def after_password_reset; end",
"def password_reset\n \tuser = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"def restore_password\n UserMailer.restore_password\n end",
"def reset_password\n update_attribute(:password_reset_code, nil)\n @reset_password = true\n end",
"def password_reset\n user = User.first\n user.reset_token = User.new_token #присваивается значение токена сброса пароля\n UserMailer.password_reset(user)\n end",
"def new_reset_password\n end",
"def need_change_password\n return unless password_expiration_enabled?\n\n self.password_changed_at = nil\n end",
"def forgot_password\n\t\tend",
"def password_reset\n user = SbUser.first\n user.reset_token = SbUser.new_token\n SbuserMailer.password_reset(user)\n\n end",
"def old_password=(string)\n end",
"def refresh_password\n @user = User.find(session[:user])\n @success = false\n if (!params[:user].blank? && params[:user][:terms_of_service]!=\"0\") or @user.terms_of_service\n @flag = User.check_old_password(params[:old_password], @user.password)\n if @flag\n if (params[:old_password] != params[:new_password])\n if (params[:new_password] == params[:confirm_password])\n if params[:new_password].length >= 6 && params[:new_password].length <= 15\n @user.change_password(params[:new_password])\n @check = \"Password has been updated successfully. \"\n @success = true\n MopMailer.deliver_change_password(@user,params[:new_password],session[:practice_prefix])\n else\n @check = \"The password length should be between 6 and 15 characters long. \"\n end\n else\n @check = \"Passwords dont match. Please reenter the passwords again. \"\n end\n else\n @check = \"New password should not match with existing password. \"\n end\n else\n @check = \"Old password not correct. Password not changed. \"\n end\n else\n @check = \"Please accept the terms of use. \"\n end\n if @success\n msg = \"<font color='green'>#{@check}</font>\"\n else\n msg = \"<font color='red'>#{@check}</font>\"\n end\n flash[:message] = msg\n redirect_to :action => :list\n end",
"def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"def password_reset_request\n end",
"def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"def old_password\n @old_password\n end",
"def reset_password!(new_password, new_password_confirmation)\n self.password = new_password\n self.password_confirmation = new_password_confirmation\n self.haslocalpw = true # Added this line\n\n if valid?\n clear_reset_password_token\n after_password_reset\n end\n\n save\n end",
"def set_password_reset\n self.make_password_reset_code\n end",
"def change_password\n return if generate_filled_in\n if do_change_password_for(@user)\n # since sometimes we're changing the password from within another action/template...\n #redirect_to :action => params[:back_to] if params[:back_to]\n redirect_back_or_default :action => 'change_password'\n end\n end",
"def change_password\n #check if user is new or being updated\n if self.encrypted_password.present?\n #verifies password\n if self.password_check\n self.encrypt_password\n else\n raise \"error\"\n end\n else\n raise \"error\"\n end\n end",
"def password_reset\n user = User.first \n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"def password_reset\n user = User.first \n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"def password_reset\n user = User.first || Lecturer.first\n user.reset_token = User.new_token || Lecturer.new_token\n UserMailer.password_reset(user)\n end",
"def password_reset\n player = Player.first\n player.reset_token = Player.new_token\n PlayerMailer.password_reset(player)\n end",
"def check_password_changed\n self.temp_password = nil if ( changed.include?('encrypted_password') && !(changed.include?('temp_password')))\n end",
"def reset_password\n\t\tself.password_reset_token = User.new_token\n\t\tupdate_columns(password_reset_digest: User.digest(self.password_reset_token), password_reset_sent_at: Time.zone.now)\n\tend",
"def password_forget\n redirect_to lato_core.root_path unless core_getRecoveryPasswordPermission\n redirect_to lato_core.root_path if core_controlSession\n end",
"def forgot_password\n end",
"def password_reset\n gamer = Gamer.first\n gamer.reset_token = Gamer.new_token\n GamerMailer.password_reset(gamer)\n end",
"def reset_password\n new_password = User.random_password\n self.password = new_password\n return new_password\n end",
"def reset_password\n @user = User.find_by_password_reset_code(params[:id]) or raise\n return if request.get?\n\n if (params[:password] == params[:password_confirmation])\n self.current_user = @user #for the next two lines to work\n current_user.password_confirmation = params[:password_confirmation]\n current_user.password = params[:password]\n if current_user.valid? && !params[:password].blank?\n current_user.reset_password\n current_user.save\n flash[:notice] = \"Password reset\"\n redirect_to user_path(current_user)\n else\n flash.now[:notice] = \"Password too short\"\n end\n else\n flash.now[:notice] = \"Password mismatch\"\n end\n\n rescue\n logger.error \"Invalid Reset Code entered\"\n flash[:notice] = \"Sorry - That is an invalid password reset code. Please check your code and try again. (Perhaps your email client inserted a carriage return?)\"\n redirect_to '/'\n end",
"def reset_password\n temporary_password = ActiveSupport::SecureRandom.base64(6)\n self.password = temporary_password\n self.password_confirmation = temporary_password\n temporary_password\n end",
"def password_reset\n user = Customer.last\n user.reset_token = Customer.new_token\n CustomerMailer.password_reset(user)\n end",
"def password_reset\n # ShopMailer.password_reset\n shop = Shop.first\n shop.reset_token = Shop.new_token\n ShopMailer.password_reset(shop)\n end",
"def reset_password!(user)\n self.class.ignore_blank_passwords = false\n self.password = user[:password]\n self.password_confirmation = user[:password_confirmation]\n save\n end",
"def reset_password\n redirect_to :action => 'login' && return if params[:id].to_s.blank?\n @user = User.find_by_password_reset_code(params[:id])\n return unless request.post? && @user\n\n @user.password = params[:password]\n @user.password_confirmation = params[:password_confirmation]\n @user.reset_password\n @user.save!\n flash[:notice] = \"Your password has been changed. You may now log in.\"\n redirect_to :action => 'login'\n rescue ActiveRecord::RecordInvalid\n end",
"def password_reset\n user = User.first\n user.reset_token = SecureRandom.uuid\n user.e_token = User.digest(user.email)\n UserMailer.password_reset(user)\n end",
"def reset_passwd\n @user = User.find_by(uin: params[:session][:uin])\n if !@user.nil? && @user.first_name.downcase == params[:session][:first_name].to_s.downcase\n UserNotifier.send_login_password(@user, SecureRandom.hex(10)).deliver_now\n flash[:success] = \"Password has been sent to your email address!\"\n redirect_to login_path\n else\n flash[:danger]=\"Invalid User: Wrong UIN Name Match!\"\n redirect_to login_path\n end\n end",
"def forgot_password\n @forgotten_password = true\n self.make_password_reset_code\n end",
"def forgot_password\n @forgotten_password = true\n self.make_password_reset_code\n end",
"def recover_password(new_password)\n url = \"user/#{user_sys_name}/#{user_id}/recovery/?\"\n request = { newPassword: new_password }\n response = Uas::Query.execute(url, request: request, method: :put)\n case response[:code]\n when 200 then true\n else false\n end\n end",
"def need_change_password?\n password_change_requested? || password_too_old?\n end",
"def after_password_reset;\n end",
"def password \n if params[:reset]\n results = CsApi::Account.reset_password(current_user.username)\n if results['success'].eql?('true')\n redirect_to password_reset_url, :notice => results[\"message\"]\n else \n flash.now[:notice] = results[\"message\"]\n end\n get_account\n end\n @page_title = \"Change Your Password\"\n if !@account[\"login_managed_by\"].eql?('CloudSpokes')\n flash.now[:warning] = \"You are logging into CloudSpokes with your #{@account[\"login_managed_by\"]} account. You will need to change your password at #{@account[\"login_managed_by\"]}\"\n end\n end",
"def password_reset\n account = Account.first\n account.reset_token = Account.new_token\n AccountMailer.password_reset(account)\n end",
"def password_reset\n\t token = params.first[0]\n\t @user = User.find_by_confirm_token(token)\n\n\t if @user.nil?\n\t flash[:error] = 'You have not requested a password reset.'\n\t return redirect_to :root\t \n\t end\n\n\t if @user.password_expires_after < DateTime.now\n\t clear_password_reset(@user)\n\t @user.save\n\t flash[:error] = 'Password reset has expired. Please request a new password reset.'\n\t redirect_to :forgot_password\n\t end\n\tend",
"def reset!\n self.password_cost = 9\n end",
"def after_database_authentication\n rotate_stale_password_digest\n end",
"def reset_password\n set :password, Proc.new {\n Capistrano::CLI.password_prompt(\"Password (for user: #{user}): \")\n } \n end",
"def password_reset\n tester = Tester.first\n tester.reset_token = Tester.new_token\n TesterMailer.password_reset(tester)\n end",
"def password_update\n redirect_to lato_core.root_path unless core_getRecoveryPasswordPermission\n user = LatoCore::Superuser.find(params[:id])\n if !user || user.session_code != params[:token]\n flash[:warning] = CORE_LANG['recover_password']['recover_error']\n redirect_to lato_core.login_path and return false\n end\n user.update(password: params[:password], password_confirmation: params[:password])\n if !user.save\n flash[:warning] = CORE_LANG['recover_password']['recover_error']\n redirect_to lato_core.login_path and return false\n end\n\n flash[:success] = CORE_LANG['recover_password']['recover_success']\n redirect_to lato_core.login_path\n end",
"def password_reset\n owner = Owner.first\n owner.reset_token = Owner.new_token\n Owner::UserMailer.password_reset(owner)\n end",
"def reset_password\n friendly_token = Authlogic::Random.friendly_token\n self.password = friendly_token\n self.password_confirmation = friendly_token if self.class.require_password_confirmation\n end",
"def reset_password!\n password = PasswordGenerator.random_pronouncable_password(3)\n self.password = password\n self.password_confirmation = password\n save\n UserMailer.deliver_reset_password(self)\n end",
"def change_pwd\n if UserDetail.exists?(:password => Digest::SHA2.hexdigest(params[:currentpwd]))\n if (Digest::SHA2.hexdigest(params[:newpwd]) == Digest::SHA2.hexdigest(params[:confirmnewpwd]))\n user=UserDetail.find_by_user_name(session[:uname])\n user.password = params[:newpwd]\n user.save \n session[ :msg] = \"changed\" \n else\n session[ :msg] = \"not match\" \n end\n else\n #Incorrecr current password\n session[ :msg] = \"incorrect\"\n end\n redirect_to :back\n end",
"def reset_password\n friendly_token = Authlogic::Random.friendly_token\n self.password = friendly_token\n self.password_confirmation = friendly_token\n end",
"def reset_password\n self.current_user = User.find_by_password_reset_code(params[:password_reset_code])\n flash[:notice] = \"You must now change your password!\"\n redirect_to(change_password_url)\n\n # if logged_in? && !current_user.activated?\n # current_user.reset_password\n # flash[:notice] = \"Signup complete!\"\n # end\n # redirect_back_or_default('/')\n end",
"def reset\n\t\t# find user using the reset code specified\n @user = User.find_by_reset_code(params[:reset_code]) unless params[:reset_code].nil?\n if request.post?\n\t\t\t\t# update user's password\n \tif @user.update_attributes(:password => params[:user][:password], :password_confirmation => params[:user][:password_confirmation])\n\t\t\t\t\t# delete the code \n\t self.current_user = @user\n @user.delete_reset_code\n\t\t\t\t\t# flash notice regarading successfull reset\n gflash :success => \"Password reset successfully for #{@user.email}\"\n redirect_back_or_default('/')\n else\n render :action => :reset\n end\n end\n\tend",
"def new_password; nil; end",
"def correct_old_password\n old_user = User.find(id)\n if !old_user.authenticate(old_password)\n errors.add(:old_password, I18n.t(:incorrect_old_password))\n end\n end",
"def update\n # Make the password confirmation validation work.\n @user.password_confirmation = params[:user][:password_confirmation]\n\n # Don't require entry of the old password.\n @user.resetting_password = true\n\n # Clear the temporary token and update the password.\n if @user.change_password!(params[:user][:password])\n redirect_to(root_path, notice: t('password_resets.update.password_updated'))\n else\n render action: \"edit\"\n end\n end",
"def reset_password\n self.password = self.class.random_hash(8)\n self.save_with_validation(false)\n self.password\n end",
"def forgot_password\n\t\t\n\tend",
"def password_reset\n applicant = Applicant.first\n applicant.reset_token = Applicant.new_token\n ApplicantMailer.applicant_password_reset(applicant)\n end",
"def password_reset\n user = RailsTutorial::Sample::User.first\n user.reset_token = RailsTutorial::Sample::User.new_token\n RailsTutorial::Sample::UserMailer.password_reset(user)\n end",
"def reset_password\n new_password = SecureRandom.hex(5)\n update_attributes!(:password => new_password )\n return new_password\n end",
"def password_reset\n employee = Employee.first\n employee.reset_token = Employee.new_token\n EmployeeMailer.password_reset(employee)\n end",
"def password_reset\n doctor = Doctor.first\n doctor.reset_token = Doctor.new_token\n DoctorMailer.password_reset(doctor)\n end",
"def password=(new_password); end",
"def reset_password\n return unless request.post?\n @user = User.find_by_activation_code(params[:id]) if params[:id]\n if @user && @user.update_attributes(params[:user]) && @user.activate\n self.current_user = @user\n flash[:notice] = \"Your password has been reset.\"\n redirect_to :action => 'welcome'\n else\n flash.now[:error] = \"Your password was not reset.\"\n end\n end",
"def need_change_password!\n return unless password_expiration_enabled?\n\n need_change_password\n save(validate: false)\n end",
"def reset_password\n if (params[:token] === @user.reset_token) && (@user.updated_at > DateTime.now - 1)\n @user.update(password: params[:password], password_confirmation: params[:confirm_password], reset_token: \"\")\n render \"reset\" if @user.errors.any?\n else\n @error = \"Token is expired\"; render \"reset\"\n end\n rescue StandardError => e\n render json: { message: \"Error: Something went wrong... \" }, status: :bad_request\n end",
"def update\n super do |resource|\n # TODO (rspeicher): In Devise master (> 3.4.1), we can set\n # `Devise.sign_in_after_reset_password = false` and avoid this mess.\n if resource.errors.empty? && resource.try(:otp_required_for_login?)\n resource.unlock_access! if unlockable?(resource)\n\n # Since we are not signing this user in, we use the :updated_not_active\n # message which only contains \"Your password was changed successfully.\"\n set_flash_message(:notice, :updated_not_active) if is_flashing_format?\n\n # Redirect to sign in so they can enter 2FA code\n respond_with(resource, location: new_session_path(resource)) and return\n end\n end\n end",
"def password_reset\n user = User.first\n user.create_reset_digest\n UserMailer.password_reset(user.id, user.reset_token)\n end",
"def reset_password!(user)\n self.password = user[:password]\n self.password_confirmation = user[:password_confirmation]\n save\n end",
"def update #:nodoc:\n if params[:id].nil?\n render :action => 'new'\n return\n end\n if params[:password].blank?\n flash[:notice] = I18n.t(\"Password field cannot be blank.\", :default => \"Password field cannot be blank.\")\n render :action => 'edit', :id => params[:id]\n return\n end\n @user = User.find_by_password_reset_code(params[:id]) if params[:id]\n raise if @user.nil?\n return if @user unless params[:password]\n if (params[:password] == params[:password_confirmation])\n #Uncomment and comment lines with @user to have the user logged in after reset - not recommended\n #self.current_user = @user #for the next two lines to work\n #current_user.password_confirmation = params[:password_confirmation]\n #current_user.password = params[:password]\n #@user.reset_password\n #flash[:notice] = current_user.save ? \"Password reset\" : \"Password not reset\"\n @user.password_confirmation = params[:password_confirmation]\n @user.password = params[:password]\n @user.reset_password\n flash[:notice] = @user.save ? I18n.t(\"Password reset.\", :default => \"Password reset.\") : I18n.t(\"Password not reset.\", :default => \"Password not reset.\")\n else\n flash[:notice] = I18n.t(\"Password mismatch.\", :default => \"Password mismatch.\")\n render :action => 'edit', :id => params[:id]\n return\n end\n redirect_to login_path\n rescue\n logger.error I18n.t(\"Invalid Reset Code entered\", :default => \"Invalid Reset Code entered\")\n flash[:notice] = I18n.t(\"Sorry - That is an invalid password reset code. Please check your code and try again. (Perhaps your email client inserted a carriage return?)\", :default => \"Sorry - That is an invalid password reset code. Please check your code and try again. (Perhaps your email client inserted a carriage return?)\")\n redirect_to new_user_path\n end",
"def update\n @user.password = params[:password]\n @user.password_confirmation = params[:password_confirmation]\n return unless @user\n if @user.save\n flash[:notice] = t 'password_resets.updated'\n redirect_to @user\n else\n render :action => :edit\n end\n end",
"def password_reset\n user = User.first\n user.password_reset_token = new_token\n email = EmailAddress.find_by(id: user.primary_email_address_id).email\n UserMailer.password_reset(user, email)\n end",
"def send_password_change_notification; end"
] |
[
"0.78614545",
"0.77321494",
"0.7715256",
"0.76039815",
"0.7531487",
"0.7503903",
"0.7493811",
"0.74758923",
"0.7464055",
"0.746393",
"0.74554664",
"0.7444039",
"0.74331623",
"0.7411153",
"0.73947316",
"0.7384288",
"0.7376962",
"0.7337486",
"0.7308829",
"0.73014045",
"0.72974104",
"0.7286506",
"0.7257287",
"0.725043",
"0.7240958",
"0.7221629",
"0.7207321",
"0.72005945",
"0.7192391",
"0.7191897",
"0.71904",
"0.71904",
"0.71904",
"0.71904",
"0.71904",
"0.71904",
"0.71904",
"0.7183873",
"0.7166584",
"0.715607",
"0.7149231",
"0.7138122",
"0.7133963",
"0.7133963",
"0.71280354",
"0.7124901",
"0.7118705",
"0.71167487",
"0.711626",
"0.71061033",
"0.70946884",
"0.70928055",
"0.70915806",
"0.7087327",
"0.70859575",
"0.70856684",
"0.70851",
"0.7075583",
"0.7056692",
"0.70560354",
"0.7051513",
"0.7051513",
"0.7051222",
"0.7050403",
"0.7046757",
"0.7043763",
"0.7040874",
"0.7034833",
"0.70171994",
"0.70124036",
"0.7006702",
"0.70050925",
"0.70048213",
"0.69998515",
"0.6997405",
"0.69950336",
"0.6987563",
"0.69872737",
"0.69851625",
"0.69835514",
"0.6973528",
"0.69730765",
"0.6964496",
"0.6962184",
"0.696057",
"0.6959987",
"0.6959419",
"0.695904",
"0.6955362",
"0.6941963",
"0.69386595",
"0.6937506",
"0.692076",
"0.6916596",
"0.6905644",
"0.6904698",
"0.6901792",
"0.68930745",
"0.689099",
"0.68898857",
"0.6889178"
] |
0.0
|
-1
|
Make and extra method for complete ride
|
def complete
@ride = Ride.find(params[:ride_id])
@ride.completed = true
@ride.save
UserMailer.complete_ride(@ride).deliver_later
redirect_to user_path(current_user)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def take_ride\n if low_tickets && too_short\n \"Sorry. You do not have enough tickets to ride the #{self.attraction.name}. \" + \"You are not tall enough to ride the #{self.attraction.name}.\"\n elsif low_tickets\n \"Sorry. You do not have enough tickets to ride the #{self.attraction.name}.\"\n elsif too_short\n \"Sorry. You are not tall enough to ride the #{self.attraction.name}.\"\n else\n ride\n \"Thanks for riding the #{self.attraction.name}!\"\n end\n end",
"def complete!\n raise NotImplementedError\n end",
"def make_a_trip\n end",
"def take_ride\n\n # This happens if the user is both too short & ticketless to take the ride:\n if self.user.tickets < self.attraction.tickets && self.user.height < self.attraction.min_height\n # The rspec tests expect this output to be the return value:\n \"Sorry. You do not have enough tickets to ride the #{attraction.name}. You are not tall enough to ride the #{attraction.name}.\"\n\n # This happens if the user is too short for the ride\n elsif self.user.tickets < self.attraction.tickets\n # The rspec tests expect this output to be the return value:\n \"Sorry. You do not have enough tickets to ride the #{attraction.name}.\"\n\n # This happens of the user is too ticketless for the ride\n elsif self.user.height < self.attraction.min_height\n # The rspec tests expect this output to be the return value:\n \"Sorry. You are not tall enough to ride the #{attraction.name}.\"\n\n # This closes the door on situations where the user can't take the ride.\n # The loop doesn't end here because if it did, the rest of the code below\n # would be ignored. Now that this whole thing is in one giant loop, the\n # \"return\" values above can be removed.\n\n else\n # Assuming the user has the height & resources, The user will pay for the ride in tickets\n self.user.tickets = self.user.tickets - self.attraction.tickets\n self.user.nausea = self.attraction.nausea_rating + self.user.nausea\n self.user.happiness = self.attraction.happiness_rating + self.user.happiness\n self.user.save\n # The rspec tests expect this output to be the return value:\n \"Thanks for riding the #{attraction.name}!\"\n end\n end",
"def methods() end",
"def take_ride\n if self.user.tickets < self.attraction.tickets && self.user.height > self.attraction.min_height\n return \"Sorry. You do not have enough tickets to ride the #{attraction.name}.\"\n elsif self.user.height < self.attraction.min_height && self.user.tickets > self.attraction.tickets\n return \"Sorry. You are not tall enough to ride the #{attraction.name}.\"\n elsif self.user.tickets < self.attraction.tickets && self.user.height < self.attraction.min_height\n return \"Sorry. You do not have enough tickets to ride the #{attraction.name}. You are not tall enough to ride the #{attraction.name}.\"\n else\n self.user.tickets = self.user.tickets - self.attraction.tickets\n self.user.nausea = self.user.nausea + self.attraction.nausea_rating\n self.user.happiness = self.user.happiness + self.attraction.happiness_rating\n self.user.save\n return \"Thanks for riding the #{attraction.name}!\"\n end\n end",
"def return # End Ride\n params.require(:latitude)\n params.require(:longitude)\n @ride = @bike.current_ride\n return render json: { error: 'Could not find the current ride associated with this bike' }, status: :not_found if @ride.nil?\n return render json: { error: 'Cannot return a bike that is not reserved' }, status: :forbidden unless (@bike.reserved?)\n return render json: { error: 'You are not the current owner of this bike' }, status: :forbidden if (@user != @ride.user)\n\n # TODO: get name for this location by nearest Coordinate with name...\n @location = Coordinate.find_or_initialize_by(latitude: params[:latitude], longitude: params[:longitude])\n render :json => { :error => @location.errors.full_messages } unless @location.save\n \n @ride.stop_location = @location\n @ride.stop_time = DateTime.now\n @ride.status = Ride.statuses[:complete]\n return render :json => { :error => @ride.errors.full_messages } unless @ride.save\n\n # CHARGE FOR RIDE\n begin\n # TODO: Finish this\n # @transaction = Transaction.charge_user_for_ride(@user, @ride)\n # @transaction.save!\n # put specific rescues here\n rescue Exception => e\n return render json: { error: e }, status: :internal_server_error\n # TODO: What happens if transaction fails\n # @user.status === User::STATUS[:outstanding]\n ensure\n @bike.location = @location\n @bike.current_ride = nil\n @bike.status = Bike.statuses[:available]\n return render json: { error: @bike.errors.full_messages } unless @bike.save\n end\n # TODO: make this @ride.summary\n render :json => @ride.to_json if @ride.save\n end",
"def prapor_quest; end",
"def get_rover_details; end",
"def travel_and_places; end",
"def skier_quest; end",
"def take_ride\n if self.user.height < self.attraction.min_height && self.user.tickets < self.attraction.tickets\n \"Sorry. You do not have enough tickets to ride the #{attraction.name}. You are not tall enough to ride the #{attraction.name}.\"\n elsif self.user.height < self.attraction.min_height\n \"Sorry. You are not tall enough to ride the #{attraction.name}.\"\n elsif self.user.tickets < self.attraction.tickets\n \"Sorry. You do not have enough tickets to ride the #{attraction.name}.\"\n else\n self.user.tickets -= self.attraction.tickets\n self.user.nausea += self.attraction.nausea_rating\n self.user.happiness += self.attraction.happiness_rating\n user.save\n \"Thanks for riding the #{self.attraction.name}!\"\n end\n end",
"def get_rear()\n \n end",
"def award; end",
"def suivre; end",
"def strategy; end",
"def weber; end",
"def complete\n raise NotImplementedError\n end",
"def invention; end",
"def complete?; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def take_ride\n enough_tickets, tall_enough = meet_requirements\n if enough_tickets && tall_enough\n start_ride\n elsif tall_enough && !enough_tickets\n \"Sorry. \" + ticket_warn\n elsif enough_tickets && !tall_enough\n \"Sorry. \" + height_warn\n else\n \"Sorry. \" + ticket_warn + \" \" + height_warn\n end\n end",
"def mark_info_completed(ride)\n # update_attributes(Conversation.ride_conversation_attrs(ride))\n update(Conversation.ride_conversation_attrs(ride))\n ride_created!\n end",
"def ravel; end",
"def restaurant\n end",
"def add_wings_and_take_off\nend",
"def complete_investigation; end",
"def retire\n\n end",
"def respond(); end",
"def heroine; end",
"def starship; end",
"def relatorios\n end",
"def ship; end",
"def method\n\t\t# code code\n\tend",
"def methods; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def create\n if params[:locale].present?\n @locale = params[:locale]\n else\n @locale = :en\n end\n\n @ride = Ride.new(ride_params)\n\n # check for existing voter. Similar to what's in User.find_from_potential_ride, abstract?\n @user = User.find_by_id(params[:user_id]) if params[:user_id]\n @user ||= User.find_by_email(params[:ride][:email])\n normalized = PhonyRails.normalize_number(params[:ride][:phone_number], default_country_code: 'US')\n # unless normalized.nil? || normalized == '+15555555555'\n if normalized.present? && normalized != User::DUMMY_PHONE_NUMBER\n @user ||= User.find_by_phone_number_normalized(normalized)\n end\n \n if @user\n existing = @user.open_ride # TODO: should this also check @user.active_ride ?\n if existing\n scheduled = existing.pickup_in_time_zone.strftime('%m/%d %l:%M %P %Z')\n @user.errors.add(:name, \"match for voter #{@user.name} (#{@user.email}/#{@user.phone_number}) that already has an active ride scheduled for #{scheduled}\")\n render :new and return\n end\n end\n\n if @ride.pickup_at.blank?\n flash[:notice] = \"Please fill in scheduled date and time.\"\n render :new and return\n end\n @pickup_at = @ride.pickup_at\n\n if @ride.from_city_state.present? && @ride.from_city.blank? && @ride.from_state.blank?\n city_state_array = @ride.from_city_state.split(',')\n @ride.from_city = city_state_array[0].try(:strip)\n @ride.from_state = city_state_array[1].try(:strip)\n end\n\n if @ride.to_city_state.present? && @ride.to_city.blank? && @ride.to_state.blank?\n city_state_array = @ride.to_city_state.split(',')\n @ride.to_city = city_state_array[0].try(:strip)\n @ride.to_state = city_state_array[1].try(:strip)\n end\n\n # if ride is rolled back we want to make sure the user is too.\n ActiveRecord::Base.transaction do\n unless @user\n user_params = params.require(:ride).permit(:phone_number, :email, :name, :password)\n user_attrs = {\n name: user_params[:name],\n phone_number: user_params[:phone_number],\n ride_zone: @ride_zone,\n ride_zone_id: @ride_zone.id,\n email: user_params[:email] || User.autogenerate_email,\n password: user_params[:password] || SecureRandom.hex(8),\n city: @ride.from_city,\n state: @ride.from_state,\n locale: @locale,\n language: @locale,\n user_type: 'voter',\n }\n\n # TODO: better error handling\n @user = User.create(user_attrs)\n if @user.errors.any?\n flash[:notice] = \"Problem creating a new user.\"\n render :new and return\n end\n end\n\n @ride.voter = @user\n @ride.from_zip = @user.zip\n @ride.status = :scheduled\n @ride.ride_zone = @ride_zone\n @ride.to_address = Ride::UNKNOWN_ADDRESS if @ride.to_address.blank?\n\n if @ride.save\n Conversation.create_from_ride(@ride, thanks_msg(@ride))\n UserMailer.welcome_email_voter_ride(@user, @ride).deliver_later\n render :success\n else\n @user = nil\n flash[:notice] = \"Problem creating a ride.\"\n render :new and return\n end\n end\n end",
"def process_ride(ride)\n if ride.is_a? Ride \n @rides << ride\n else \n raise \"Not a Ride object\"\n end \n end",
"def private; end",
"def troop; end",
"def custom; end",
"def custom; end",
"def probers; end",
"def who_we_are\r\n end",
"def create\n if params[:locale].present?\n @locale = params[:locale]\n else\n @locale = :en\n end\n\n @ride = Ride.new(ride_params)\n\n # check for existing voter. Similar to what's in User.find_from_potential_ride, abstract?\n @user = User.find_by_id(params[:user_id]) if params[:user_id]\n @user ||= User.find_by_email(params[:ride][:email])\n normalized = PhonyRails.normalize_number(params[:ride][:phone_number], default_country_code: 'US')\n # unless normalized.nil? || normalized == '+15555555555'\n if normalized.present? && normalized != User::DUMMY_PHONE_NUMBER\n @user ||= User.find_by_phone_number_normalized(normalized)\n end\n\n if @user\n existing = @user.open_ride # TODO: should this also check @user.active_ride ?\n if existing\n scheduled = existing.pickup_in_time_zone.strftime('%m/%d %l:%M %P %Z')\n @user.errors.add(:name, \"match for voter #{@user.name} (#{@user.email}/#{@user.phone_number}) that already has an active ride scheduled for #{scheduled}\")\n render :new and return\n end\n end\n\n if @ride.pickup_at.blank?\n flash[:notice] = \"Please fill in scheduled date and time.\"\n render :new and return\n end\n\n @ride.break_out_city_state('from')\n @ride.break_out_city_state('to')\n\n # if ride is rolled back we want to make sure the user is too.\n ActiveRecord::Base.transaction do\n unless @user\n user_params = params.require(:ride).permit(:phone_number, :email, :name, :password)\n user_attrs = {\n name: user_params[:name],\n phone_number: user_params[:phone_number],\n ride_zone: @ride_zone,\n ride_zone_id: @ride_zone.id,\n email: user_params[:email] || User.autogenerate_email,\n password: user_params[:password] || SecureRandom.hex(8),\n city: @ride.from_city,\n state: @ride.from_state,\n locale: @locale,\n language: @locale,\n user_type: 'voter',\n }\n\n @user = User.create(user_attrs)\n if @user.errors.any?\n flash[:notice] = \"Problem creating a new user.\"\n render :new and return\n end\n end\n\n @ride.voter = @user\n @ride.from_zip = @user.zip\n @ride.status = :scheduled\n @ride.ride_zone = @ride_zone\n @ride.to_address = Ride::UNKNOWN_ADDRESS if @ride.to_address.blank?\n\n if @ride.save\n Conversation.create_from_ride(@ride, thanks_msg(@ride))\n UserMailer.welcome_email_voter_ride(@user, @ride).deliver_later\n render :success\n else\n @user = nil\n flash[:notice] = \"Problem creating a ride.\"\n render :new and return\n end\n end\n end",
"def perform\n \n end",
"def make_cards\n #14 restuarants\n scrape_cards.each do |res|\n binding.pry\n ResInfo::Restaurant.new_from_scraper(res)\n end\n end",
"def vehicle; end",
"def vehicle; end",
"def vehicle; end",
"def vehicle; end",
"def vehicle; end",
"def repeat\n # set the @traveler variable\n get_traveler\n # set the @trip variable\n get_trip\n\n # create a new trip_proxy from the current trip\n @trip_proxy = create_trip_proxy(@trip)\n # set the flag so we know what to do when the user submits the form\n @trip_proxy.mode = MODE_REPEAT\n\n # Set the travel time/date to the default\n travel_date = default_trip_time\n \n @trip_proxy.trip_date = travel_date.strftime(TRIP_DATE_FORMAT_STRING)\n @trip_proxy.trip_time = travel_date.strftime(TRIP_TIME_FORMAT_STRING)\n \n # Create makers for the map control\n @markers = create_markers(@trip_proxy)\n\n respond_to do |format|\n format.html { render :action => 'edit'}\n end\n end",
"def rossini; end",
"def finalize\n @itinerary = Itinerary.find(params[:id], :include => [:selected_events, :events, :selected_attractions, :attractions, :transportations, :selected_meals, :meals])\n @itinerary.recommend_transportation!\n \n render :json => {\n :itinerary => @itinerary.timeline\n }.to_json\n \n end",
"def offer\n end",
"def offer\n end",
"def offer\n end",
"def spouse; end",
"def donizetti; end",
"def run\n super\n\n uri = _get_entity_name\n\n old_details = _get_entity_details\n new_details = capture_screenshot_and_requests(uri)\n merged_details = new_details.merge(old_details)\n\n # now merge them together and set as the new details\n _set_entity_details(merged_details)\n\n end",
"def villian; end",
"def trips \n Trips.all.each do |trip|\n trip \n end \n\n #return to airbnb\n \n\n\n \nend",
"def ragman_quest; end",
"def coming_soon\n end",
"def coming_soon\n end",
"def peacekeeper_quest; end",
"def Com6 # Recuperation Info\n \n end",
"def schubert; end",
"def visit_offerwall\n raise NotImplementedError\n end",
"def therapist_quest; end",
"def incomplete\r\n\r\n end",
"def refutal()\n end",
"def investor\n end",
"def processor; end",
"def extra; end",
"def show\n \n @url = \"https://maps.googleapis.com/maps/api/directions/json?origin=#{@trip.origin.gsub(\" \", \"_\") + \"_ny\"}&destination=#{@trip.destination.gsub(\" \", \"_\") + \"_ny\"}\"\n \n #driving details\n @drivingroute=HTTParty.get(@url)\n @drivingroutedetails = {'distance' => @drivingroute['routes'][0]['legs'][0]['distance']['text'], 'time' => @drivingroute['routes'][0]['legs'][0]['duration']['text']}\n @urltransit = \"https://maps.googleapis.com/maps/api/directions/json?origin=#{@trip.origin.gsub(\" \", \"_\") + \"_ny\"}&destination=#{@trip.destination.gsub(\" \", \"_\") + \"_ny\"}&departure_time=#{@trip.departure_time.to_i}&mode=transit\"\n\n #transit details\n @transitroute=HTTParty.get(@urltransit)\n @transitroutedetails = {'distance' => @transitroute['routes'][0]['legs'][0]['distance']['text'], 'time' => @transitroute['routes'][0]['legs'][0]['duration']['text']}\n\n \n @carbondioxideemission = @drivingroute['routes'][0]['legs'][0]['distance']['text'].to_f*248\n @gasolineused = @drivingroute['routes'][0]['legs'][0]['distance']['text'].to_f*0.04149\n\n # Trip.find(params[:id]).cabcost(@drivingroutedetails['distance'].to_f,@drivingroutedetails['time'].to_i)\n\n @moneyspent = Trip.find(params[:id]).cabcost(@drivingroutedetails['distance'].to_f,@drivingroutedetails['time'].to_i)\n @moneysaved = (@moneyspent/(Trip.find(params[:id]).number_of_people.to_f) - 2.50).to_f\n\n\n # 163g of CO2 emitted per mile for transit....411g of C02 emitted per mile for cars = 248 diff\n # 9.4g of CO emitted per mile for cars ...\n #sources: EPA, CarbonFund.org, \n\n #http://www.epa.gov/otaq/consumer/420f08024.pdf\n\n #stats to be seen: CO2, gasoline saved, money saved \n\n\n \n end",
"def complete\n end",
"def launch_vehicle; end",
"def superweening_adorningly(counterstand_pyrenomycetales)\n end",
"def waiver\n end",
"def pickup!\n raise NotImplementedError, \"Subclasses must implemenet :pickup!\"\n end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def roster\n end",
"def quest; end"
] |
[
"0.58599484",
"0.57906806",
"0.578735",
"0.5757679",
"0.5753981",
"0.5751848",
"0.574599",
"0.57423574",
"0.5697406",
"0.56748",
"0.5664264",
"0.56622356",
"0.55995595",
"0.5596619",
"0.5592215",
"0.5572896",
"0.5555092",
"0.5527187",
"0.5493985",
"0.548761",
"0.5462371",
"0.5462371",
"0.5462371",
"0.5462371",
"0.5462371",
"0.5462371",
"0.5462371",
"0.5462371",
"0.5462371",
"0.5462371",
"0.5462371",
"0.5462371",
"0.5460367",
"0.5447184",
"0.54424286",
"0.5436723",
"0.5428593",
"0.54277796",
"0.54266983",
"0.54193735",
"0.5416544",
"0.54165184",
"0.5416092",
"0.5400533",
"0.53559077",
"0.53557545",
"0.53557545",
"0.53557545",
"0.53557545",
"0.534872",
"0.5337253",
"0.53348744",
"0.53321284",
"0.53308517",
"0.53308517",
"0.5324862",
"0.53120965",
"0.52925426",
"0.5285558",
"0.5262232",
"0.5247962",
"0.5247962",
"0.5247962",
"0.5247962",
"0.5247962",
"0.5243814",
"0.5238239",
"0.5224661",
"0.5222063",
"0.5222063",
"0.5222063",
"0.5222009",
"0.5219874",
"0.5208519",
"0.5208242",
"0.51971173",
"0.51954293",
"0.5194074",
"0.5194074",
"0.5192458",
"0.51832116",
"0.5182252",
"0.5181806",
"0.5177108",
"0.5168128",
"0.5167036",
"0.51609415",
"0.51574266",
"0.51555127",
"0.5155101",
"0.51518905",
"0.5144409",
"0.51420546",
"0.51403123",
"0.513552",
"0.5131349",
"0.5131349",
"0.5131349",
"0.5131349",
"0.51260585",
"0.5122908"
] |
0.0
|
-1
|
number The Integer that will be cubed Examples cube(5) => '125' Returns the cubed Integer.
|
def square(number)
return number*number*number
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def cube(number)\n number.to_i\n return number**3\nend",
"def cube(number)\n return number ** 3\nend",
"def cube(number)\n return number * number * number\nend",
"def cube(number)\n return number * number * number\nend",
"def cube(number)\n return number**3\nend",
"def cube(number)\n output = number **3\n return output\nend",
"def cube(number)\n output = number * number * number\n return output\nend",
"def cube(num)\n return num ** 3\nend",
"def cube(num)\n return num ** 3\nend",
"def cube(number)\n\n number * number * number\n\nend",
"def cube(num)\n return num * num * num\nend",
"def cube_numb(numb)\n return numb**3\nend",
"def cube(num)\n return num **3\nend",
"def cube(num)\n return num**3\nend",
"def cube(num)\n return num**3\nend",
"def cubez(num)\n return num * num * num, 70\n 5\nend",
"def cubed(num)\n return num * num * num\n 5\nend",
"def cube(num) #specify, pass it num \n num * num * num \n 5 \nend",
"def cube(num)\n return num * num * num, 70\n #todo this returns 27 70\n 5\nend",
"def cube (n)\ncube_result = n**3\nreturn cube_result\nend",
"def cubed(num)\n multiplier(num, num, num)\nend",
"def cubed(num)\n puts num**3\nend",
"def cube(num)\n return num * num * num, 70\nend",
"def cubed(orgnum)\n return orgnum * orgnum * orgnum\nend",
"def cube(num) #specify, pass it num. calling cube method and is giving us the value back\n num * num * num \n \nend",
"def volume_of_a_cube(n)\n return n**3\nend",
"def cube(num) #specify, pass it num \n return num * num * num, \n 5 \nend",
"def sum_of_cubes(number)\n\t#Base Case - the simplest form our problem can take.\n\tif number == 1\n\t\treturn 1\n else\n #Reconstruction - here we rebuild!!!\n \tsum = number**3 + sum_of_cubes(number - 1)\n \treturn sum\n\tend\nend",
"def cubertino(n) # n is the parameter \n puts n ** 3\nend",
"def cubertino(n)\n puts n ** 3\nend",
"def volume_of_cube(n)\n return n * n * n\nend",
"def cubed\n Quantity.new(@value, @unit * @unit * @unit)\n end",
"def cube(num)\n puts \"Hello\"\n return num * num * num, \"The cube value\"\n 5\nend",
"def volume_of_cube(s)\n return (s ** 3)\nend",
"def cube(input)\n output = input * input\n return output\nend",
"def new_cube(n)\r\n return n*n*n,70;\r\nend",
"def cube(num)\n return num * num * num\n 5 # RUBY will ignore this bad boy\nend",
"def cube2(num)\n return num*num*num, \"Finished\"\nend",
"def volume_of_cube(dimension)\n return dimension**3\nend",
"def cube_int(integers)\n\tsquare_num = []\n\tfor i in 0..integers.length()-1\n\t\tsquare_num[i] = integers[i] ** 3\n\tend\n\treturn square_num\nend",
"def volume_of_cube(length)\n return length**3\nend",
"def volume_of_cube(length)\n return length**3\nend",
"def cube_all_integers(input)\n input.map do |i|\n i ** 3\n end\n end",
"def volume_of_cube(length_of_the_side)\nreturn length_of_the_side.to_i**3\nend",
"def volume_of_cube(length)\n return length **3\nend",
"def volume_of_cube(length)\n return length ** 3\nend",
"def three(number)\n puts 'Always ' + (((number + 5) * 2 - 4) / 2 - number).to_s\nend",
"def volume_calculations_cube(a)\n return a ** 3\nend",
"def multisum(number)\n\tbox = []\n\twhile number > 0\n\t\tbox << number if number % 3 == 0 || number % 5 == 0\n\t\tnumber -= 1\n\tend\n\tsum = 0\n\tbox.each { |e| sum += e }\nend",
"def cubes(array)\narray.map {|number| number ** 3}\n\n\nend",
"def lucas(number)\n golden_ratio = (1 + 5**0.5) / 2\n (golden_ratio**number).round.to_i\nrescue StandardError\n 'Error: Provide number only!'\nend",
"def number\n @number\n end",
"def volume_of_cube(side)\n return ( side ** 3 )\nend",
"def square_of_number(number)\n number * number\nend",
"def cubes(array)\n array.map { |number| number ** 3 }\nend",
"def number; end",
"def number; end",
"def multiply(number)\n\tputs number * 3\nend",
"def always_three(number)\n(((number + 5) * 2 - 4) / 2 - number).to_s\nend",
"def find_first_num_whose_cube_gr8ter_500(input)\n input.find do |i|\n i ** 3 > 500\n end\n end",
"def col_cube(x, z)\n Cube.new(x * cell_width, 0 * cell_height, z * cell_depth,\n cell_width, cell_height * rows, cell_depth)\n end",
"def find_volume_of_cube (length, width, height, lwh)\n puts \"The volume is #{length}*#{width}*#{height}= #{lwh}\"\nend",
"def cube_nums(num_arr)\n num_arr.map{|num| num ** 3}\nend",
"def getFactorial(number)\n factorial = 1\n if number > 0\n for i in 1..number\n factorial *= i\n end\n end\n return factorial\n end",
"def cubes(arr)\n p cubies = arr.map {|n| n ** 3}\nend",
"def square_of_number(number)\n return(number * number)\nend",
"def square_of_number(number)\n return(number * number)\nend",
"def volume_of_cube(side_length)\n volume = side_length **3\n #return volume\nend",
"def crackle(number)\n\treturn \"Crackle\" if number % 3 == 0\nend",
"def arthamatic_operation(number)\n\tnumber + 3\nend",
"def test_volume_of_cube()\n volume = volume_of_cube(3)\n assert_equal(27, volume)\n end",
"def test_volume_of_cube()\n volume = volume_of_cube(3)\n assert_equal(27, volume)\n end",
"def pile_of_cubes(m)\n n = 1\n n^3\n n^3 + (n+1)^3\n n^3 + (n+1)^3 + (n+2)^3\n\n\n # check m against 1^3\n # check m against 1^3 + 2^3\n # check m against 1^3 + 2^3 + 3^3...\n\n\nend",
"def cracklepop_number(number)\n ret = number\n ret = 'Crackle' if number.divisible_by?(3)\n ret = 'Pop' if number.divisible_by?(5)\n ret = 'CracklePop' if number.divisible_by?(3, 5)\n\n ret\nend",
"def factorial(number)\n\tresult = 1\n\tnumber.times do |index|\n\t\tresult *= (index + 1)\n\tend\n\tresult\nend",
"def test_volume_of_cube()\n result = volume_of_cube(5)\n assert_equal(125, result)\n end",
"def always_three (numberi)\n \n (((((numberi+5)*2)-4)/2)-numberi)\n \nend",
"def times_three_and_plus_five(number)\n number * 3 + 5\n end",
"def volume_of_cube(side_length)\n return (side_length ** 3)\nend",
"def always_three_again(number)\n\tnumber = (((number + 5) * 2 - 4) / 2 - number).to_s\n\t\nend",
"def factorial(number)\n\tfactorial = 1\n\t(1..number).each do |x|\n\t\tfactorial *= x\n\tend\n\treturn factorial\nend",
"def dudeney_number?(numero)\r\n# hacemos paso por valor del argumento \r\ns = numero\t\r\n# convertimos integer a string para separar los digitos\r\nnewNumber = s.to_s\r\n# separamos los digitos del string\r\nnewNumber.split('')\r\n# tamanio del string \r\ntamanio = newNumber.length\r\n# si numero es iguala 1 se asigna a number\r\n\tif numero == 1\r\n\t\tnumber = 1\r\n# y si tamanio del argumento es de 3 cifras \t\t\r\n\telsif tamanio == 3\r\n# asignamos el valor por posicion\r\n\t\ta = newNumber[0]\r\n\t\tb = newNumber[1]\r\n\t\tc = newNumber[2]\r\n\t\t#convertimos de string a integer cada una de las asignaciones las sumamos y asi determinaremo el cubo perfecto\r\n\tnumber = a.to_i + b.to_i + c.to_i \r\n# si es de 4 cifras el argumento se hace lo mismo pero con 4 cifras \r\n\telsif tamanio == 4\r\n\t\ta = newNumber[0]\r\n\t\tb = newNumber[1]\r\n\t\tc = newNumber[2]\t\t\r\n\t\td = newNumber[3]\r\n\tnumber = a.to_i + b.to_i + c.to_i + d.to_i\r\n\tend\r\n# se eleva al cubo el numero base\r\n\tcubo =(number*number*number)\r\n# si cubo es igual valor del argumento regresa true diciendo que es un numero dudeney \r\n\tif cubo == numero\r\n\t\tr = true\r\n\telse\r\n\t\tr = false\r\n\tend\t\r\n# retorno\r\n\tr\r\nend",
"def volume_of_cube(side_length)\n return side_length ** 3\nend",
"def test_volume_of_cube()\n first_volume = cube_volume(1)\n second_volume = cube_volume(3)\n third_volume = cube_volume(5)\n assert_equal(1, first_volume)\n assert_equal(27, second_volume)\n assert_equal(125, third_volume)\n end",
"def cubes(array)\n array.map { |number| number ** 3}\n # Return array\nend",
"def cubed_values (array)\n\n cubed_array = array.map { | number | number ** 3 }\n return cubed_array\n\nend",
"def volume_of_cube(length, width, height)\nreturn length * width * height\n #add test code here\nend",
"def number(name, number)\n push(name, number)\n end",
"def Factorialize(number)\n result = 1\n for i in 1..number do\n result *= i\n end\n return result\nend",
"def exercise_119 (number)\n end",
"def multisum(number)\n multiply_three = number / 3\n multiply_five = number / 5\n sum = []\n multiply_three.times { |idx| sum << 3 * (idx + 1) }\n multiply_five.times { |idx| sum << 5 * (idx + 1) }\n sum.uniq.inject(:+)\nend",
"def test_volume_of_cube()\n first_volume = volume_of_a_cube (3) \n assert_equal(27,first_volume)\n end",
"def add_three(n)\n n + 3\nend",
"def select_all_num_whose_cube_gr8ter_500(input)\n input.select do |i|\n i ** 3 > 500\n end\n end",
"def factorial(number)\n\tvalue = 1\n\tif number == 0 || number == 1\n\t\tvalue\n\telse\n\t\t(2..number).each {|element| value *= element}\n\t\tvalue\n\tend\nend",
"def z_function(number)\n return 0 if number < 5\n number/5 + z_function(number/5)\nend",
"def volume_of_cube(length_of_side)\n return length_of_side ** 3\nend",
"def add_three(number)\n number + 3\nend",
"def add_three(number)\n number + 3\nend",
"def add_three(number)\n number + 3\nend"
] |
[
"0.8213973",
"0.777724",
"0.7711808",
"0.7711808",
"0.7662522",
"0.7644898",
"0.76436865",
"0.75690955",
"0.75690955",
"0.7566075",
"0.7502475",
"0.74812263",
"0.74648935",
"0.7462398",
"0.7462398",
"0.74083155",
"0.7388654",
"0.7325691",
"0.7306227",
"0.73051494",
"0.71911746",
"0.7150706",
"0.71472347",
"0.71101975",
"0.69836867",
"0.68092287",
"0.68079334",
"0.67574567",
"0.67188644",
"0.66801804",
"0.65620035",
"0.63976794",
"0.63826185",
"0.6380734",
"0.6377587",
"0.63687545",
"0.6341692",
"0.6269889",
"0.62227374",
"0.6208446",
"0.61336493",
"0.61336493",
"0.61124027",
"0.6036652",
"0.60352",
"0.5949025",
"0.5896337",
"0.58911145",
"0.5872156",
"0.586856",
"0.58438313",
"0.5825779",
"0.5823884",
"0.5745099",
"0.57432616",
"0.5702422",
"0.5702422",
"0.5693319",
"0.56864417",
"0.5647713",
"0.5646478",
"0.5640782",
"0.5630353",
"0.56269",
"0.5618751",
"0.5616544",
"0.5616544",
"0.55940795",
"0.5587556",
"0.55850387",
"0.5542465",
"0.55418664",
"0.5529078",
"0.5487452",
"0.54825765",
"0.5466785",
"0.54581654",
"0.5452761",
"0.54526",
"0.54433024",
"0.5441275",
"0.543911",
"0.5436765",
"0.54353684",
"0.54143274",
"0.54126406",
"0.5408017",
"0.5407637",
"0.54042524",
"0.5402358",
"0.5401177",
"0.5400706",
"0.53981745",
"0.5384675",
"0.5362352",
"0.5352952",
"0.5352587",
"0.53505045",
"0.53505045",
"0.53505045"
] |
0.5364962
|
94
|
A panel has been refreshed Parameters:: iPanel (Wx::Panel): The panel just refreshed
|
def notifyRefresh(iPanel)
if (!@DuringInit)
# Find the Tab containing this Panel
lIdx = @DependencyPanels.index(iPanel)
lDepUserChoice = @DepsUserChoices[lIdx]
lIconName = "#{@IconsDir}/Dependency.png"
if (lDepUserChoice.Locate)
if (lDepUserChoice.ResolvedTesters.size == lDepUserChoice.DepDesc.Testers.size)
# Complete
lIconName = "#{@IconsDir}/ValidOK.png"
else
# Incomplete
lIconName = "#{@IconsDir}/ValidKO.png"
end
elsif (lDepUserChoice.Ignore)
lIconName = "#{@IconsDir}/Ignore.png"
else
# Get the icon of the selected Installer
lInstallerName = lDepUserChoice.DepDesc.Installers[lDepUserChoice.IdxInstaller][0]
# TODO: Accept more data formats
lInstallerIconName = "#{@Installer.RDILibDir}/Plugins/Installers/Icons/#{lInstallerName}.png"
if (File.exists?(lInstallerIconName))
lIconName = lInstallerIconName
end
end
lIdxImage = @NBImageListManager.getImageIndex(lIconName) do
lIcon, lError = getBitmapFromURL(lIconName)
if (lIcon == nil)
lIcon, lError = getBitmapFromURL("#{@IconsDir}/Dependency.png")
end
next lIcon
end
@NBDeps.set_page_image(lIdx, lIdxImage)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def refreshUI; @apPanel.redrawwin; @entryPanel.redrawwin; @entryListBox.refresh; @apListBox.refresh end",
"def _draw_panel\n @apotomo_emit_raw_view = true\n render :view => param(:panel)\n end",
"def refresh!; end",
"def refresh; end",
"def refresh!\n refresh\n @window.refresh\n end",
"def refresh\r\n end",
"def needs_redraw?; end",
"def processPartialUpdate(viewer)\n # In this demo, we just need to redraw the chart\n drawChart(viewer)\n end",
"def set_panel\n @panel = Panel.find(params[:id])\n end",
"def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @panel_id = args[:panel_id] if args.key?(:panel_id)\n @panel_position = args[:panel_position] if args.key?(:panel_position)\n @total_panels = args[:total_panels] if args.key?(:total_panels)\n end",
"def component_update_expense_manager\r\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \r\n if request.xhr?\r\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\r\n component_expense_manager\r\n else\r\n # If this is from a client without javascript we want to update the session parameters and then delegate\r\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\r\n redirect_to(:action => :list_expense_manager) \r\n end\r\n end",
"def repaint\n $log.debug \" form repaint:#{self}, #{@name} , r #{@row} c #{@col} \" if $log.debug? \n if @resize_required && @layout_manager\n @layout_manager.form = self unless @layout_manager.form\n @layout_manager.do_layout\n @resize_required = false\n end\n @widgets.each do |f|\n next if f.visible == false # added 2008-12-09 12:17 \n #$log.debug \"XXX: FORM CALLING REPAINT OF WIDGET #{f} IN LOOP\"\n #raise \"Row or col nil #{f.row} #{f.col} for #{f}, #{f.name} \" if f.row.nil? || f.col.nil?\n f.repaint\n f._object_created = true # added 2010-09-16 13:02 now prop handlers can be fired\n end\n \n _update_focusables if @focusable_modified\n # this can bomb if someone sets row. We need a better way!\n if @row == -1 and @_firsttime == true\n \n select_first_field\n @_firsttime = false\n end\n setpos \n # XXX this creates a problem if window is a pad\n # although this does show cursor movement etc.\n ### @window.wrefresh\n #if @window.window_type == :WINDOW\n #$log.debug \" formrepaint #{@name} calling window.wrefresh #{@window} \"\n @window.wrefresh\n Ncurses::Panel.update_panels ## added 2010-11-05 00:30 to see if clears the stdscr problems\n #else\n #$log.warn \" XXX formrepaint #{@name} no refresh called 2011-09-19 #{@window} \"\n #end\n end",
"def list_data_changed\n if row_count == 0 # added on 2009-02-02 17:13 so cursor not hanging on last row which could be empty\n init_vars\n @current_index = 0\n set_form_row\n end\n @widget_scrolled = true # 2011-10-15 \n @repaint_required = true\n end",
"def _edit_panel_submit(req_parms = nil)\n request_params = req_parms || param(@resource.to_sym) \n js_emit = ''\n # @record = scoped_model.find_by_id(param(:id)) || scoped_model.new\n puts 'REQUEST PARAMETERS IN EDIT PANEL SUBMIT: ' + request_params.inspect\n if @record.new_record?\n @record = scoped_model.create(request_params)\n adjust_after_create\n else\n @record.update_attributes(request_params)\n adjust_after_update\n end\n if @record.save\n @record.reload # Be sure we get the id if this was a new record\n adjust_after_save\n trigger(:recordUpdated)\n js_emit += js_flash_feedback(\"Record updated.\")\n js_emit += <<-JS\n closeEditPanel('##{@jqgrid_id}');\n JS\n else\n js_emit += js_flash_feedback('Some kind of error saving in edit_panel_submit')\n end\n # reload as if we got an updated message from a hypothetical child\n render :js => js_emit + update_recordset_js(false)\n end",
"def del_panel\n Panel.del_panel(pointer)\n end",
"def window_update(name)\n if name != nil\n @cShopName.text = name\n end\n refresh()\n end",
"def refresh\n end",
"def refresh\n end",
"def component_update\r\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \r\n if request.xhr?\r\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\r\n component\r\n else\r\n # If this is from a client without javascript we want to update the session parameters and then delegate\r\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\r\n return_to_main\r\n end\r\n\t\r\n end",
"def refresh\n @window.refresh\n end",
"def update\n respond_to do |format|\n if @panel.update(panel_params)\n format.html { redirect_to @panel, notice: 'Panel was successfully updated.' }\n format.json { render :show, status: :ok, location: @panel }\n else\n format.html { render :edit }\n format.json { render json: @panel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def grid_modified!\n end",
"def refresh\n end",
"def component_update\r\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \r\n if request.xhr?\r\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\r\n component\r\n else\r\n # If this is from a client without javascript we want to update the session parameters and then delegate\r\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\r\n return_to_main\r\n end\r\n end",
"def component_update\r\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \r\n if request.xhr?\r\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\r\n component\r\n else\r\n # If this is from a client without javascript we want to update the session parameters and then delegate\r\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\r\n return_to_main\r\n end\r\n end",
"def component_update\r\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \r\n if request.xhr?\r\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\r\n component\r\n else\r\n # If this is from a client without javascript we want to update the session parameters and then delegate\r\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\r\n return_to_main\r\n end\r\n end",
"def window_update()\n if $game_party != nil\n @ucLocation.cValue.text = $game_map.name\n \n @total_sec = Graphics.frame_count / Graphics.frame_rate\n hour = @total_sec / 60 / 60\n min = @total_sec / 60 % 60\n sec = @total_sec % 60\n \n @ucTime.cLabel.text = sprintf(MENU_CONFIG::TIME_PATTERN, hour, min, sec)\n @ucGold.cLabel.text = $game_party.gold\n end\n refresh()\n end",
"def window_update()\n if $game_party != nil\n @ucLocation.cValue.text = $game_map.name\n \n @total_sec = Graphics.frame_count / Graphics.frame_rate\n hour = @total_sec / 60 / 60\n min = @total_sec / 60 % 60\n sec = @total_sec % 60\n \n @ucTime.cLabel.text = sprintf(MENU_CONFIG::TIME_PATTERN, hour, min, sec)\n @ucGold.cLabel.text = $game_party.gold\n end\n refresh()\n end",
"def live\n\t\t@scroll = Scroll.find(params[:id])\n\t\t@panels = Panel.find_all_by_scroll_id(params[:id],:order => \"panel_id DESC\",:limit => 10)\n\tend",
"def panel_window\n Panel.panel_window(pointer)\n end",
"def update\n @panel = Panel.find(params[:id])\n\n respond_to do |format|\n if @panel.update_attributes(params[:panel])\n flash[:notice] = 'Panel was successfully updated.'\n format.html { redirect_to(@panel) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @panel.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def component_update\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \n if request.xhr?\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\n component\n else\n # If this is from a client without javascript we want to update the session parameters and then delegate\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\n return_to_main\n end\n end",
"def component_update\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \n if request.xhr?\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\n component\n else\n # If this is from a client without javascript we want to update the session parameters and then delegate\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\n return_to_main\n end\n end",
"def component_update\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \n if request.xhr?\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\n component\n else\n # If this is from a client without javascript we want to update the session parameters and then delegate\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\n return_to_main\n end\n end",
"def appears_in_panel(width, height)\n @container = 'panel'\n @width = width\n @height = height\n end",
"def update\n @panel = Panel.find(params[:id])\n\n respond_to do |format|\n if @panel.update_attributes(params[:panel])\n format.html { redirect_to(admin_panel_path(@panel), :notice => 'Panel was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @panel.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def prefresh\n ## reduce so we don't go off in top+h and top+w\n $log.debug \" start ret = @buttonpad.prefresh( #{@pminrow} , #{@pmincol} , #{@top} , #{@left} , top + #{@display_h} left + #{@display_w} ) \"\n if @pminrow + @display_h > @orig_top + @pad_h\n $log.debug \" if #{@pminrow} + #{@display_h} > #{@orig_top} +#{@pad_h} \"\n $log.debug \" ERROR 1 \"\n #return -1\n end\n if @pmincol + @display_w > @orig_left + @pad_w\n $log.debug \" if #{@pmincol} + #{@display_w} > #{@orig_left} +#{@pad_w} \"\n $log.debug \" ERROR 2 \"\n return -1\n end\n # actually if there is a change in the screen, we may still need to allow update\n # but ensure that size does not exceed\n if @top + @display_h > @orig_top + @pad_h\n $log.debug \" if #{@top} + #{@display_h} > #{@orig_top} +#{@pad_h} \"\n $log.debug \" ERROR 3 \"\n return -1\n end\n if @left + @display_w > @orig_left + @pad_w\n $log.debug \" if #{@left} + #{@display_w} > #{@orig_left} +#{@pad_w} \"\n $log.debug \" ERROR 4 \"\n return -1\n end\n # maybe we should use copywin to copy onto @target_window\n $log.debug \" ret = @window.prefresh( #{@pminrow} , #{@pmincol} , #{@top} , #{@left} , #{@top} + #{@display_h}, #{@left} + #{@display_w} ) \"\n omit = 0\n # this works but if want to avoid copying border\n #ret = @window.prefresh(@pminrow, @pmincol, @top+@row_offset, @left+@col_offset, @top + @display_h - @row_offset , @left + @display_w - @col_offset)\n #\n $log.debug \"ret = @window.copywin( #{@pminrow} , #{@pmincol} , #{@top+@row_offset} , #{@left+@col_offset} , #{@top} + #{@display_h} - #{@row_offset} , #{@left} + #{@display_w} - #{@col_offset} , 0)\"\n ## Haha , we are back to the old notorious copywin which has given mankind\n # so much grief that it should be removed in the next round of creation.\n ret = @window.copywin(@target_window.get_window, @pminrow, @pmincol, @top+@row_offset, @left+@col_offset, \n @top + @display_h - @row_offset , @left + @display_w - @col_offset, 0)\n\n $log.debug \" copywin ret = #{ret} \"\n end",
"def render_ext_panel(items = [])\n items.each { |item| \n item[:html] = item[:html].gsub(/\"/,'\\\"').gsub(/\\n/,'')\n item[:id] ||= rand(10000)\n }\n render :partial => \"admin/extjs/panel\", :locals => {\n :items => items, :random_id => rand(10000)\n }\n end",
"def window_update(exp)\n if exp != nil\n @ucTotalExp.cValue.text = exp\n end\n refresh()\n end",
"def window_update(exp)\n if exp != nil\n @ucTotalExp.cValue.text = exp\n end\n refresh()\n end",
"def exp_changed\n @edit = session[:edit]\n @edit[@expkey].update_from_expression_editor(params)\n # See if only a text value changed\n if params[:chosen_value] || params[:chosen_regkey] || params[:chosen_regval] ||\n params[:chosen_cvalue || params[:chosen_suffix]] || params[:alias]\n render :update do |page|\n page << javascript_prologue\n end\n elsif @refresh_div.to_s == 'flash_msg_div'\n javascript_flash(:flash_div_id => 'exp_editor_flash')\n else\n render :update do |page|\n page << javascript_prologue\n page.replace(\"exp_editor_flash\", :partial => \"layouts/flash_msg\", :locals => {:flash_div_id => 'exp_editor_flash'})\n page << \"miqScrollTop();\" if @flash_array.present?\n page.replace(\"exp_atom_editor_div\", :partial => \"layouts/exp_atom/editor\")\n\n page << ENABLE_CALENDAR if @edit[@expkey].calendar_needed?\n @edit[@expkey].render_values_to(page)\n page << \"miqSparkle(false);\" # Need to turn off sparkle in case original ajax element gets replaced\n end\n end\n end",
"def notifyRedoUpdate\n updateCommand(Wx::ID_REDO) do |ioCommand|\n if (@RedoStack.empty?)\n ioCommand[:Title] = 'Redo'\n ioCommand[:Enabled] = false\n else\n lLastOperationTitle = @RedoStack[-1].Title\n ioCommand[:Title] = \"Redo #{lLastOperationTitle}\"\n ioCommand[:Enabled] = true\n end\n end\n end",
"def window_update(skill)\n if skill != nil\n @ucSkillInfo.cLabel.text = skill.name\n @ucSkillInfo.ucIcon.iconIndex = skill.icon_index\n end\n refresh()\n end",
"def window_update(skill)\n if skill != nil\n @ucSkillInfo.cLabel.text = skill.name\n @ucSkillInfo.ucIcon.iconIndex = skill.icon_index\n end\n refresh()\n end",
"def del_panel\n FFI::NCurses.del_panel(@pointer)\n end",
"def numberOfPreviewItemsInPreviewPanel(panel)\n @previewItem ? 1 : 0\n end",
"def refresh\n\t\t@frame.updateGrid\n\t\tself.update\n\t\treturn self\n\tend",
"def wrefresh\n $log.debug \" inside pad's wrefresh #{@window}. minr,minc,top,left,smaxr,c: #{@pminrow}, #{@pmincol}, #{@top} #{@left} #{smaxrow()} #{smaxcol()} self: #{self.name} \"\n\n # caution, prefresh uses maxrow and maxcol not height and width\n # so we have to add top and less one since we are zero based\n ret = @window.prefresh(@pminrow, @pmincol, @top, @left, smaxrow(), smaxcol())\n $log.warn \" WREFRESH returns -1 ERROR - width or height must be exceeding \" if ret == -1\n @modified = false\n return ret\n end",
"def panel_userptr\n Panel.panel_userptr(pointer)\n end",
"def list_data_changed\n if row_count == 0 # added on 2009-02-02 17:13 so cursor not hanging on last row which could be empty\n init_vars\n @current_index = 0\n set_form_row\n end\n @repaint_required = true\n end",
"def popup_remove_confirm_panel\n\t\t# unit_test_no_generate: popup_remove_confirm_panel, div.className(create_ats_regex_string(\"ats-removeconfirmpanel\"));ProfilePopupRemovePanel\n\t\t$tracer.trace(__method__)\n\t\treturn ProfilePopupRemovePanel.new(div.className(create_ats_regex_string(\"ats-removeconfirmpanel\")), __method__)\n\tend",
"def form_field_changed\n return unless load_edit(\"sm_edit__#{params[:id]}\")\n get_form_vars\n changed = (@edit[:new] != @edit[:current])\n\n render :update do |page|\n page << javascript_prologue\n if changed != session[:changed]\n session[:changed] = changed\n page << javascript_for_miq_button_visibility(changed)\n end\n if @edit[:default_verify_status] != session[:verify_sm_status]\n session[:verify_sm_status] = @edit[:default_verify_status]\n if @edit[:default_verify_status]\n page << \"miqValidateButtons('show', 'default_');\"\n else\n page << \"miqValidateButtons('hide', 'default_');\"\n end\n end\n end\n end",
"def refresh()\n self.contents.clear\n @ucTotal.draw()\n @ucDifference.draw()\n end",
"def refresh\n # FIXME\n end",
"def getConfigPanel(iParent, iController)\n return nil\n end",
"def exp_window_update(exp)\n @victory_main.redraw_exp(exp)\n create_leveled_windows\n pack_and_send\n end",
"def redraw(*items)\n addToQueue(items)\n plot\n end",
"def refresh\n\t\t\t@window.refresh\n\t\t\t@windows.each { |w| w.refresh if w.visible? }\n\t\tend",
"def update_visualization(point)\n\t\t\t\t\n\t\t\tend",
"def update_phase3_actor_select\n # Update status window scroll position\n $game_temp.battle_actor_index = @actor_arrow.index\n @status_window.refresh\n # Call the original method\n large_party_update_phase3_actor_select\nend",
"def set_sold_panel\n @sold_panel = SoldPanel.find(params[:id])\n end",
"def window_update(actor)\n if actor != nil\n @cCharName.text = actor.name\n @ucCharLvl.cValue.text = actor.level\n \n if (actor.next_exp == 0)\n gauge_min = 1\n gauge_max = 1\n exp_value = MENU_CONFIG::MAX_EXP_GAUGE_VALUE\n else\n gauge_min = actor.now_exp\n gauge_max = actor.next_exp\n exp_value = sprintf(MENU_CONFIG::GAUGE_PATTERN, actor.now_exp, actor.next_exp)\n end\n \n @ucExp.cValue.text = exp_value\n @ucExpGauge.value = gauge_min\n @ucExpGauge.max_value = gauge_max\n \n @ucTotalExp.cValue.text = actor.exp\n end\n refresh()\n end",
"def after_refresh(_options = {}); end",
"def refresh\n do_refresh\n end",
"def refresh\n do_refresh\n end",
"def initialize(panel)\n @panel = panel\n end",
"def repaint_all_widgets\n $log.debug \" REPAINT ALL in FORM called \"\n @widgets.each do |w|\n next if w.visible == false\n next if w.class.to_s == \"Canis::MenuBar\"\n $log.debug \" ---- REPAINT ALL #{w.name} \"\n #w.repaint_required true\n w.repaint_all true\n w.repaint\n end\n $log.debug \" REPAINT ALL in FORM complete \"\n # place cursor on current_widget \n setpos\n end",
"def window_update(enemy, scan_mode)\n if enemy != nil\n @scan_mode = scan_mode\n @ucEnemyGraphic.enemy = enemy\n end\n refresh()\n end",
"def wrefresh\n Ncurses.wrefresh(@window)\n end",
"def get_report_panel\n # report_panel = browser.span(:text, @report_root_name).when_present(@time_out).parent.parent\n report_panel = browser.span(:text, @report_root_name).parent.parent\n end",
"def prePopListener\n end",
"def refresh\n send_cmd \"refresh\"\n nil\n end",
"def on_change\r\n $game_map.need_refresh = true\r\n end",
"def refresh\n #==========================================================================\n # Here we set the Y-origin for the window's display to 0, so that the new\n # page will display from the top even if the player had scrolled all the\n # way to the bottom of the previous page. We also build the contents for\n # the current page, draw the page number display, and then draw whatever\n # the page is intended to contain. When creating a child window for this\n # class, make sure to create a draw_page# method for each page in the\n # window. I've set things up so that a page will remain blank (or display\n # its text from @pagetext, if it has any) if the method doesn't exist\n # rather than throwing an error and crashing, but that's no excuse to\n # leave a poor little page without a handler! Well, unless you're just\n # displaying text, but still. Try to be creative! You can create\n # encyclopedias with pictures, or magazines with articles set in various\n # column styles, or dozens of other things! Don't limit yourself to just\n # plain books - though those are good, too.\n #==========================================================================\n self.oy = 0\n create_contents and draw_scroll\n send(\"draw_page#{@page}\")\n return true\n end",
"def refresh_frame(run_whereami = T.unsafe(nil)); end",
"def reload\n selenium.get_eval(\"selenium.browserbot.getCurrentWindow().location.reload()\")\n end",
"def window_update(gold)\n if gold != nil\n @ucGold.cValue.text = gold\n end\n refresh()\n end",
"def window_update(image)\n if image != nil\n @ucImage.image = image\n end\n refresh()\n end",
"def update_visualization(point)\n\t\t\n\tend",
"def update_visualization(point)\n\t\t\n\tend",
"def update_visualization(point)\n\t\t\n\tend",
"def update_visualization(point)\n\t\t\n\tend",
"def component_update \n if request.xhr?\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\n component\n else\n # If this is from a client without javascript we want to update the session parameters and then delegate\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\n update_params :default_scaffold_id => \"webrt\", :default_sort => nil, :default_sort_direction => \"desc\"\n return_to_main\n end\n end",
"def needs_redraw?\n @needs_redraw\n end",
"def refresh\n do_refresh\n self\n end",
"def repaint\n print_border if @repaint_all and @print_border_flag\n print_footer if @print_border_flag\n $log.debug \" scrollForm repaint calling parent #{@row} #{@col}+ #{@cols_panned} #{@col_offset} \"\n super\n prefresh\n if @print_border_flag\n _print_more_data_marker true\n _print_more_columns_marker true\n end\n #$log.debug \" @target_window.wmove #{@row+@rows_panned+@row_offset}, #{@col+@cols_panned+@col_offset} \"\n @target_window.wmove @row+@rows_panned+@row_offset, @col+@cols_panned+@col_offset\n @window.modified = false\n @repaint_all = false\n end",
"def fire_dimension_changed _method=nil\n # recreate pad since width or ht has changed (row count or col width changed)\n @_populate_needed = true\n @repaint_required = true\n @repaint_all = true\n fire_handler :DIMENSION_CHANGED, _method\n @__first_time = nil\n end",
"def needs_redraw?\n true \n end",
"def panel_hidden\n Panel.panel_hidden(pointer) == 0\n end",
"def updateSize(x,y)\n x = (@panel.getWidth() > x) ? @panel.getWidth : x\n y = (@panel.getHeight() > y) ? @panel.getHeight : y\n @panel.setPreferredSize(Dimension.new(x,y))\n end",
"def window\n\t\t@scroll = Scroll.find(params[:id])\n\t\t@panels = Panel.find_all_by_scroll_id(params[:id],:conditions => [\"id > ?\",params[:panel_id]],:limit => 10,:order => \"panel_id\")\n\t\trender :template => \"scrolls/static\", :layout => false\n\tend",
"def update\n if panel_params[:panel_number] and panel_params[:panel_location]\n Panel.assign(@ann, panel: panel_params[:panel_number], to: panel_params[:panel_location])\n end\n\n @panel = @ann.panel\n\n respond_to do |format|\n if @ann.update(ann_params)\n format.html { redirect_to @ann, notice: 'Ann was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ann.errors, status: :unprocessable_entity }\n end\n end\n end",
"def repaint\n # we need to see if structure changed then regenerate @list\n _list()\n super\n end",
"def length\n return @panels.length\n end",
"def set_panel_provider\n @panel_provider = PanelProvider.find(params[:id])\n end",
"def after_update; end",
"def after_update; end",
"def reload\n get_eval(\"selenium.browserbot.getCurrentWindow().location.reload()\")\n end",
"def before_load\n widget_session.clear\n end",
"def window_update(oline)\n if oline != nil\n #text = \"\"\n @last_color = 0\n @contents_x = 0\n @contents_y = 0\n @biggest_text_height = 0\n @cControlsList.clear()\n for l in oline\n next if l == nil\n converted_line = convert_special_characters(l)\n generate_controls(converted_line)\n new_line\n end\n\n # Changes contents size for scrolling\n self.contents.dispose\n self.contents = Bitmap.new(self.width - 32, [self.height - 32, @contents_y].max)\n self.oy = 0\n end\n \n refresh()\n end"
] |
[
"0.5962467",
"0.59367937",
"0.5551284",
"0.552696",
"0.54813856",
"0.5412496",
"0.5412432",
"0.53638077",
"0.53235126",
"0.53016245",
"0.52987516",
"0.5287404",
"0.5279883",
"0.5279396",
"0.52771014",
"0.5269382",
"0.5237463",
"0.5237463",
"0.5221807",
"0.5219583",
"0.52071476",
"0.5206435",
"0.5202609",
"0.51822174",
"0.51822174",
"0.51822174",
"0.5169633",
"0.5169633",
"0.51490325",
"0.5148204",
"0.51144814",
"0.5108762",
"0.5108762",
"0.5108762",
"0.51074064",
"0.51057637",
"0.5101875",
"0.50662696",
"0.5061843",
"0.5061843",
"0.5025783",
"0.5017987",
"0.50175804",
"0.50175804",
"0.5017167",
"0.50048137",
"0.49972367",
"0.4994607",
"0.4994581",
"0.49872392",
"0.4973429",
"0.49650016",
"0.49646485",
"0.4964595",
"0.49519628",
"0.49485272",
"0.49459842",
"0.49443638",
"0.49430758",
"0.49403495",
"0.49403346",
"0.49325755",
"0.49320424",
"0.49173895",
"0.49173895",
"0.4901448",
"0.48977914",
"0.48948872",
"0.48777407",
"0.48776886",
"0.48765525",
"0.48761502",
"0.48624954",
"0.4859921",
"0.48543024",
"0.4845969",
"0.48311615",
"0.48245442",
"0.48202682",
"0.48202682",
"0.48202682",
"0.48202682",
"0.48191512",
"0.48164836",
"0.48148674",
"0.47992235",
"0.47937587",
"0.4791281",
"0.47853926",
"0.47741416",
"0.47730792",
"0.47677815",
"0.4764186",
"0.47590503",
"0.47582975",
"0.47567835",
"0.47567835",
"0.47524145",
"0.47519585",
"0.47518468"
] |
0.61301386
|
0
|
def merge(left, right) merged = [] until left.empty? || right.empty? case left.first.length right.first.length when 1 merged << left.first when 0 merged << left.first when 1 merged << right.first end end merged.concat(left) merged.concat(right) end def merge_sort(arr) return arr if arr.length < 2 midpoint = arr.length / 2 left = arr.take(midpoint) right = arr.drop(midpoint) sorted_left = merge_sort(left) sorted_right = merge_sort(right) merge(sorted_left, sorted_right) end
|
def dominant_octopus(arr)
sorted = merge_sort(arr)
arr[-1]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def mergeSort(arr, left, right)\n mid = left + ((right - left) / 2)\n if left >= right\n return arr[left..right]\n end\n left_arr = mergeSort(arr, left, mid)\n right_arr = mergeSort(arr, mid + 1, right)\n #puts \"arrays to be merged = #{left_arr} with #{right_arr}\"\n #puts \"#{left} #{mid} #{right}\"\n j = merge(left_arr, right_arr)\n return j\n end",
"def merge_sort(arr)\n return arr if arr.length <= 1\n mid = arr.length / 2\n left, right= arr.take(mid), arr.drop(mid)\n sorted_left, sorted_right = merge_sort(left), merge_sort(right)\n\n merge(sorted_left, sorted_right)\nend",
"def merge_sort(arr)\n return arr if arr.length == 1 \n mid = (arr.length/2).floor\n left = merge_sort(arr[0..mid - 1])\n right = merge_sort(arr[mid..-1])\n merge(left, right)\nend",
"def merge_sort(arr)\n if arr.length == 1\n return arr\n end\n mid = arr.length / 2\n left = arr[0...mid]\n right = arr[mid..-1]\n\n left_half = merge_sort(left)\n right_half = merge_sort(right)\n merge(left_half,right_half)\nend",
"def mergeSort array\n if array.count <= 1\n return array\n end\n\n middle = array.count / 2\n left = mergeSort array.slice(0, middle)\n right = mergeSort array.slice(middle, array.count)\n\n left_offset = 0\n right_offset = 0\n\n while left_offset < left.count && right_offset < right.count\n a = left[left_offset]\n b = right[right_offset]\n\n if a <= b\n array.push a\n left_offset += 1\n else\n array.push b\n right_offset += 1\n end\n end\n return merge(left, right)\nend",
"def merge_sort(arr)\n return arr if arr.length <= 1\n left_half = arr[0...arr.length/2]\n right_half = arr[arr.length/2..-1]\n\n left = merge_sort(left_half) \n right = merge_sort(right_half)\n merge(left, right)\n \nend",
"def merge_sort(arr)\n if arr.length <= 1\n return arr\n else \n mid = arr.length/2\n left = merge_sort(arr.slice(0...mid))\n right = merge_sort(arr.slice(mid...arr.length))\n merge(left, right)\n end \nend",
"def merge_sort(arr)\n return arr if arr.length <= 1\n \n mid = arr.length / 2\n left, right = arr[0...mid], arr[mid..-1]\n left, right = merge_sort(left), merge_sort(right)\n\n merge(left, right)\nend",
"def merge_sort(arr)\n return arr if arr.length <= 1\n\n middle_idx = arr.length / 2\n\n left = arr[0...middle_idx]\n right = arr[middle_idx..-1]\n\n merge(merge_sort(left), merge_sort(right))\n\nend",
"def merge_sort(arr)\n return arr if arr.length <= 1\n mid = arr.length / 2\n left = merge_sort(arr[0...mid])\n right = merge_sort(arr[mid..-1])\n\n merge(left, right)\nend",
"def merge_sort_merge(left, right)\n sorted = []\n until left.empty? || right.empty?\n if left[0] <= right[0]\n sorted << left.shift\n else\n sorted << right.shift\n end\n end\n sorted += left + right\n sorted\n end",
"def merge_sort(ary)\n# base case\n return ary if ary.size < 2\n\n# divide(recursively dividing the array)\n left = merge_sort(ary[0...ary.size/2])\n right = merge_sort(ary[ary.size/2...ary.size])\n\n sorted = []\n# conquer(sort)\n while left.length > 0 && right.length > 0\n# until left.empty? || right.empty? # until one array is empty. In other words, when both are not empty.\n sorted << (left.first > right.first ? right.shift : left.shift)\n end\n\n# if one of the array is empty, add the other array to the sorted list\n left.empty? ? sorted += right : sorted += left\nend",
"def merge_sort(array)\n return array if array.length <= 1 \n mid = array.length / 2\n sorted_left = merge_sort(array.take(mid))\n sorted_right = merge_sort(array.drop(mid))\n \n merge(sorted_left, sorted_right)\n \nend",
"def mergeSort(arr)\n\n if (arr.length == 1)\n return arr\n end\n\n center = (arr.length / 2).floor\n left = arr[0...center] # takes values from 0 to center excluding the center index\n right = arr[center...arr.length] # takes values from center to end\n\n return merge( mergeSort(left), mergeSort(right) )\nend",
"def merge_sort(arr)\n return arr if arr.length <= 1\n mid = arr.length / 2\n left = merge_sort(arr[0...mid])\n right = merge_sort(arr[mid..-1])\n merge(left, right)\nend",
"def merge_sort(arr)\n return arr if arr.length < 2\n mid_idx = arr.length/2\n left = arr[0...mid_idx]\n right = arr[mid_idx..-1]\n return merge(merge_sort(left), merge_sort(right))\nend",
"def mergeSort(arr)\n\tif arr.length == 1\n\t\treturn arr\n\tend\n\n\tmidpoint = arr.length/2.round\n\tleft = arr[0...midpoint]\n\tright = arr[midpoint..-1]\n\tleft = mergeSort(left) #[4,6]\n\tright = mergeSort(right) #[8, 2]\n\n\treturn merge(left, right)\nend",
"def merge_sort(arr)\n return arr if arr.length <= 1\n\n mid = arr.length / 2\n\n left = arr[0...mid]\n right = arr[mid..-1]\n\n my_merge(merge_sort(left), merge_sort(right))\nend",
"def merge_sort(arr)\n return arr if arr.length <= 1\n\n middle = arr.length / 2\n left = arr[0...middle]\n right = arr[middle..-1]\n merge(merge_sort(left), merge_sort(right))\nend",
"def merge_sort(array)\n p array\n return array if array.length < 2\n\n mid_i = array.length / 2\n left_arr = array[0...mid_i] \n right_arr = array[mid_i..-1] \n\n sorted_left = merge_sort(left_arr)\n sorted_right = merge_sort(right_arr)\n\n merge(sorted_left, sorted_right)\n\nend",
"def merge_sort(arr)\n if arr.length < 2\n arr\n else\n sorted = []\n left = merge_sort(arr[0..arr.length / 2 - 1])\n right = merge_sort(arr[arr.length / 2..-1])\n while left[0] && right[0]\n sorted << (left[0] > right[0] ? right.shift : left.shift)\n end\n sorted += left + right\n end\nend",
"def merge_sort arr\n if arr.size > 1\n mid = arr.size / 2\n left = arr[0, mid]\n right = arr[mid, arr.size-mid]\n \n merge_sort(left)\n merge_sort(right)\n\n i,j,k = 0,0,0\n\n while (i < left.size and j < right.size) do\n if left[i] < right[j]\n arr[k] = left[i]\n i+=1\n else\n arr[k] = right[j]\n j+=1\n end\n k+=1\n end\n\n while i < left.size do\n arr[k] = left[i]\n i+=1\n k+=1\n end\n\n while j < right.size do\n arr[k] = right[j]\n j+=1\n k+=1\n end\n\n end\nend",
"def merge_sort(nums)\n len = nums.length\n return nums if len < 2\n mid_index = len / 2\n\n left_sorted = merge_sort(nums[0...mid_index])\n right_sorted = merge_sort(nums[mid_index...len])\n merge(left_sorted, right_sorted)\nend",
"def merge_sort(array)\n return [] if array.empty?\n return array if array.count == 1\n retu_arr = []\n left = array[0...(array.length/2)]\n right = array[(array.length/2)..-1]\n left_sort = merge_sort(left)\n right_sort = merge_sort(right)\n \n puts \"left sort is #{left_sort}\"\n puts \"right sort is #{right_sort}\"\n \n while left_sort.empty? == false && right_sort.empty? == false\n if left_sort.first < right_sort.first\n retu_arr << left_sort.shift\n else\n retu_arr << right_sort.shift\n end\n end\n if left_sort.empty? == false\n retu_arr.concat(left_sort)\n elsif right_sort.empty? == false\n retu_arr.concat(right_sort)\n end\n puts \"retu arr is : #{retu_arr}\"\n retu_arr\n\nend",
"def merge_sort(array)\r\n return array if array.length <= 1\r\n\r\n mid = array.length / 2\r\n\r\n left = merge_sort(array.take(mid)),\r\n right = merge_sort(array.drop(mid))\r\n merge(left, right)\r\nend",
"def merged_sort(arr)\n return arr if arr.length <= 1\n left_arr = arr[0...arr.length/2]\n right_arr = arr[arr.length/2..-1]\n \n combine(merged_sort(left_arr), merged_sort(right_arr))\nend",
"def merge_sort(array)\n return array if array.length <= 1\n mid = array.size / 2\n left = array[0...mid]\n right = array[mid..-1]\n sorted_left = merge_sort(left)\n sorted_right = merge_sort(right)\n return merge(sorted_left, sorted_right)\nend",
"def merge_sort(arr)\n return arr if arr.size < 2\n middle = arr.size / 2\n left = merge_sort(arr[0...middle])\n right = merge_sort(arr[middle..arr.size])\n merge(left, right)\n end",
"def merge_sort(arr)\n # [6]\n # arr[0] > arr[1]\n # arr[0], arr[1] = arr[1], arr[0]\n return arr if arr.length <= 1\n middle = arr.length / 2\n left = arr[0...middle]\n right = arr[middle..-1]\n a = merge_sort(left) \n b = merge_sort(right)\n merge(a,b)\nend",
"def merge_sort(arr)\n return arr if arr.length < 2\n middle = arr.length / 2\n half1 = arr[0...middle]\n half2 = arr[middle..-1]\n merge(merge_sort(half1), merge_sort(half2))\nend",
"def merge_sort(arr)\n \n midpoint = arr.size/2\n sub_list_a = arr[0, midpoint]\n sub_list_b = arr[(midpoint + 1)..(arr.size - 1)]\n \n sub_list_a = merge_sort(sub_list_a) \n sub_list_b = merge_sort(sub_list_b) \n \n merge(sub_list_a, sub_list_b)\n \nend",
"def mergesort(elements)\n\t#Base Case \n return elements if elements.size == 1\n\n #Divide \n mid = elements.size / 2\n left = elements[0, mid]\n right = elements[mid, elements.size]\n \n left_sorted = mergesort(left)\n right_sorted = mergesort(right)\n\n #Conquer\n merge(left_sorted,right_sorted)\nend",
"def merge(left, right)\n sorted = []\n while !left.empty? && !right.empty?\n if left.first[1] < right.first[1] || right.empty?\n if sorted.empty?\n sorted.push(left.shift)\n else\n left.first[0] > sorted.last[1] ? sorted.push(left.shift) : left.shift\n end \n elsif right.first[1] <= left.first[1] || left.empty?\n if sorted.empty?\n sorted.push(right.shift)\n else\n right.first[0] > sorted.last[1]? sorted.push(right.shift) : right.shift\n end\n end\n end\n right.each {|el| sorted.push(el) if el[0] > sorted.last[0]} if !right.empty?\n left.each {|el| sorted.push(el) if el[0] > sorted.last[0]} if !left.empty?\n sorted\nend",
"def merge_sort(arr)\n return arr if arr.length <= 1\n\n mid_idx = arr.length / 2 # this is really for breaking down the array into singletons\n left_side = arr[0...mid_idx]\n right_side = arr[mid_idx..-1]\n\n left = merge_sort(left_side)\n right = merge_sort(right_side)\n\n merge(left, right) # this does the actual sorting\nend",
"def merge_sort(array)\n return array if array.length <= 1\n middle = array.length / 2\n sorted_left = merge_sort(array[0...middle])\n sorted_right = merge_sort(array[middle..-1])\n merge(sorted_right, sorted_left)\nend",
"def merge_sort_two(array)\n size = array.size\n return array if size < 2\n\n ##Find the mid_point\n mid_point = size / 2\n\n ##Divide\n left = (array.slice(0, mid_point))\n right = (array.slice(mid_point, array.size)) ##the right part may be odd\n\n merge_two(merge_sort_two(left), merge_sort_two(right))\nend",
"def merge_sort(arr)\n return arr if arr.length <= 1\n first_half = arr[0...(arr.length / 2)]\n second_half = arr[(arr.length / 2)..-1]\n merge(merge_sort(first_half), merge_sort(second_half))\nend",
"def merge_sort(arr)\n cr_size = 1\n while cr_size <= arr.size - 1\n left = 0\n while left < arr.size - 1\n mid = [(left + cr_size - 1), (arr.size - 1)].min\n right = if (2 * cr_size + left - 1) < (arr.size - 1)\n 2 * cr_size + left - 1\n else\n arr.size - 1\n end\n arr[left..right] = merge(arr[left..mid], arr[mid+1..right])\n left += cr_size * 2\n end\n cr_size *= 2\n end\n arr\nend",
"def merge_sort(array)\n return array if array.length <= 1\n mid = array.length/2\n\n left = merge_sort(array[0...mid])\n right = merge_sort(array[mid..-1])\n\n merge(left, right)\nend",
"def merge_sort(array)\n return array if array.length <= 1\n mid = array.length / 2\n left = merge_sort(array[0...mid])\n right = merge_sort(array[mid..-1])\n merge(left, right)\nend",
"def merge_sort(array)\n if array.size <= 1\n return array\n end\n\n # Apply \"Divide & Conquer\" strategy\n\n # 1. Divide\n mid = array.size / 2\n part_a = merge_sort(array.slice(0, mid))\n part_b = merge_sort(array.slice(mid, array.size - mid))\n\n\n# 2. Conquer\n array = []\n offset_a = 0\n offset_b = 0\n while offset_a < part_a.count && offset_b < part_b.count\n a = part_a[offset_a]\n b = part_b[offset_b]\n \n if a <= b\n array << a\n offset_a += 1\n else\n array << b\n offset_b += 1\n end\n end\n \n while offset_a < part_a.count\n array << part_a[offset_a]\n offset_a += 1\n end\n \n while offset_b < part_b.count\n array << part_b[offset_b]\n offset_b += 1\n end\n \n return array\nend",
"def merge_sort(arr)\n return arr if arr.length < 2\n middle_index = arr.length / 2\n one_half = arr[0...middle_index]\n two_half = arr[middle_index..-1]\n merge(merge_sort(one_half), merge_sort(two_half))\nend",
"def merge_sort(arr)\n return arr if arr.size < 2\n middle = arr.size / 2\n # cut in half for sort selection\n arr1 = merge_sort(arr[0...middle])\n arr2 = merge_sort(arr[middle..-1])\n merge(arr1, arr2)\nend",
"def merge_sort( arr )\n return arr if arr.length == 1\n\n mid = arr.length / 2\n\n arr1 = merge_sort( arr[0...mid] )\n arr2 = merge_sort( arr[mid..-1] )\n\n sort_and_merge( arr1, arr2 )\nend",
"def mergesort(array)\n # Base case\n # There's nothing to sort.\n if array.length <= 1\n array \n\n else\n # Divide: keep splitting the array into left and right halves\n # until they're empty or of size 1\n middle = array.length / 2\n left = mergesort array[0, middle]\n right = mergesort array[middle, array.length - middle]\n\n # Conquer: merge the right and left into a new merged array by\n # comparing the first elements\n merged = []\n left_index = 0\n right_index = 0\n\n while left_index < left.length && right_index < right.length\n if left[left_index] <= right[right_index]\n merged << left[left_index]\n left_index += 1\n else\n merged << right[right_index]\n right_index += 1\n end\n end\n\n while left_index < left.length\n merged << left[left_index]\n left_index += 1\n end\n\n while right_index < right.length\n merged << right[right_index]\n right_index += 1\n end\n\n merged\n end\nend",
"def merge_sort(arr)\n n = arr.length\n return if n < 2 # base case for recursion\n mid = (n / 2).floor\n left = Array.new(mid)\n right = Array.new(n-mid)\n\n for i in 0..mid-1\n left[i] = arr[i]\n end\n for j in mid..n-1\n right[j] = arr[j]\n end\n\n merge_sort(left)\n merge_sort(right)\n merge(left, right, arr)\nend",
"def mergesort(array)\n # Base case\n if array.count <= 1\n return array\n end\n\n # Apply \"Divide & Conquer\" strategy\n # 1. Divide\n mid = array.count / 2\n left_partition = mergesort array.slice(0, mid)\n right_partition = mergesort array.slice(mid, array.count - mid)\n\n # 2. Conquer\n array = []\n left_lead = 0\n right_lead = 0\n while left_lead < left_partition.count && right_lead < right_partition.count\n a = left_partition[left_lead]\n b = right_partition[right_lead]\n\n # Take the smallest of the two, and push it on our array\n if a <= b\n array << a\n left_lead += 1\n else\n array << b\n right_lead += 1\n end\n end\n\n # Either left or right may have elements left; consume them.\n # (Only one of the following loops will actually be entered.)\n while left_lead < left_partition.count\n array << left_partition[left_lead]\n left_lead += 1\n end\n\n while right_lead < right_partition.count\n array << right_partition[right_lead]\n right_lead += 1\n end\n\n return array\nend",
"def merge_sort(array)\n return array if array.length == 1\n mid = (array.length - 1)/ 2\n left = array[0..mid]\n right = array[mid+1..array.length-1]\n merge(merge_sort(left), merge_sort(right))\nend",
"def merge_sort(array)\n return array if array.length == 1\n\n # Divide & conquer\n half1 = merge_sort(array[0..array.length/2 - 1])\n half2 = merge_sort(array[array.length/2..-1])\n\n # Initialize result array\n sorted = []\n \n while half1.length > 0 && half2.length > 0\n if half1[0] <= half2[0]\n sorted << half1.shift\n else\n sorted << half2.shift\n end\n end\n if half1.length > 0\n sorted.concat half1\n elsif half2.length > 0\n sorted.concat half2\n end\n \n return sorted\nend",
"def merge_sort(arr)\n if arr.length == 1\n return arr\n elsif arr.empty?\n return arr\n else\n first_half = merge_sort(arr[0..arr.length/2-1])\n second_half = merge_sort(arr[arr.length/2..-1])\n sorted_array = []\n idx_first = 0\n idx_second = 0\n until idx_first == first_half.length || idx_second == second_half.length\n if first_half[idx_first] < second_half[idx_second]\n sorted_array << first_half[idx_first]\n idx_first += 1\n elsif first_half[idx_first] > second_half[idx_second]\n sorted_array << second_half[idx_second]\n idx_second += 1\n end\n end\n\n if idx_first == first_half.length\n sorted_array += second_half[idx_second..-1]\n else sorted_array += first_half[idx_first..-1]\n end\n return sorted_array\n end\nend",
"def merge_sort(array)\n return array if array.length < 2\n\n midpoint = array.length / 2\n left = array[0...midpoint]\n right = array[midpoint..-1]\n\n return merge(merge_sort(left), merge_sort(right))\nend",
"def merge_sort(array)\n length_of_array = array.length\n\n if length_of_array < 2\n sorted_array = array\n return sorted_array\n end\n\n array_half_a = array.slice(0, (length_of_array.to_f / 2).round)\n array_half_b = array.slice((length_of_array.to_f / 2).round, length_of_array / 2)\n sorted_array_a = merge_sort(array_half_a)\n sorted_array_b = merge_sort(array_half_b)\n merged_sorted_array = []\n index_array_a = 0\n index_array_b = 0\n\n while index_array_a < sorted_array_a.length && index_array_b < sorted_array_b.length\n if sorted_array_a[index_array_a] < sorted_array_b[index_array_b]\n merged_sorted_array << sorted_array_a[index_array_a]\n index_array_a += 1\n else\n merged_sorted_array << sorted_array_b[index_array_b]\n index_array_b += 1\n end\n end\n\n merged_sorted_array += if index_array_a == sorted_array_a.length\n sorted_array_b.slice(index_array_b, sorted_array_b.length)\n else\n sorted_array_a.slice(index_array_a, sorted_array_a.length)\n end\n\n merged_sorted_array\nend",
"def merge_sort(array=@base)\n return array if array.size < 2\n mid = array.size/2\n left = array[0..mid-1]\n right = array[mid..-1]\n\n left_merge = merge_sort(left)\n right_merge = merge_sort(right)\n merge_sort_merge(left_merge, right_merge)\n end",
"def merge_sort(array) # ***\n return array if array.length <= 1\n mid_idx = (array.length - 1) / 2\n\n first_half = merge_sort(array[0..mid_idx])\n second_half = merge_sort(array[mid_idx + 1..-1])\n\n merge(first_half, second_half)\n # merge(merge_sort(array[0..mid_idx]), merge_sort(array[mid_idx + 1..-1]))\nend",
"def merge_sort(array)\n return array if array.length <= 1\n\n mid_point = array.length / 2\n\n left_hand = merge_sort(array.take(mid_point))\n right_hand = merge_sort(array.drop(mid_point))\n\n merge_sort_compare(left_hand, right_hand)\n #left_hand + right_hand\nend",
"def merge_sort(array)\n return array if array.size <= 1\n mid = array.size / 2\n left = array[0...mid]\n right = array[mid...array.size]\n merge(merge_sort(left), merge_sort(right))\nend",
"def merge_sort(array)\r\n\tif array.length > 1\r\n\t\tleft_array = []\r\n\t\t\t(array.length/2).times { left_array << array.shift }\r\n\t\tright_array = array\r\n\t\tleft_sorted = merge_sort(left_array)\r\n\t\tright_sorted = merge_sort(right_array)\r\n\t\tresult = []\r\n\t\twhile left_sorted.length>0 && right_sorted.length>0\r\n\t\t\tif left_sorted[0] <= right_sorted[0]\r\n\t\t\t\tresult << left_sorted.shift\r\n\t\t\telse\r\n\t\t\t\tresult << right_sorted.shift\r\n\t\t\tend\r\n\t\tend\r\n\t\tif left_sorted.length>0\r\n\t\t\tleft_sorted.each { |e| result << e }\r\n\t\telsif right_sorted.length>0\r\n\t\t\tright_sorted.each { |e| result << e }\r\n\t\tend\r\n\t\treturn result\r\n\telse\r\n\t\treturn array\r\n\tend\r\nend",
"def merge_sort(array)\n return array if array.length < 2\n midpoint = array.length / 2\n merge(merge_sort(array[0...midpoint]), merge_sort(array[midpoint..-1]))\nend",
"def merge_sort(arr)\n return arr if arr.length <= 1\n # define middle element where array will be split\n case arr.length % 2 == 0\n when true\n middle_index = (arr.length - 1) / 2\n when false\n middle_index = arr.length / 2\n end\n\n left_half = arr[0..middle_index]\n right_half = arr[middle_index + 1..-1]\n sorted_left = merge_sort(left_half)\n sorted_right = merge_sort(right_half)\n merge(sorted_left, sorted_right)\nend",
"def merge_sort(arr)\n return arr if arr.length == 1\n\n half_idx = arr.length / 2\n first_half = arr[0...half_idx]\n second_half = arr[half_idx..-1]\n\n merge(merge_sort(first_half), merge_sort(second_half))\nend",
"def mergesort(array)\n if array.count <= 1\n # Array of length 1 or less is always sorted\n return array\n end\n\n # Apply \"Divide & Conquer\" strategy\n\n # 1. Divide\n mid = array.count / 2\n part_a = mergesort array.slice(0, mid)\n part_b = mergesort array.slice(mid, array.count - mid)\n\n # 2. Conquer\n array = []\n offset_a = 0\n offset_b = 0\n while offset_a < part_a.count && offset_b < part_b.count\n a = part_a[offset_a]\n b = part_b[offset_b]\n # Take the smallest of the two, and push it on our array\n if a <= b\n array << a\n offset_a += 1\n else\n array << b\n offset_b += 1\n end\n end\n\n # There is at least one element left in either part_a or part_b (not both)\n while offset_a < part_a.count\n array << part_a[offset_a]\n offset_a += 1\n end\n\n while offset_b < part_b.count\n array << part_b[offset_b]\n offset_b += 1\n end\n\n return array\nend",
"def merge_sort(array)\n return array if array.length == 1\n\n mid_index = array.length / 2\n end_index = array.length - 1\n\n left_half = array[0..mid_index - 1]\n right_half = array[mid_index..end_index]\n\n left_half_sorted = merge_sort(left_half)\n right_half_sorted = merge_sort(right_half)\n\n sorted = []\n until left_half_sorted.empty? || right_half_sorted.empty?\n sorted << (left_half_sorted.first < right_half_sorted.first ? left_half_sorted.shift : right_half_sorted.shift)\n end\n sorted + left_half_sorted + right_half_sorted\nend",
"def mergesort(array)\n\t# Base case\n if array.length < 2\n array\n else\n \tleft = mergesort array[0 .. array.length/2 - 1]\n \tright = mergesort array[array.length/2 .. array.length - 1]\n\n \tmerge left, right\n end\nend",
"def mergesort(array)\n if array.count <= 1\n # Array of length 1 or less is always sorted\n return array\n end\n\n # Apply \"Divide & Conquer\" strategy\n\n # Divide\n mid = array.count / 2\n part_a = mergesort array.slice(0, mid)\n part_b = mergesort array.slice(mid, array.count - mid)\n\n # Conquer\n array = []\n offset_a = 0\n offset_b = 0\n while offset_a < part_a.count && offset_b < part_b.count\n a = part_a[offset_a]\n b = part_b[offset_b]\n\n # Take the smallest of the two, and push it on our array\n if a <= b\n array << a\n offset_a += 1\n else\n array << b\n offset_b += 1\n end\n end\n\n # There is at least one element left in either part_a or part_b (not both)\n while offset_a < part_a.count\n array << part_a[offset_a]\n offset_a += 1\n end\n\n while offset_b < part_b.count\n array << part_b[offset_b]\n offset_b += 1\n end\n\n return array\nend",
"def MergeSort(a)\n if a.length <= 1\n return a\n end\n middle = a.length/2\n left = a[0..middle-1]\n right = a[middle..-1]\n\n left = MergeSort(left)\n right = MergeSort(right)\n sorted_array = merge(left,right)\nend",
"def merge_sort(arr)\n return arr if arr.length < 2\n middle_index = arr.length / 2\n left_arr = merge_sort(arr[0...middle_index])\n right_arr = merge_sort(arr[middle_index..-1])\n merge_fn(left_arr,right_arr)\nend",
"def merge_sort arr\n\tif arr.length <= 1\n\t\tarr\n\telse\n\t\tmid = arr.length/2\n\t\tfirst_half = arr.slice(0...mid)\n\t\tsecond_half = arr.slice(mid...arr.length)\n\t\tmerge merge_sort(first_half), merge_sort(second_half)\n\tend\nend",
"def merge_sort array\n size = array.size\n if size < 2\n array\n else\n merge_array = array.each_slice((size/2.0).round).to_a\n array_a = merge_sort(merge_array[0])\n array_b = merge_sort(merge_array[1])\n new_array = []\n a = 0\n b = 0\n while new_array.size != size\n if array_a.nil? || array_a[a].nil?\n return new_array += array_b[b..-1]\n elsif array_b.nil? || array_b[b].nil?\n return new_array += array_a[a..-1]\n elsif array_a[a] < array_b[b]\n new_array << array_a[a]\n a += 1\n else\n new_array << array_b[b]\n b += 1\n end\n end\n end\nend",
"def merge_sort(arr)\n return arr if arr.size == 1 #the last element, return array itself to end the recursion\n mid = arr.size / 2\n left_arr = arr[0...mid]\n right_arr = arr[mid..-1]\n merge(merge_sort(left_arr), merge_sort(right_arr))\nend",
"def merge_sort(array)\n # we split the array into 1 element long arrays\n return array if array.length <= 1\n\n mid = array.length / 2\n left = merge_sort(array[0..mid - 1])\n right = merge_sort(array[mid..-1])\n # once we have 1 element long arrays we start merging them\n if left.last <= right.first\n left + right\n else\n merge(left, right)\n end\n end",
"def merge_sort(arr)\n return arr if arr.length < 2\n\n arr1 = merge_sort(arr.take(arr.length/2))\n arr2 = merge_sort(arr.drop(arr.length/2))\n\n return merge(arr1,arr2)\nend",
"def merge_sort(arr)\n return arr if arr.length <= 1\n\n if arr.length.odd?\n mid_idx = arr.length / 2\n else\n mid_idx = arr.length / 2 - 1\n end\n\n first_half = arr[0..mid_idx]\n second_half = arr[mid_idx + 1..-1]\n\n fh_split = merge_sort(first_half)\n sh_split = merge_sort(second_half)\n\n merge(fh_split, sh_split)\nend",
"def merge_sort(array)\n\treturn [] if array.length == 0\n\treturn array if array.length == 1\n\n\tmidpoint = array.length / 2\n\tleft_side = array[0..midpoint].take(midpoint)\n\tright_side = array.drop(midpoint)\n\n\tmerge(merge_sort(left_side), merge_sort(right_side))\n\t# merge_sort(merge(left_side, right_side))\n\nend",
"def merge_sort(array)\n return array if array.size == 1\n left_array,right_array = array.each_slice( (array.size/2.0).round ).to_a\n arr1 = merge_sort(left_array)\n arr2 = merge_sort(right_array)\n arr = merge(arr1, arr2)\n arr\nend",
"def mergesort(array = @array)\n if array.length < 2\n return array\n end\n left_array = mergesort(array[0, array.length/2])\n right_array = mergesort(array[array.length/2, array.length])\n\n new_array = merge(left_array, right_array)\n return new_array\n end",
"def merge_sort(array)\n return array if array.length == 1\n mid = array.length / 2\n merge(merge_sort(array[0..mid -1]), merge_sort(array[(mid)..-1]))\nend",
"def merge_sort(array)\n return array if array.length == 1 #Base case\n mid = array.length / 2 #Splits the array into half\n left_side = array[0..mid-1] #Splits the original array into 2\n right_side = array[mid..-1] #Splits original into 2 separate arrays\n l = merge_sort(left_side) #Splits into multiple arrays (RECURSIVE)\n r = merge_sort(right_side) #Splits into multiple arrays (RECURSIVE)\n merge(l, r)\nend",
"def merge_sort(array)\n \n middle = array.length/2-1\n left = [0..middle]\n right = [middle+1..[-1]]\n merge_sort(left) + merge_sort(right)\nend",
"def merge_sort(lst)\n if lst.length <= 1\n lst\n else\n mid = (lst.length / 2).floor\n left = merge_sort(lst[0..mid - 1])\n right = merge_sort(lst[mid..lst.length])\n merge(left, right)\n end\nend",
"def merge_sort(nums)\n # Base case, no sorting to do on a single element, collapses recursion branch\n return nums if nums.length <= 1\n # Divide\n a = nums[0..(nums.length/2)-1]\n b = nums[(nums.length/2)..-1]\n # Conquer\n result = merge(merge_sort(a), merge_sort(b))\nend",
"def merge_sort(array)\n return [] if array.length == 0\n return array if array.length == 1\n middle_idx = array.length / 2\n arr_1 = array[0...middle_idx]\n arr_2 = array[middle_idx..-1]\n merge(merge_sort(arr_1), merge_sort(arr_2))\nend",
"def merge(left, right)\n sorted = []\n until left.empty? || right.empty? # I added the two lengths together to countdown index\n if left.first <= right.first # This is not valid per instructions. mutates.\n sorted << left.shift \n else\n sorted << right.shift\n end\n end\n sorted.concat(left).concat(right)\nend",
"def merge_sort(collection)\n if collection.length <= 1\n collection\n else\n mid = (collection.length / 2).floor\n left = merge_sort(collection[0..mid - 1])\n right = merge_sort(collection[mid..collection.length])\n merge(left, right)\n end\n end",
"def merge_sort list\n midpoint = list.length/2\n\n if list.length < 2\n return list\n else\n list_left = list[0..(midpoint - 1)]\n list_right = list[midpoint..-1]\n\n list_left = merge_sort(list_left)\n list_right = merge_sort(list_right)\n\n return result = merge_lists(list_left, list_right)\n end\nend",
"def merge_sort(numbers)\n return numbers if numbers.size == 1\n mid = numbers.size / 2\n left = numbers[0...mid]\n right = numbers[mid..-1]\n merge(merge_sort(left), merge_sort(right))\nend",
"def merge_sort(numbers)\n return numbers if numbers.size == 1\n mid = numbers.size / 2\n left = numbers[0...mid]\n right = numbers[mid..-1]\n merge(merge_sort(left), merge_sort(right))\nend",
"def merge_arr(left, right)\n # puts \"left: #{left}, right: #{right}\"\n left ||= []\n right ||= []\n res = []\n \n loop do\n res += right and break if left.empty?\n res += left and break if right.empty?\n \n if left.first <= right.first\n res << left.shift\n else\n res << right.shift\n end\n end\n \n res\nend",
"def merge_sort(&prc)\n prc || = proc { |num1, num2| num1 <=> num2 }\n return self if length <= 1\n mid = length / 2\n left = self.take(mid).merge_sort(&prc)\n right = self.drop(mid).merge_sort&prc)\n Array.merge(left, right, &prc)\nend",
"def merge_sort(list)\n if list.length <= 1\n list\n else\n mid = (list.length / 2).floor\n left = merge_sort(list[0..mid - 1])\n right = merge_sort(list[mid..list.length])\n merge(left, right)\n end\nend",
"def mergeSortHelper(ia, left, right)\n if(left < right)\n mid = ((left + right) / 2).to_i\n\n mergeSortHelper(ia, left, mid)\n mergeSortHelper(ia, mid + 1, right)\n\n merge(ia, left, mid, right)\n end\nend",
"def mergeSort(arr,l,r)\n # Merges two subarrays of arr[].\n # First subarray is arr[l..m]\n # Second subarray is arr[m+1..r]\n def merge(arr, l, m, r)\n n1 = m - l + 1\n n2 = r- m\n \n # create temp arrays\n aL = Array.new(n1, 0)\n aR = Array.new(n2, 0)\n \n # Copy data to temp arrays L[] and R[]\n for i in 0..n1\n aL[i] = arr[l + i]\n end\n \n for j in 0..n2\n aR[j] = arr[m + 1 + j]\n end\n \n # Merge the temp arrays back into arr[l..r]\n i = 0 # Initial index of first subarray\n j = 0 # Initial index of second subarray\n k = l # Initial index of merged subarray\n \n while i < n1 and j < n2 do\n if aL[i] <= aR[j] then\n arr[k] = aL[i]\n i += 1\n else\n arr[k] = aR[j]\n j += 1\n end\n k += 1\n end\n \n # Copy the remaining elements of L[], if there\n # are any\n while i < n1 do\n arr[k] = aL[i]\n i += 1\n k += 1\n end\n \n # Copy the remaining elements of R[], if there\n # are any\n while j < n2 do\n arr[k] = aR[j]\n j += 1\n k += 1\n end\n end # merge \n \n # l is for left index and r is right index of the\n # sub-array of arr to be sorted\n if l < r then\n # Same as (l+r)/2, but avoids overflow for\n # large l and h\n m = (l+(r-1))/2\n\n # Sort first and second halves\n mergeSort(arr, l, m)\n mergeSort(arr, m+1, r)\n merge(arr, l, m, r)\n end\n return arr\n end",
"def merge_sort(array)\n middle_index = (array.length - 1) / 2\n if array.length == 0 || array.length == 1\n return array\n end\n first_half = merge_sort(array[0..middle_index])\n last_half = merge_sort(array[middle_index + 1..array.length - 1])\n return merge(first_half, last_half)\nend",
"def merge(left, right)\n sorted = []\n while [left, right].none?(&:empty?)\n sorted << (compare(left[0], right[0]) ? left.shift : right.shift)\n end\n sorted + left + right\nend",
"def merge(left, right)\n results = []\n\n while (left.length > 0 && right.length > 0)\n if (left[0] < right[0])\n results.push( left.shift() )\n else\n results.push( right.shift() )\n end\n end\n # return a new array. Take everything in results and add it to the array.\n # Take everything in left and add them in.\n # Take everything in right and add them as well.\n # One array will be empty after while loop finishes\n return [*results, *left, *right]\nend",
"def sort_merge(a, b)\n return a if (b.length==0)\n left=a.length-b.length-1\n right=b.length\n current=a.length-1\n \n \n while(left>=0 && right>=0){\n if a[left]>b[right]\n a[current]=a[left]\n left-=1\n \n else \n a[current]=a[right]\n right-=1\n end\n current-=1;\n end\n \n while(right>=0)\n a[current]=a[right]\n right-=1\n current-=1\n end \nend",
"def mergesort(array)\n if array.count <= 1\n return array\n end \n middle = array.count/2 \n return merge(mergesort(array[0, middle]), mergesort(array[middle, array.count]))\nend",
"def merge_sort(array)\n return array if array.length <= 1\n middle = array.length / 2\n merge(merge_sort(array[0...middle]), merge_sort(array[middle..-1]))\nend",
"def merge_sort(array)\n\tif array.length <= 1\n\t\treturn array\n\telse\n\t\tmiddle = (array.length/2).floor\n\t\tleft = array[0...middle]\n\t\tright = array[middle...array.length]\n\t\treturn merge(merge_sort(left), merge_sort(right));\n\tend\nend",
"def merge left, right\n result = []\n until (left + right).empty?\n begin\n result << left.shift if left[0] <= right[0]\n result << right.shift if left[0] > right[0]\n rescue\n result << right.shift if left.empty? && !right.empty?\n result << left.shift if right.empty? && !left.empty?\n end\n end\n result\nend",
"def mergeSort(arr)\r\n # if we have an array that only contains one element or nothing, theres nothing to sort then\r\n if(arr == nil)\r\n return []\r\n end\r\n if(arr.length <= 1)\r\n return arr # simply just return what we got\r\n else\r\n # else we have an array that is sortable, split up the arrays down the midpoint and send them into the driver function\r\n midpoint = arr.length/2\r\n half1 = mergeSort(arr.slice(0...midpoint))\r\n half2 = mergeSort(arr.slice(midpoint...arr.length))\r\n mergeHelper(half1,half2)\r\n end\r\n\r\n end",
"def merge_sort(array)\n\treturn array if array.length <= 1\n\tmidpoint = (array.length / 2)\n\thalf1 = array[0...midpoint]\n\thalf2 = array[midpoint..-1]\n\tmerge(merge_sort(half1), merge_sort(half2))\nend"
] |
[
"0.90674186",
"0.90447277",
"0.8975917",
"0.8961295",
"0.89249915",
"0.8922382",
"0.8916301",
"0.8897854",
"0.88973314",
"0.8884182",
"0.88831365",
"0.88764215",
"0.88762003",
"0.88667613",
"0.8866313",
"0.88596076",
"0.8856798",
"0.8856418",
"0.8829725",
"0.8820784",
"0.8814086",
"0.8773473",
"0.87687093",
"0.8766771",
"0.87431514",
"0.8732346",
"0.8708999",
"0.8706619",
"0.86903816",
"0.8687861",
"0.86873835",
"0.8679457",
"0.86698014",
"0.8667721",
"0.8667553",
"0.86633646",
"0.864817",
"0.8647296",
"0.8642873",
"0.86303973",
"0.8617328",
"0.8610916",
"0.8603739",
"0.85909873",
"0.85880625",
"0.8587413",
"0.8584357",
"0.85811424",
"0.8572474",
"0.8571123",
"0.85690624",
"0.85561335",
"0.8551081",
"0.8550018",
"0.85389984",
"0.8532427",
"0.8527032",
"0.8524991",
"0.85245985",
"0.85174406",
"0.85131705",
"0.8496951",
"0.849242",
"0.8489845",
"0.84856707",
"0.8482815",
"0.8457685",
"0.8445676",
"0.8443302",
"0.8441645",
"0.84380543",
"0.84324926",
"0.8431385",
"0.8429356",
"0.8429058",
"0.8423097",
"0.84148604",
"0.84130234",
"0.84116185",
"0.84037477",
"0.83993757",
"0.8396101",
"0.8393622",
"0.838795",
"0.83875775",
"0.83875775",
"0.8377952",
"0.8374875",
"0.8365109",
"0.8364174",
"0.8362995",
"0.8360146",
"0.834911",
"0.83404595",
"0.83389753",
"0.8337553",
"0.8333363",
"0.8324752",
"0.83114433",
"0.83080864",
"0.82991"
] |
0.0
|
-1
|
Calculate the numerical identifier of the report based on the 01/06/2020 report, which was 91
|
def day_identifier
day_baseline = Date.parse("2020-06-01")
number_baseline = 91
baseline_shift = date.mjd - day_baseline.mjd
number_baseline + baseline_shift
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def ref_number\n batch = check.batch\n facility_name = facility.name.upcase\n if (facility_name == 'AHN' || facility_name == 'SUBURBAN HEALTH' ||\n facility_name == 'UWL' || facility_name == 'ANTHEM')\n file_number = batch.file_name.split('_')[0][3..-1] rescue \"0\"\n date = batch.date.strftime(\"%Y%m%d\")\n \"#{date}_#{file_number}\"\n else\n (batch.batchid.include?(\"AH\") ? batch.batchid : batch.date.strftime(\"%Y%m%d\"))\n end\n end",
"def calculate_invoice_identifier\n invoice_array = Invoice.where(year: Time.now.strftime(\"%Y\").to_i, category: @event.category)\n return 1 if invoice_array.empty?\n latest_identifier = invoice_array.last.invoice_identifier\n latest_identifier + 1\n end",
"def ref_number\n if ['AHN', 'SUBURBAN HEALTH', 'UWL', 'ANTHEM'].include?(@facility_name)\n file_number = @batch.file_name.split('_')[0][3..-1] rescue \"0\"\n date = @batch.date.strftime(\"%Y%m%d\")\n \"#{date}_#{file_number}\"\n else\n (@batch.batchid.include?(\"AH\") ? @batch.batchid : @batch.date.strftime(\"%Y%m%d\"))\n end\n end",
"def refere_based_on_diput\n yy = self.starting_at.year\n mm = self.starting_at.month\n if yy >= 2000\n yy = yy - 2000\n end\n if yy > 1900\n yy = yy - 1900\n end\n diput = !self.subscriber.blank? ? self.subscriber.diput : self.client.diput\n (yy * 10000000000) + (mm * 100000000) + diput.to_i\n end",
"def generate_number(isofferte)\n return id if isofferte.to_i == 1\n\n # TODO: scope per firm here!\n last_invoice = Invoice.order('number').last\n\n self.number = if last_invoice\n last_invoice.number + 1\n else\n # generate invoice nr based on year+month\n \"#{Time.new.strftime('%Y%m')}0001\".to_i\n end\n end",
"def si_next_no(company, posted_at)\n code = ''\n year = posted_at.year\n company = company.to_s if company.is_a? Fixnum\n company = company.rjust(3, '0')\n year = year.to_s if year.is_a? Fixnum\n year = year.rjust(4, '0')\n last_no = SupplierInvoice.where(\"internal_no LIKE ?\", \"#{company}#{year}%\").order(:internal_no).maximum(:internal_no)\n if last_no.nil?\n code = company + year + '000001'\n else\n last_no = last_no[7..12].to_i + 1\n code = company + year + last_no.to_s.rjust(6, '0')\n end\n code\n end",
"def bib_number\n get_id_from_lane_assignment(competition, heat, lane) || 0\n end",
"def invoice_identifier(project)\n short_month_name = \"-\" + Date::MONTHNAMES[Date.current.next_month.month].slice(0,3).upcase || \"\"\n if project.perQuarter\n quarter = ((Date.current.month / 12.0) * 4.0).floor + 1\n if quarter == 5\n quarter = 1\n end\n short_month_name = \"-Q#{quarter}\"\n end\n \"#{initials}#{id}-#{project.id}#{short_month_name}\"\n end",
"def get_spreadsheet_id(date_time)\n month = date_time.strftime(\"%m\").to_i\n year = date_time.strftime(\"%Y\").to_i\n id = Spreadsheet.get_id_by_date(month, year)\n return id\nend",
"def get_number_with_year\n receipt_num.to_s + \" / \" + get_date_receipt().strftime(\"%Y\")\n end",
"def identifier\n time.ymdHMS\n end",
"def identifier\n \"##{id} - #{area_code} #{end_year} (#{created_at.strftime(\"%m-%d %H:%M\")})\"\n end",
"def hash\n\t\t\"#{@year}#{@month}\".to_i\n\tend",
"def create\n @org_reports= current_user.organization.statusreports(:order=>'created_at ASC')\n @org_last_report=@org_reports.find(:last)\n if !@org_reports.blank? && !@org_last_report.blank?\n y= @org_last_report.report_number.gsub!(\"SR-\",\"\")\n puts \"###\"\n m=y.to_i\n m = m +1\n x = (\"SR-%0.4d\" %m.to_i).to_s\n puts x\n params[:statusreport][:report_number] = x\n @statusreport = Statusreport.new(params[:statusreport])\n @statusreport.organization = current_user.organization\n else\n m = 1\n x = (\"SR-%0.4d\" %m.to_i).to_s\n puts x\n params[:statusreport][:report_number] = x\n @statusreport = Statusreport.new(params[:statusreport])\n @statusreport.organization = current_user.organization\n end\n #for changing the default date format\n @statusreport.report_date = change_date_format(params[:statusreport][:report_date]) if !(params[:statusreport][:report_date]).blank?\n respond_to do |format|\n if @statusreport.save\n format.html { redirect_to @statusreport, notice: 'Statusreport was successfully created.' }\n format.json { render json: @statusreport, status: :created, location: @statusreport }\n else\n format.html { render action: \"new\" }\n format.json { render json: @statusreport.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ticket_number(accounting_element)\n\t \taccounting_element[:document_info][:document][:@number]\n\t end",
"def south_african_close_corporation_registration_number; end",
"def report_timestamp(report)\n return unless report &. last_occurrence\n tz = CSPReports.time_zone\n tz.utc_to_local(report.last_occurrence).strftime(CSPReports.timestamp_format)\n end",
"def post_year\n chars = @date.split('')\n chars.pop(4).join('').to_i\n end",
"def day_number_of_the_year day, month, hash \n if month > 1\n for i in 1...month\n day += hash[i]\n end\n end\n day\nend",
"def identifier\n num\n end",
"def daily_report\n report = self.file_content.lines[self.report_line..-1]\n last_line = report.find_index{|l| l.match(/‡CRC/) }\n report[0..last_line].join\n end",
"def real_no\n invoices.first.full_no rescue full_no\n end",
"def date\n dreport.date_format\n end",
"def assign_control_doc_number\n\t\tself.control_doc_number = Time.now.strftime(\"%Y\") + \"/\" + Time.now.to_i.to_s\n\t\tself.control_doc_number\n\tend",
"def calculate_invoice\n @event.category == \"bill\" ? \"Bill-#{Time.now.strftime(\"%Y\")}/1\" : \"Quotation-#{Time.now.strftime(\"%Y\")}/1\"\n end",
"def magic_number(date)\n # get the stock price for Anheuser-Busch inbev\n data = YahooFinance::Client.new.historical_quotes(\n 'BUD', start_date: date\n ).first\n data.open.chars.map(&:to_i).reduce(:+) +\n data.close.chars.map(&:to_i).reduce(:+) +\n date.day\n end",
"def number\n @number ||= respond_to?(:parliamentPeriodNumber) ? parliamentPeriodNumber.to_i : nil\n end",
"def DoR1(period)\n retval = '' # what we return\n accum = Hash.new() # where we accumulate data to report\n\n # get a list of VTRs between these dates and make a hash of the formNote\n rows = Vtr.where(\"date(date) between ? and ?\", period['lodate'].to_s(:db), period['hidate'].to_s(:db))\n rows.each do |row|\n k = row['formNote']\n accum[k] = 0 if accum[k].nil?\n accum[k] += 1\n end\n\n retval = accum.inspect\n end",
"def south_african_id_number; end",
"def south_african_listed_company_registration_number; end",
"def notification_document_name\n \"notification-report_#{external_id}_#{Time.now.utc.strftime('%Y%m%d%k%M%S')}\"\n end",
"def build_number\n @build_number ||= history['builds'].first['build_number'].to_s\n end",
"def number\n # TODO have this be our order id \n #CGI::Session.generate_unique_id\n mydate = Date.today().strftime('%Y%m%d')\n \"#{self.user.last_name}_#{mydate}_#{self.id}\"\n end",
"def serial_no\n [doc_series, doc_no].join(' ')\n end",
"def calculate_worktype_distribution(report_date, team_id = '*')\n\n if report_date then\n month = get_month_beg_end(report_date)\n begda = month[:first_day]\n endda = month[:last_day]\n else\n begda = Date::strptime('1900-01-01')\n endda = Date::strptime('9999-12-31')\n end\n \n #Find the date of the last BW upload for the given period\n last_report_date = Projecttrack::maximum('reportdate', :conditions => [\"yearmonth <= ? and yearmonth >= ?\",endda, begda]) \n \n #Calculate the days booked from the last BW data set\n tracks = Projecttrack::find(:all, :conditions => [\"yearmonth <= ? and yearmonth >= ? and reportdate = ?\",endda, begda, last_report_date])\n\n wt_distrib = {}\n\n tracks.each do |track|\n if (team_id == '*') or (track.team_id.to_s == team_id.to_s) then\n wt = Project.find_by_id(track.project_id).worktype_id\n if wt_distrib[wt].nil?\n wt_distrib[wt] = { :daysbooked => track.daysbooked }\n else\n\t wt_distrib[wt][:daysbooked] = wt_distrib[wt][:daysbooked] + track.daysbooked \n end\n end\n end\n return wt_distrib\n end",
"def company_number\n 1\n end",
"def get_pr_identifier(branch_name)\n puts \"Resolving PR identifier for: #{branch_name}\"\n return 0 if branch_name.nil? || (branch_name.include? 'master')\n\n branch_name.split('/')[0].to_i\nend",
"def polish_taxpayer_identification_number; end",
"def experiment_no\r\n @db_client.scheme(\r\n database: series.database,\r\n measurement: series.measurement,\r\n tag: 'exn'\r\n ).last.to_i + 1\r\n end",
"def extract_id_uri\n @id_uri = @meta.at_xpath('./a:identification/a:FRBRWork/a:FRBRuri', a: NS)['value']\n empty, @country, @nature, date, @num = @id_uri.split('/')\n\n # yyyy-mm-dd\n @year = date.split('-', 2)[0]\n end",
"def check_elsewhere(field264c, field260c)\n date = field264c || field260c\n # Take the first four digits.\n match = /(\\d{4})/.match(date)\n match[1].to_i if match\n end",
"def swedish_organisation_number; end",
"def index_to_day_num(index)\n check_pre((\n (index.int?)\n ))\n\n return index + 1\nend",
"def payer_id\n payer = @first_check.payer\n payer_type = payer.payer_type if payer\n output_config = @facility.output_config(payer_type)\n @payid = case output_config.grouping\n when 'By Check'\n @first_check.supply_payid if @first_check\n when 'By Payer','By Payer Id'\n payer_wise_payer_id(output_config)\n when 'By Batch', 'By Batch Date', 'By Cut'\n generic_payer_id(output_config)\n end\n end",
"def idsr_monthly_summary\n @report_name = 'IDSR Monthly Summary'\n @logo = CoreService.get_global_property_value('logo').to_s\n @current_location_name =Location.current_health_center.name\n @obs_start_year = Observation.first.obs_datetime.year\n\n render :layout => 'report'\n end",
"def id\n (published_at.to_date.to_s(:db).gsub('-','') + published_at.min.to_s + published_at.sec.to_s).to_i\n end",
"def payer_id\n payer_of_first_check = checks.first.payer\n job = checks.first.job\n payer_type = job.payer_group if !job.blank?\n output_config = facility.output_config(payer_type)\n case output_config.grouping\n when 'By Check'\n payer_of_first_check.supply_payid if payer_of_first_check\n when 'By Payer','By Payer Id'\n payer_wise_payer_id(output_config)\n when 'By Batch', 'By Batch Date', 'By Cut'\n generic_payer_id(output_config)\n end\n end",
"def rmr_scan_date_enroll_collection\n \"#{self.rmr} # #{self.scan_number} #{Date.strptime(self.date.to_s).strftime('%m/%d/%Y')} -- #{self.enrollments.collect {|e| e.enumber }.join(\", \")}\"\n end",
"def claim_number\n str = eob.check_information.check_number.to_s if eob.check_information\n (str += '_' + eob.claim_number) if !eob.claim_number.blank?\n str\n end",
"def order_number\n if (not self.id)\n return \"save to allocate number\"\n end\n base = Time.new().strftime(\"%Y\")\n return base + \"_\" + self.id.to_s\n end",
"def get_this_one(number)\n case @conditions[:breakdown_type]\n when \"Weekly\"\n @start_date + (7*number)\n when \"Quarterly\"\n d = @start_date.to_s.split(\"-\").map{|x| x.to_i}\n number.times{|x|\n d = increase_arr(d)\n }\n Date.parse(d.map{|x| x.to_s}.join(\"-\"))\n when \"Daily w/weekends\" # NOT ACTUALLY used.\n @start_date + number\n when \"Daily\"\n date = @start_date + number\n if [0,1].include?(date.wday) # MEEP. the hard coded sunday and monday are *HORRIBLE*\n return nil\n else\n return date\n end\n when \"Yearly\"\n Date.parse((@start_date.year + number).to_s + \"-01-01\")\n when \"Monthly\"\n month = @start_date.month\n year = @start_date.year\n month += number\n while month > 12\n year += 1\n month -= 12\n end\n Date.parse(\"#{year}-#{month}-01\")\n else\n raise NoMethodError\n end\n end",
"def week_number\n\t\tWeek.find(week_id).week_number\n\tend",
"def medical_record_number\n return medical_identifiers.first.medical_record_number if medical_identifiers.size == 1\n end",
"def idade\n if nascimento != nil\n now = Time.now.utc.to_date\n now.year - nascimento.year - ((now.month > nascimento.month || (now.month == nascimento.month && now.day >= nascimento.day)) ? 0 : 1)\n else\n '--'\n end \n end",
"def day_stats\n days = Array.new(7){0}\n @file.each do |line|\n date = line[:regdate].split(\" \")\n date = Date.strptime(date[0],\"%m/%d/%y\")\n days[date.wday.to_i] += 1\n end\n days.each_with_index{ |counter, days| puts \"#{days}: #{counter}\"}\n\n end",
"def full_no\n # Debt claim no (Office & year & sequential number) => OOOO-YYYY-NNNNN\n if claim_no == \"$err\"\n \"0000-0000-00000\"\n else\n claim_no.blank? ? \"\" : claim_no[0..3] + '-' + claim_no[4..7] + '-' + claim_no[8..12]\n end\n end",
"def numid; end",
"def to_i\n year * 100 + month\n end",
"def issue_number\n issue_url[/\\d+\\Z/].to_i\n end",
"def real_batch_id\r\n begin\r\n if self.batchid.include?(\"_\")\r\n batch_id_array = self.batchid.split('_')\r\n if batch_id_array.last.to_s.match(/^\\d{8}$/)\r\n Date.strptime(batch_id_array.last, \"%m%d%Y\")\r\n self.batchid[0...-9]\r\n else\r\n self.batchid\r\n end\r\n else\r\n self.batchid\r\n end\r\n rescue\r\n self.batchid\r\n end\r\n end",
"def roman_count(date)\n date[3]\n end",
"def reference_document\n if document.blank?\n \"None Assigned\"\n else\n document.refno+\" : \"+document.title+\" : dated \"+document.letterdt.strftime(\"%d-%b-%Y\").to_s\n end\n end",
"def occurrence_id \n # An identifier for the Occurrence (as opposed to a particular digital record of the occurrence).\n # In the absence of a persistent global unique identifier, construct one from a combination of identifiers in the record that will most closely make the occurrenceID globally unique.\n # For a specimen in the absence of a bona fide global unique identifier, for example, use the form: \"urn:catalog:[institutionCode]:[collectionCode]:[catalogNumber].\n # Examples: \"urn:lsid:nhm.ku.edu:Herps:32\", \"urn:catalog:FMNH:Mammal:145732\" \n\n #if v = @obj.identifiers.that_are_global.andand.first\n # v.cached_display_name\n #else\n \"urn:catalog:#{institution_code}:#{collection_code}:#{catalog_number}\"\n #end\n end",
"def extract_invoice_id\n invoice_id = Converter.xml_get('Betreff_NR', self.order)\n if invoice_id && invoice_id.match(/Rechnung Nr/)\n self.id = invoice_id.match(/\\d+/)[0]\n end\n end",
"def human_occurrence_date(occurrence)\n if date = occurrence.date\n if date.year == Date.today.year\n date.strftime '%B %d'\n else\n date.strftime '%B %d, %Y'\n end\n end\n end",
"def qnum(d)\n\t\td = d.to_date\n\t\tif(d.month >= 2 && d.month <= 4)\n\t\t\treturn 1\n\t\telsif(d.month >= 5 && d.month <= 7)\n\t\t\treturn 2\n\t\telsif(d.month >= 8 && d.month <= 10)\n\t\t\treturn 3\n\t\telse\n\t\t\treturn 4\n\t\tend\n\tend",
"def get_report_date(folder)\r\n\tlast_day = Time.parse('2011-01-01')\r\n\tDir[\"#{folder}/*.pdf\"].each do |pdf|\r\n#puts pdf\r\n\t\tfilename = File.basename(pdf).gsub('.pdf', '')\r\n\t\tfs = filename.split(' ')\r\n\t\tstore_name = fs[0]\r\n\t\tdt = fs[-1]\r\n\t\tdt.gsub!('W', '')\r\n\t\tdt.gsub!('M', '')\r\n#puts dt\r\n\t\tdt = Time.parse(dt)\r\n\t\tlast_day = dt if last_day < dt\r\n\tend\r\n\r\n\tdate = last_day.strftime('%Y-%m-%d')\r\n\r\n\treturn date\r\nend",
"def track_number\n @ole.TrackNumber\n end",
"def si_generate_no\n company = params[:company]\n posted_at = params[:posted_at]\n\n # Builds no, if possible\n code = '$err'\n if company != '$' && posted_at != '$'\n code = si_next_no(company, Time.parse(posted_at))\n end\n @json_data = { \"code\" => code }\n render json: @json_data\n end",
"def tracking_number\n @root.attribute(\"ID\").to_s\n end",
"def tracking_number\n @root.attribute(\"ID\").to_s\n end",
"def get_update\n \"End of Year #{format_as_fiscal_year(reporting_year)} Odometer Reading for NTD A-30 recorded as #{ntd_report_mileage} miles\" unless ntd_report_mileage.nil?\n end",
"def ref_id\n 300_000_000 + data[0].to_i\n end",
"def to_index\n yday + (year-2000) * 1000\n end",
"def real_no_unformatted\n invoices.first.invoice_no rescue bill_no.last(16)\n end",
"def last_report_file_name(branch = proj_branch)\n ls_report_dir(branch).last\n end",
"def short_number\n self.new_record? ? self.number : \"#{self.id.to_s.rjust(6, \"0\")}#{I18n.l(self.created_at, :format => \"%m%Y\")}\"\n end",
"def find_report\n within(start_date, end_date).map(&:patient_id)\n end",
"def last_report_id(host,port,ssl)\n\t\trep = Report.find(:first, :order => 'id desc', :conditions => [ \"parent_id = ? and value = ?\",0,\"#{host},#{port},#{ssl}\"])\t\t\n\t\t\n\t\tif (not rep)\n\t\t\trep_id = framework.db.create_report(0,'WMAP','REPORT',\"#{host},#{port},#{ssl}\",\"Metasploit WMAP Report\",'WMAP Scanner')\n\t\telse\n\t\t\trep_id = rep.id\n\t\tend\t\n\n\t\treturn rep_id\n\tend",
"def reports_num\n self.reports.length\n end",
"def listed_company_registration_number; end",
"def add_number\n return unless %w[techreport manual].include? @bib.type\n\n did = @bib.docidentifier.detect { |i| i.primary == true }\n did ||= @bib.docidentifier.first\n @item.number = did.id if did\n end",
"def week_no(args = nil)\n week_no = (self.day_of_year.to_f / 7).to_i + 1\n \n if args and args[:mfirst] and self.day_in_week == 1\n week_no -= 1\n end\n \n return week_no\n end",
"def show_total_unattendance_number\n puts 'show_total_unattendance_number'\n total_unattendance_number = @data.inject (0) do |mem, e|\n num_exams = e.size - 1.0\n mem + e.last(num_exams).count('00')\n end\n puts total_unattendance_number.to_s\n end",
"def id_number; end",
"def external_report\n return external_reports.first\n end",
"def date(date_name)\r\n case date_name\r\n when :start\r\n return self.accommodation_histories.last.from\r\n when :end\r\n return self.accommodation_histories.last.to\r\n else\r\n return 0\r\n end\r\n end",
"def idsr_monthly_report_summary\n date = params[:year_month].split('-')\n @start_date = Date.new(date[0].to_i,date[1].to_i)\n\n @end_date = @start_date + 1.month - 1.day\n @disaggregated_diagnosis = {}\n\n idsr_monthly_set = ConceptName.where([\"name IN (?)\",[\"Idsr Monthly Summary\"]]).map(&:concept_id)\n\n\n idsr_monthly_set_members = ConceptSet.where([\"concept_set IN (?)\",idsr_monthly_set]).map(&:concept_id)\n\n concept_ids = ConceptName.where([\"concept_name.concept_id IN (?)\",\n idsr_monthly_set_members]).map(&:concept_id)\n\n observation = Observation.where([\"obs.obs_datetime >= ? AND obs.obs_datetime <= ?\n AND obs.value_coded IN (?)\",@start_date, @end_date,concept_ids]).includes({:person=>{}})\n\n observation.each do | obs|\n next if obs.person.blank?\n next if obs.answer_concept.blank?\n previous_date = obs.obs_datetime.strftime('%Y-%m-%d').to_date\n sex = obs.person.gender\n age = PatientService.age(obs.person, previous_date)\n diagnosis_name = obs.answer_concept.fullname rescue ''\n\n @disaggregated_diagnosis[diagnosis_name]={\n \"=<4\" =>0,\n \"=>5\" =>0\n }\n\n # if @disaggregated_diagnosis[diagnosis_name] != nil\n if age.to_i < 5\n @disaggregated_diagnosis[diagnosis_name][\"=<4\"]+=1\n else\n @disaggregated_diagnosis[diagnosis_name][\"=>5\"]+=1\n end\n # end\n # end\n @diaggregated_paginated = []\n @disaggregated_diagnosis.each { | diag, value |\n @diaggregated_paginated << [diag, value]\n }\n end\n #raise @diaggregated_paginated.inspect\n render :json=> @diaggregated_paginated\n end",
"def get_year_with_number\n date_receipt.strftime(\"%Y\") + \"-\" + sprintf( \"%03i\", receipt_num )\n end",
"def day_num_to_index(day_num)\n check_pre((\n (day_num.int?)\n ))\n\n return day_num - 1\nend",
"def compute_and_present(reports)\n alltime_proceeds_per_currency = {} #currency is the key, value is the proceeds\n alltime_renewables = 0\n alltime_apps = {}\n alltime_payed_units = 0\n alltime_inapp_units = 0\n alltime_free_units = 0\n alltime_updated_units = 0\n \n first_date = reports[0].split('_').last.split('.').first\n reports.each do |alltime_filename|\n\n puts \"Processing #{alltime_filename}\".green if @beVerbose\n\n #get the date from the filename\n date = alltime_filename.split('_').last.split('.').first #filename example: S_D_80076793_20120706.txt\n\n report_data = File.open(alltime_filename, \"rb\").read \n\n report = parse(report_data)\n #puts report.class\n if report #report parsed\n apps = {}\n total_payed_units = 0\n total_inapp_units = 0\n total_free_units = 0\n total_updated_units = 0\n report.each do |item| #report is a hash \n if item\n sku = item[:sku] #group data by app sku\n if apps.has_key? sku #app is already cached\n app = apps[sku]\n else #initially insert app\n app = {:sku=>sku, :title=>item[:title], :sold_units=>0, :updated_units=>0}\n apps[sku] = app\n end\n #ensure currency sum\n alltime_proceeds_per_currency[item[:currency_of_proceeds]] = 0.0 unless alltime_proceeds_per_currency[item[:currency_of_proceeds]]\n \n #count units\n if SALE_IDENTS.include? item[:product_type_id] #count sales\n app[:sold_units] += item[:units]\n if item[:customer_price]==0 #a free app\n total_free_units += item[:units]\n else \n total_payed_units += item[:units]\n alltime_proceeds_per_currency[item[:currency_of_proceeds]] += item[:developer_proceeds] * item[:units]\n end\n elsif INAPP_SALE_IDENTS.include? item[:product_type_id]\n app[:sold_units] += item[:units]\n total_inapp_units += item[:units]\n alltime_proceeds_per_currency[item[:currency_of_proceeds]] += item[:developer_proceeds] * item[:units]\n if item[:product_type_id] == \"IAY\" #InAppPurchase\n alltime_renewables += item[:units]\n end\n elsif UPDATE_IDENTS.include? item[:product_type_id] #count updates\n app[:updated_units] += item[:units]\n total_updated_units += item[:units]\n end \n else # only if item \n puts \"null report\".red\n end\n end\n\n #add to the alltime stats\n alltime_payed_units += total_payed_units\n alltime_inapp_units += total_inapp_units\n alltime_free_units += total_free_units\n alltime_updated_units += total_updated_units\n \n apps.each do |alltime_sku, apps_app| \n #select the app\n if alltime_apps.has_key? alltime_sku\n #already cached\n alltime_app = alltime_apps[alltime_sku]\n else\n #insert for the first time\n alltime_app = {:sku=>alltime_sku, :title=>apps_app[:title], :sold_units=>0, :updated_units=>0} \n alltime_apps[alltime_sku] = alltime_app\n end\n #add stats\n alltime_app[:sold_units] += apps_app[:sold_units]\n alltime_app[:updated_units] += apps_app[:updated_units]\n end\n\n if @beVerbose && reports.size>1\n #report for date\n puts \"\\n\\n______________________________________________________________\".blue\n puts \"Report for #{date}\"\n puts \"\\n\" + \"Product\".ljust(40).blue + \": \" +\"Downloads\".green + \" / \" + \"Updates\".green\n puts \"______________________________________________________________\".yellow\n apps.each do |app_sku,apps_app|\n puts \"#{apps_app[:title].ljust(40).blue}: #{apps_app[:sold_units].to_s.ljust(10).green} / #{apps_app[:updated_units].to_s.rjust(7).dark_green}\"\n end \n puts \"______________________________________________________________\".yellow\n puts \"#{'InApp Purchases'.ljust(40).green}: #{total_inapp_units}\"\n puts \"#{'Payed Downloads'.ljust(40).green}: #{total_payed_units}\"\n puts \"#{'Free Downloads'.ljust(40).dark_green}: #{total_free_units}\"\n puts \"#{'Updates'.ljust(40).dark_green}: #{total_updated_units}\"\n puts \"______________________________________________________________\".blue\n puts \"\\n\\n\"\n end #if @beVerbose\n\n else \n puts \"null report parsed\".red\n end #if report parsed\n \n end #reports.each\n\n #report alltime\n puts \"\\n\\n______________________________________________________________\".blue\n from = Date.strptime first_date, '%Y%m%d'\n age = Date.today - from \n formatted_from = from.strftime(\"%b %d %Y\")\n puts \"Report\" + (ARGV[0]? \" #{ARGV[0]}\":\" daily\") + \", from #{formatted_from}, #{age.to_i} days\"\n puts \"\\n\" + \"Product\".ljust(40).blue + \": \" +\"Downloads\".green + \" / \" + \"Updates\".green\n puts \"______________________________________________________________\".yellow\n alltime_apps.each do |app_sku, aapp|\n puts \"#{aapp[:title].ljust(40).blue}: #{aapp[:sold_units].to_s.ljust(10).green} / #{aapp[:updated_units].to_s.rjust(7).dark_green}\"\n end \n puts \"______________________________________________________________\".yellow\n puts \"#{'InApp Purchases'.ljust(40).green}: #{alltime_inapp_units}\" + ( alltime_renewables > 0.0 ? \" / #{alltime_renewables} Auto-Renewed\" : \"\")\n puts \"#{'Payed Downloads'.ljust(40).green}: #{alltime_payed_units}\"\n puts \"#{'Free Downloads'.ljust(40).dark_green}: #{alltime_free_units}\"\n puts \"#{'Updates'.ljust(40).dark_green}: #{alltime_updated_units}\"\n puts \"\\n#{'Proceeds'.red}:\\n\\n\"\n total_proceeds = 0.0\n alltime_proceeds_per_currency.each do |proceed_key, proceed| \n formatted_sum = proceed > 0.0 ? \"#{proceed}\".green : \"#{proceed}\".red\n if proceed > 0.0\n if proceed_key == @convertTo\n total_proceeds += proceed\n puts \"#{proceed_key} : #{formatted_sum}\"\n else\n #convert using google\n data = open(\"http://www.google.com/ig/calculator?q=#{proceed}#{proceed_key}=?#{@convertTo}\").read\n #fix broken json\n data.gsub!(/lhs:/, '\"lhs\":')\n data.gsub!(/rhs:/, '\"rhs\":')\n data.gsub!(/error:/, '\"error\":')\n data.gsub!(/icc:/, '\"icc\":')\n data.gsub!(Regexp.new(\"(\\\\\\\\x..|\\\\\\\\240)\"), '') \n #puts data\n converted = JSON.parse data\n converted_proceed = converted[\"rhs\"].split(' ').first.to_f\n total_proceeds += converted_proceed\n puts \"#{proceed_key} : #{formatted_sum} / #{converted['rhs']}\"\n end\n end\n end\n puts \"\\n#{'Total'.green}: #{total_proceeds} #{@convertTo}\"\n puts \"______________________________________________________________\".blue\n puts \"\\n\\n\" \nend",
"def day_to_index(day_num)\n check_pre((\n (day_num.int?)\n ))\n\n return day_num - 1\nend",
"def latest_report\n @latest_report ||= AedUtils.latest_published_analysis\n end",
"def get_page_number\n # this is the normal case; masterfile and unit share same metadata record\n # so page number will match the numbering sequence of the filename\n page = filename.split(\"_\")[1].split(\".\")[0].to_i\n # if metadata_id == unit.metadata_id\n if is_clone?\n mf_id = original_mf_id\n page = MasterFile.find(mf_id).filename.split(\"_\")[1].split(\".\")[0].to_i\n end\n # else\n # # this master file has been assigned to a separate metadata record. the\n # # page number in the filename does not reflect the actual page num. Count\n # # masterfiles owned by metadata record to determine\n # page = 1\n # metadata.master_files.each do |mf|\n # if mf.id == id\n # break\n # else\n # page += 1\n # end\n # end\n # end\n return page\n end",
"def dayNum\n ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'].index(self.day.downcase)\n end",
"def overall_report_event(vuln_id, report)\n churn = report['insertions'].to_i + report['deletions'].to_i\n num_devs = report['developers'].size.to_s\n drive_bys = report['drive_bys'] || []\n desc = @report_desc.gsub /:[\\w]+:/, {\n ':num_devs:' => num_devs,\n ':nice_date:' => report['nice_date'],\n ':commits:' => report['commits'].to_s,\n ':insertions:' => report['insertions'].to_s,\n ':deletions:' => report['deletions'].to_s,\n ':num_files:' => report['files'].size.to_s,\n ':num_drive_bys:' => drive_bys.size.to_s,\n }\n\n return { # Constructing 100k event objects is slow - use hashes instead\n date: report['date'],\n event_type: 'changes',\n title: <<~EOS,\n #{report['commits']} #{'commit'.pluralize(report['commits'])} by #{num_devs} #{'developers'.pluralize(num_devs.to_i)}, #{churn} #{'line'.pluralize(churn)} changed\n EOS\n description: desc,\n icon: 'assignment',\n color: compute_color(churn),\n vulnerability_id: vuln_id,\n start_hidden: true\n }\n end",
"def wrong_date(num)\n first_day(num).text\nend",
"def reports_today(user)\n ### reports_today = MachineShopApi.get_device_instance_reports(user, self)\n ### end\n ### if reports_today\n ### return reports_today\n ### else\n ### 0\n ### end\n end",
"def get_batchid_general\n if ['GENOPTIX MEDICAL LABORATORY','METROHEALTH SYSTEM','FRONT LINE'].include?(facility.name.upcase)\n @zip_file_name[0...-4] #batch id is the last segment of quadax zip file name (excluding '.zip')\n else\n batchid = parse(config['BATCH']['batchid'])\n date = parse(config['BATCH']['date'][0])\n batch_date = Date.rr_parse(date, true).strftime(\"%m%d%Y\") rescue nil\n \"#{batchid}_#{batch_date}\"\n end\n end",
"def invoice_num\n item_id\n end"
] |
[
"0.6702216",
"0.6660935",
"0.6379788",
"0.62252164",
"0.60224944",
"0.5978005",
"0.5799169",
"0.5764095",
"0.5642951",
"0.5611011",
"0.55981743",
"0.5590689",
"0.55649954",
"0.5564428",
"0.55217636",
"0.55108225",
"0.548926",
"0.5482215",
"0.54808813",
"0.54787314",
"0.5462981",
"0.5457489",
"0.5430803",
"0.54294115",
"0.54276234",
"0.5426057",
"0.5408752",
"0.54056185",
"0.53987044",
"0.5398692",
"0.5396018",
"0.5393719",
"0.53804386",
"0.53795946",
"0.5378401",
"0.5355436",
"0.5345022",
"0.53348356",
"0.5329444",
"0.5326262",
"0.53177017",
"0.53139",
"0.53051615",
"0.53001255",
"0.5297437",
"0.5290814",
"0.5290367",
"0.5288992",
"0.5287542",
"0.5279572",
"0.5278748",
"0.5263842",
"0.5255723",
"0.52546376",
"0.5250112",
"0.5249912",
"0.524885",
"0.5242019",
"0.5234332",
"0.52284014",
"0.5228318",
"0.52258164",
"0.5225676",
"0.52144516",
"0.52122384",
"0.5189532",
"0.5183372",
"0.5175074",
"0.51737815",
"0.517086",
"0.517086",
"0.5166326",
"0.51656973",
"0.51567715",
"0.51518965",
"0.51504856",
"0.514978",
"0.51480716",
"0.5145876",
"0.51430887",
"0.51424325",
"0.51413095",
"0.51395845",
"0.51320976",
"0.5122215",
"0.5110476",
"0.51057225",
"0.51041585",
"0.51018244",
"0.50904506",
"0.5087365",
"0.50849074",
"0.5084405",
"0.50842226",
"0.50837815",
"0.50809133",
"0.5079881",
"0.5079225",
"0.5078575",
"0.5072526"
] |
0.671612
|
0
|
Never trust parameters from the scary internet, only allow the white list through.
|
def user_params
params.require(:user).permit(:email, :first_name, :last_name, :sms_number, :time_zone, :api_endpoint, :email_notification_frequency, :sms_notification_frequency, :email_notification_hour, :sms_notification_hour, :password_confirmation, :password)
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 end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"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.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
Define your play method below
|
def play(board)
until over?(board) == true
turn(board)
break if won?(board) != false
end
puts "Congratulations #{winner(board)}!" if won?(board) != false
puts "Cats Game!" if draw?(board) == true
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def play\n \n end",
"def play; end",
"def play \n end",
"def play\n end",
"def play\n end",
"def play\n end",
"def play\n end",
"def play\n end",
"def play\n\tend",
"def play\n #calls to all the methods that produce game!\n end",
"def play\n self\n end",
"def get_play() \n # \n end",
"def play\n puts 'Playing'\n end",
"def after_play\n\n end",
"def run \n Engine::play(Beginning)\nend",
"def play\n\t\tgame_loop\n\tend",
"def play()\n @ole.Play()\n end",
"def play()\n @ole.Play()\n end",
"def play\n #tho I am sure there is a better way to define a virtual method... just gonna throw something\n raise 'Method play cannot be called directly. It must be overridden in a child class first.'\n end",
"def play\n @hungry = true\n #p \"play method called\" #print notification to console\n end",
"def play\n\t\t\"playing #{title}\"\n\tend",
"def play socket\n end",
"def play\n \"We're rockiinnggg\"\n end",
"def play\n render layout: 'player'\n end",
"def play\r\n\t\t[FOLD]\r\n\tend",
"def startPlayback\n end",
"def play(&blk)\n start_playing\n blk.call\n ensure\n stop_playing\n end",
"def play\n greeting\n get_tiles\n move_sequence\n end",
"def play_sports\n end",
"def play\n puts \"buzz\"\n end",
"def play\n board_setup\n gameplay_setup\n end",
"def play(*args)\n sleep(duration)\n end",
"def process_ok\n Sound.play_ok\n super\n end",
"def playAction _obj, _args\n \"_obj playAction _args;\" \n end",
"def play\n\temulate do |emulator|\n\t\temulator.play(self)\n\tend\nend",
"def play_as_master_second\r\n \r\n end",
"def play\n @@plays += 1\n end",
"def play\n each do |playable|\n if playable.respond_to?(:play)\n playable.play\n end\n end\n end",
"def play\n take_turn until @master.game_over?\n @master.show_board\n @robot.speak\n end",
"def play\n synchronize do\n @starved = false\n @source.play\n end\n end",
"def play(cmd)\n play_game(cmd)\n end",
"def play\r\n return if self.finished?\r\n self.update\r\n end",
"def play\n\t\twelcome\n\t\task_name\n\t\task_name2 \n\t\task_input\n\t\tturns\n\tend",
"def play\r\n display_welcome_message\r\n init_players\r\n\r\n loop do\r\n play_match\r\n break unless play_again?\r\n end\r\n\r\n display_goodbye_message\r\n end",
"def buz; Sound.play_buzzer; end",
"def sound; end",
"def player; end",
"def player; end",
"def player; end",
"def player; end",
"def player; end",
"def player; end",
"def player; end",
"def beginGameLoop\n @gameLoop.play\n end",
"def play_game\n # WarAPI.play_turn()\n end",
"def play\n if (RUBY_PLATFORM == \"java\")\n java_play\n else\n ruby_play\n end\n end",
"def show_play_complete_player\n # nothing\n end",
"def play\n must_be_ready!\n stop if running?\n \n info \"PLAY: #{opts[:path]}\"\n worker.startup!\n end",
"def play()\n @files.shuffle.each do |file|\n play_file(file)\n end\n end",
"def on_play(track)\n end",
"def play\n wake\n puts \"You play fetch with #{@name}.\"\n time_passed\n end",
"def playActionNow _obj, _args\n \"_obj playActionNow _args;\" \n end",
"def set_player\n\n end",
"def play\n Audio::Out.add @cpg\n @is_playing = true\n #Audio::Out.add @actuator\n end",
"def play\n @play_mode = true\n session[:cards] = @tarot.cards.map(&:id).shuffle\n @tname = @tarot.name\n @tauthor = @tarot.author\n @draw_path = draw_one_tarot_cards_path(@tarot)\n @shuffle_path = play_tarot_cards_path(@tarot)\n # シャッフルでは画面リドローした方がいいので描画しなおす\n # respond_to do |format|\n # format.html\n # format.js\n # end\n end",
"def main_audio\r\n super\r\n # Stop BGM and BGS\r\n $game_system.bgm_play(nil)\r\n $game_system.bgs_play(nil)\r\n # Play game over ME\r\n $game_system.me_play($data_system.gameover_me)\r\n end",
"def perform\n\tgame_menu\n\tgameplay\nend",
"def playSound _args\n \"playSound _args;\" \n end",
"def play\n init_player()\n init_board()\n puts \"Test game play\"\n end",
"def play\n @game.start if @game.waiting_to_start?\n if @game.active?\n play_cards if params[:commit] # play submitted cards, if a form submit occurred\n @sets = @game.fill_gamefield_with_sets\n end\n if @game.finished?\n publish_if_finished_and_promoted\n redirect_to :action => 'archive'\n else\n render :action => 'play'\n end\n end",
"def change_player\n\n end",
"def play_action\n @status.playback_state = :playing\n update_status\n end",
"def play\n @sound += 1\n @sound %= @overlap\n `#{@sounds[@sound]}.play()`\n end",
"def play_title_music\r\n\r\n$data_system.title_bgm.play\r\n\r\nRPG::BGS.stop\r\n\r\nRPG::ME.stop\r\n\r\nend",
"def play(song)\n # artist = Artist.find_by(id: song.artist_id)\n puts \"Playing #{song}\"\n end",
"def show_play_complete_player\n\t\t# nothing\n\tend",
"def next_player!\n end",
"def run(player)\n puts \"Hello!\"\n end",
"def play!\n if @file\n fork do\n begin\n system \"play #{@file}\" # exec\n rescue\n \t puts \"error playing sound\"\n end\n end\n end\n end",
"def play\r\n display_welcome_message\r\n human_choose_move\r\n computer_choose_move\r\n display_winner\r\n display_goodbye_message\r\nend",
"def run\n @music.play(:repeats => -1)\n\thook_run()\n\thook_quit()\n\t# Handling input\n\tloop do\n\t @queue.each do |event|\n\t\thandle(event)\n end\n\t# Draw the image to screen\n\t@intro_screen.blit(@screen,[0,0])\n\t@screen.flip()\n end\n end",
"def call\n if context.dj.player.stopped?\n related = context.dj.add_related\n if related\n context.dj.switch!\n context.message = [ \"Autoplaying.. #{ related }\" ].join(\" \")\n else\n context.errors = \"Failed getting related video.\"\n context.fail!\n end\n else\n current_video = context.dj.current_video\n context.message = \"Skipping!\"\n next_title = context.dj.switch!\n if next_title\n context.message = [ context.message, \"Playing #{ next_title }\" ].join(\" \")\n else\n context.message = \"Nothing to play, add some songs to playlist.\"\n end\n end\n end",
"def playback file, &block\n application \"playback\", file, &block\n end",
"def play\n @hungry = true\n end",
"def play\n @hungry = true\n end",
"def play\n @hungry = true\n end",
"def play!\n @playlist.shift\n end",
"def show\n\n \t\t\trespond_with @play\n\n \t\tend",
"def main_audio ; end",
"def play\n @game = Game.find_by_id(@id)\n raise RecordNotFound, 'Not found' if @game.nil?\n\n @game.increment_access\n render 'play', formats: 'json', handlers: 'jbuilder'\n end",
"def play_sound \n system\"play #{@sound_file}\"\n end",
"def audio; end",
"def main_audio\r\n super\r\n # Play title BGM\r\n $game_system.bgm_play($data_system.title_bgm)\r\n # Stop playing ME and BGS\r\n Audio.me_stop\r\n Audio.bgs_stop\r\n end",
"def play\n return_value = yield self\n\n save_board!\n\n return_value\n end",
"def play\n # unless the game is over players take turns\n take_turn until game_over?\n\n #start a new game if the game is over\n new_game_or_quit\n end",
"def process_x\n if current_item_enabled?\n Sound.play_ok\n super\n else\n Sound.play_buzzer\n end\n end",
"def play_special player\n\t\t\tif @spec_action\n\t\t\t\t@spec_action.call player, self\n\t\t\tend\n\t\t\t\n\t\t\ttrue\n\t\tend",
"def play!\n update_attributes!(:status => :playing, :played_at => Time.now)\n self\n end",
"def playable_action\n raise NotImplementedError\n end",
"def playMove _obj, _args\n \"_obj playMove _args;\" \n end",
"def play\n puts \"#{name} got zoomies playing fetch!\"\n @hungry = true\n end"
] |
[
"0.91277385",
"0.9031555",
"0.90065134",
"0.900332",
"0.900332",
"0.900332",
"0.900332",
"0.8978301",
"0.88647234",
"0.8184945",
"0.80578035",
"0.79240173",
"0.78456163",
"0.7765175",
"0.77345335",
"0.76989305",
"0.7611273",
"0.7611273",
"0.7528091",
"0.74453044",
"0.74384725",
"0.74071074",
"0.7361055",
"0.73219633",
"0.73183304",
"0.7305947",
"0.7276433",
"0.727489",
"0.72664",
"0.72488713",
"0.7223312",
"0.71886545",
"0.71801096",
"0.7177513",
"0.7167901",
"0.71595836",
"0.71479374",
"0.71467835",
"0.6938487",
"0.6910191",
"0.6897485",
"0.68842834",
"0.6873398",
"0.68341005",
"0.68210787",
"0.68046623",
"0.67788917",
"0.67788917",
"0.67788917",
"0.67788917",
"0.67788917",
"0.67788917",
"0.67788917",
"0.6764783",
"0.6757064",
"0.6756813",
"0.6755827",
"0.6750558",
"0.6749177",
"0.67485446",
"0.67396295",
"0.6733066",
"0.6730967",
"0.67230797",
"0.67202306",
"0.67108464",
"0.6694557",
"0.6693444",
"0.6684301",
"0.667619",
"0.6634668",
"0.66228515",
"0.662045",
"0.66192347",
"0.6612572",
"0.6606098",
"0.656401",
"0.656184",
"0.6534731",
"0.65318584",
"0.65292335",
"0.651808",
"0.65143067",
"0.6502987",
"0.6502987",
"0.6502987",
"0.6486641",
"0.647975",
"0.6467687",
"0.6443099",
"0.64334816",
"0.6428434",
"0.6426544",
"0.6416904",
"0.6416639",
"0.6411488",
"0.64010864",
"0.6396464",
"0.63943255",
"0.63736016",
"0.6371055"
] |
0.0
|
-1
|
FIXME [specs]: it looks like the error is occuring because of the lack of the deadlines, not because of the year becoming nil (at least, not anymore; but I can try adding the binding.pry back in to see what's wrong). try starting from a fresh test database and creating the years and then the quarters. we're getting stopped by the all_fields_present? before filter, but this renders 'new', which renders the view without calling the get_years_form_hash before filter. so we'll instead add a method to the academic_year model that grabs the same hash that get_years_form_hash was getting for us.
|
def index
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @acedemic_year = AcedemicYear.new(acedemic_year_params)\n acedemic_year_last = AcedemicYear.try(:last)\n respond_to do |format|\n if @acedemic_year.save\n if @acedemic_year.present?\n if acedemic_year_last.present?\n list_grades = acedemic_year_last.grades.map{ |g| {name: g.name, acedemic_year_id: @acedemic_year.id} }\n Grade.create(list_grades)\n Term.create([\n {name: \"First Term\", acedemic_year_id: @acedemic_year.id},\n {name: \"Second Term\", acedemic_year_id: @acedemic_year.id},\n {name: \"Third Term\", acedemic_year_id: @acedemic_year.id}\n ])\n end\n end\n format.html { redirect_to @acedemic_year, notice: 'Academic year was successfully created.' }\n format.json { render :show, status: :created, location: @acedemic_year }\n else\n format.html { render :new }\n format.json { render json: @acedemic_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @academic_year = AcademicYear.new(params[:academic_year])\n\n if @academic_year.save\n @academic_years = AcademicYear.paginate :page=>params[:page], :per_page=>15\n\n flash[:notice] = t('flash_msg48')\n else\n @error = true\n end\n end",
"def index\n @new_fiscal_year = FiscalYear.new\n @fiscal_years = FiscalYear.order(:year)\n end",
"def special_education_in_year(year)\n if valid_year?(year)\n special_education_select_data = @special_education.find_all { |hash| hash[:timeframe] == \"#{year}\" && hash[:data] }\n truncate(special_education_select_data[0][:data])\n end\n end",
"def couses_add_view_init\n @curr_year = params[:year]\n if params[:year].nil?\n @curr_year = Course.get_current_year\n else\n @curr_year =params[:year].to_i\n end\n\n @min_year = Course.minimum('start_year')\n if @min_year.nil?\n @min_year = Course.get_current_year\n else\n @min_year = @min_year.to_i\n end\n @min_year = Course.get_current_year if @min_year > Course.get_current_year\n\n\n @max_year = Course.maximum('start_year')\n if @max_year.nil?\n @max_year = Course.get_current_year\n else\n @max_year = @max_year.to_i\n end\n @max_year = Course.get_current_year if @max_year < Course.get_current_year\n @courses = Course.where(start_year: @curr_year)\n end",
"def new_school_year(school_year)\n activate_school_year(school_year) if @active.nil?\n @school_years << school_year if school_year.valid?\n school_year.save!\n school_year\n end",
"def acedemic_year_params\n params.require(:acedemic_year).permit(:year, :start_date, :end_date, :grade_ids => [], :fee_ids => [])\n end",
"def create\n @teaching = Teaching.new(params[:teaching])\n if params[:curriculum_id]\n curriculum = Curriculum.find(params[:curriculum_id])\n end\n optional = false\n optional = true if params[:isOptional]\n period = Period.find_by_subperiod_and_year(params[:subperiod], params[:year])\n if period\n @teaching.period = period\n end\n respond_to do |format|\n @teaching.save\n if curriculum && @teaching.belongs.build(:curriculum => curriculum, :isOptional => optional) && @teaching.save\n flash[:notice] = 'Insegnamento creato correttamente.'\n format.html { redirect_to select_teacher_teaching_url(@teaching) }\n format.js{render(:update) {|page| page.redirect_to select_teacher_teaching_url(@teaching)}}\n else\n @graduate_courses = @current_user.graduate_courses\n @year = Period.find(:all, :select => \"DISTINCT year\")\n @subperiod = Period.find(:all, :select => \"DISTINCT subperiod\")\n format.html { render :action => \"new\" }\n format.js{}\n end\n end\n end",
"def test_filter_year\n \t\t\n \t\t# Execute the query.\n \t\tresponse = @query.collect_references(@reference)\n \t\t\n \t\t# The query should result in more than one reference. \n \t\tassert(response.size > 0, 'Query did not find any references.')\n \t\t\n \t\t\n \t\t# Check if the response contains any references which title are equal to the\n \t\t# title of @reference. If so, the filter should result in >0 references after\n \t\t# filtering.\n \t\tfound_similar = false\n \t\t@query.response.each do |collected_ref|\n \t\t\tassert(collected_ref.is_a?(Bibmix::CollectedReference))\n \t\t\tif collected_ref.reference.title == @reference.title\n \t\t\t\tfound_similar = true\n \t\t\tend\n \t\tend\n \t\t\n\t \tassert(found_similar, 'The query did not find any references with the exact same title, so filter will return no refernces.')\n\n\t\t# Construct the filter and execute the filtering procedure.\n \t\tfilter = ReferenceFilter.new(@reference)\n \t\tfilter = FilterDecoratorFactory.instance.year(filter)\n \t\t\n \t\tassert(filter.kind_of?(Bibmix::YearFilterDecorator))\n \t\t\n \t\tfilter.filter(@query.response)\n\t \t\n\t \tassert(filter.filtered_references.size > 0)\n\t \t\n\t \tfilter.filtered_references.each do |filtered_ref|\n\t \t\t# Check the similarity between the filtered reference and @reference.\n\t \t\tassert_equal(1.0, filtered_ref.relevance.round(1))\n\t \t\t\n\t \t\t# Check if the titles are really equal.\n\t \t\tassert_equal(@reference.year, filtered_ref.collected_reference.reference.year)\n\t \tend\n\t \t\n\t \t# Reset the similarity values.\n\t \tfilter.reset\n\t \t\n\t \t# Filter again, but now with a lower threshold. Use the yearfilterdecorator\n\t \t# bonus as threshold. This means all collected references with the same\n\t \t# year as @reference will be part of the filter result\n\t \tfilter.relevance_threshold = YearFilterDecorator::SIMILARITY_BONUS\n\t \tfilter.filter(@query.response)\n\t \t\n\t \tfilter.filtered_references.each do |filtered_ref|\n\t \t\tassert(filtered_ref.relevance >= YearFilterDecorator::SIMILARITY_BONUS)\n\t \t\tif filtered_ref.relevance < 1\n\t \t\t\tassert(filtered_ref.collected_reference.reference.title != @reference.title)\n\t \t\t\tassert(filtered_ref.collected_reference.reference.year == @reference.year)\n\t \t\tend\n\t \tend\n \tend",
"def firework_year_params\n params.require(:firework_year).permit(:year)\n end",
"def new\n @student = Student.new\n @student.enrollments.build(:end_year => Date.today.year)\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end",
"def show\n @teachers = @school.teachers.paginate(:page => params[:page], :per_page => 5)\n \n if params[:for_school_year].nil?\n @observations = @school.observations.this_school_year\n else\n @observations = @school.observations.filter(params.slice(:for_school_year))\n end\n \n @observation_count = @observations.complete.count\n \n# If too much for server, comment out from here...\n if !@observations.empty?\n @result_array = @school.school_results(@observations)\n @total_result_array = @school.total_school_results(@result_array)\n else\n @result_array = [[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]]\n @total_result_array = [0,0,0,0,0]\n end\n# ...to here\n \n \n # School Year Dropdown list\n current_year = Date.current.year\n if Date.current < Date.new(current_year,7,1)\n latest_year = current_year-1\n else\n latest_year = current_year\n end\n \n @year_list = []\n while latest_year >= 2009\n @year_list.push(\"#{latest_year}-#{latest_year+1}\")\n latest_year-=1\n end\n \n \n end",
"def update_project_fiscal_year\n if multi_year? and activity_line_items.present?\n self.fy_year = activity_line_items.pluck(:fy_year).min\n end\n end",
"def built_year_params\n params.require(:built_year).permit(:year, :gearbox, :engine_displacement)\n end",
"def year_params\n params.require(:year).permit(:id, :year)\n end",
"def academic_year\n academic_year = case quarter_code_id\n when 1\n \"#{year-1}-#{year}\"\n when 2\n \"#{year-1}-#{year}\"\n when 3\n \"#{year}-#{year+1}\"\n when 4\n \"#{year}-#{year+1}\"\n end\n academic_year\n end",
"def create\n @new_year = FiscalYear.new(params[:fiscal_year])\n unless @new_year.save\n flash[:error] = \"Fiscal year already exists or improperly formatted.\"\n render :index\n return\n end\n flash[:notice] = \"Fiscal year created\"\n redirect_to fiscal_years_path\n end",
"def academic_years\n Education::AcademicYear.where(id: education_cohorts.pluck(:academic_year_id))\n end",
"def participation_in_year(year)\n if valid_year?(year)\n pupil_enrollment_select_data = @pupil_enrollment.find_all { |hash| hash[:timeframe] == \"#{year}\" && hash[:data] }\n truncate(pupil_enrollment_select_data[0][:data])\n end\n end",
"def new_or_edit\n @witness_year = WitnessYear.where(id: params[:witness_year_id], year: Year.current_year).first if params[:witness_year_id].present?\n @countries = CountryRegionCity.get_cities_by_country\n end",
"def remediation_in_year(year)\n if valid_year?(year)\n pupil_enrollment_select_data = @remediation.find_all { |hash| hash[:timeframe] == \"#{year}\" && hash[:data] }\n truncate(pupil_enrollment_select_data[0][:data])\n end\n end",
"def load_fiscal_years\n @new_fiscal_year = FiscalYear.new\n @fiscal_years = FiscalYear.order(:year)\n end",
"def index\n @fiscal_years = FiscalYear.all\n end",
"def question_params\n params.require(:question).permit(:criterion, :year)\n end",
"def year_params\n params.require(:year).permit(:id)\n end",
"def research_courses\n Course.find :all, :conditions => { :ts_year => year, :ts_quarter => quarter_code, :ts_research => true }\n end",
"def show_publication_year? _field_config, doc\n doc['journal_title_ts'].blank? && doc['conf_title_ts'].blank? && doc['publisher_ts'].blank?\n end",
"def answer_exam\n if params[:year_exam] \n questions ||= Question.where(year: params[:year_exam])\n assert(questions.kind_of?(Question))\n else\n questions ||= Question.all\n assert(questions.kind_of?(Question))\n end\n\n if !questions.empty?\n auxiliar_exam ||= push_questions_auxiliar(questions)\n @exam = push_questions(auxiliar_exam)\n else\n redirect_to_back(select_exam_path)\n if params[:year_exam]\n flash[:danger] = t(:year_exam_not_found)\n else\n flash[:danger] = t(:exam_not_found)\n end\n end\n end",
"def validate_year_not_submitted_yet(record, attribute, year)\n incident = record.incident.target\n\n # Only perform this check if the GeneralInfo model has an associated incident\n # (this may not be the case, i.e. when the incident is being created via bulk upload).\n if incident.present?\n submitted_years = AgencyStatus.find_or_create_by_ori(incident.ori)\n .complete_submission_years\n\n if submitted_years.include? year\n record.errors[attribute] << \"ORI #{ori} has already submitted for this year\"\n end\n end\n end",
"def appropriate_year?\n if released\n if release_year.nil?\n errors.add(:release_year, \"Release year must exist if it is released\")\n elsif release_year > Time.now.year\n errors.add(:release_year, \"Release year must be less than or equal to the current year\")\n end\n end\n end",
"def index\n @years = Year.all\n end",
"def index\n @years = Year.all\n end",
"def yearly_info_params\n params.require(:yearly_info).permit(:essay, :comments, :year, :role)\n end",
"def new\n if @organism.periods.any?\n @disable_start_date = true\n start_date = (@organism.periods.order(:close_date).last.close_date) +1\n # begin_year and end_year limit the select in the the view\n @begin_year = start_date.year\n @end_year = @begin_year + 2 #\n else\n @disable_start_date = false\n @begin_year = @end_year = nil\n start_date = Date.today.beginning_of_year # on propose une date d'ouverture par défaut\n end\n close_date = start_date.years_since(1)-1 # et une date de clôture probable\n @period = @organism.periods.new(:start_date=>start_date, :close_date=>close_date)\n \n end",
"def create\n @year = Year.new(year_params)\n\n respond_to do |format|\n if @year.save\n format.html { redirect_to @year, notice: 'Year was successfully created.' }\n format.json { render :show, status: :created, location: @year }\n else\n format.html { render :new }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @year = Year.new(year_params)\n\n respond_to do |format|\n if @year.save\n format.html { redirect_to @year, notice: 'Year was successfully created.' }\n format.json { render :show, status: :created, location: @year }\n else\n format.html { render :new }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def grad_year_params\n params.require(:grad_year).permit(:year)\n end",
"def match_year\n @year ? { 'fiscal_quarter_id' => /^#{@year}/i } : {}\n end",
"def new\n @test = Test.new\n @subjects = []\n @quarters = []\n courses = Course.all\n courses.each do |s|\n @subjects << s.subject if s.subject\n @quarters << s.quarter if s.quarter\n end\n #@subjects = [Course.first.subject]\n #@quarters = ['Fall 2012']\n @grades = ['A+','A', 'A-', 'B+', 'B', 'B-', 'C+', 'C', 'C-']\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @test }\n end\n end",
"def set_year\n @year = Year.friendly.find(params[:id])\n end",
"def index\n authorize! :manage, BookFine\n if params[:year].present?\n @academic_year = AcademicYear.find params[:year]\n else\n @academic_year = AcademicYear.current\n end\n\n # TODO: Optimize with eager loading\n # @students = Student.eager_load([:book_fines,:grade_sections_students]).where(\"book_fines.academic_year_id = ? and grade_sections_students.academic_year_id = ?\", @academic_year.id, @academic_year.id)\n\n @book_fines = BookFine.where(academic_year:@academic_year).order(:student_id)\n @students = Student.joins(:book_fines)\n .where(book_fines: {academic_year: @academic_year})\n .uniq\n .eager_load(:grade_sections_students)\n .where('grade_sections_students.academic_year_id = ?', @academic_year.id)\n .eager_load(:grade_sections)\n .order(:name)\n @grade_sections = GradeSection.joins(:grade_sections_students)\n .where('grade_sections_students.student_id in (SELECT DISTINCT \"students\".id FROM \"students\" INNER JOIN \"book_fines\" ON \"book_fines\".\"student_id\" = \"students\".\"id\" WHERE \"book_fines\".\"academic_year_id\" = ?) and grade_sections_students.academic_year_id = ?', @academic_year.id, @academic_year.id)\n .sort.uniq\n @dollar_rate = Currency.dollar_rate\n if params[:st].present?\n @student = Student.where(id:params[:st]).take\n @book_fines = @book_fines.where(student_id:params[:st])\n @total_idr_amount = @book_fines.reduce(BigDecimal.new(\"0\")){|sum,f| sum + ( f.currency==\"USD\" ? f.fine * @dollar_rate : f.fine )}\n tag = Digest::MD5.hexdigest \"#{@academic_year.id}-#{@student.id}-#{@total_idr_amount}\"\n # Take the last created invoice with the tag, or create one if none found\n invoice = Invoice.where(tag: tag).order('created_at DESC').take\n @paid = invoice.paid if invoice.present?\n end\n if params[:s].present?\n @grade_section = GradeSection.where(id:params[:s]).take\n @book_fines = @book_fines.where(\"student_id in\n (SELECT students.id FROM students INNER JOIN grade_sections_students\n ON grade_sections_students.student_id = students.id\n WHERE grade_sections_students.grade_section_id = ?\n AND grade_sections_students.academic_year_id = ?)\", @grade_section.id, @academic_year.id)\n end\n @book_fines = @book_fines.includes([:student,:old_condition,:new_condition]).includes(:book_copy => :book_edition)\n end",
"def create\n @year = Year.new(year_params)\n\n respond_to do |format|\n if @year.save\n format.html { redirect_to @year, notice: 'Year was successfully created.' }\n format.json { render action: 'show', status: :created, location: @year }\n else\n format.html { render action: 'new' }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def release_not_future_year\n #invalid, if released and release_year is greater than current year\n if release_year && release_year.to_i > Time.now.strftime(\"%Y\").to_i\n errors.add(:release_year, \"cannot be in the future\")\n end\n end",
"def schoolyear_params\n params.require(:schoolyear).permit(:name)\n end",
"def set_year\n @year = Year.find(params[:id])\n end",
"def set_built_year\n begin\n @make = Make.find_by slug: params[:make_id]\n @make = Make.find_by id: params[:make_id] if @make.nil?\n @car_model = @make.car_models.where(id: params[:car_model_id]).first\n @car_model = @make.car_models.where(slug: params[:car_model_id]).first if @car_model.nil?\n \n @built_year = @car_model.built_years.where(id: params[:id]).first \n @built_year = @car_model.built_years.where(year: params[:id]).first if @built_year.nil?\n rescue\n redirect_to searches_path\n return false\n end\n redirect_to searches_path if @built_year.nil?\n end",
"def facet_year_group_for_solr\n result = \"\"\n years = associated_years\n logger.debug \"CHECKING: #{years}\"\n current_year = Time.now.year\n if years.length > 0\n #logger.debug \"YGFS:T1\"\n for year_string in years\n # logger.debug \"YGFS:T2\"\n year = year_string.to_i\n if year == current_year\n # logger.debug \"YGFS:T3 - current year match\"\n result << \"current \"\n elsif year == (current_year+1)\n # logger.debug \"YGFS:T4 - next year match\"\n result << \"next \"\n elsif year < (current_year)\n # logger.debug \"YGFS:T5 - previous years\"\n result << \"previous \"\n elsif year >> (current_year + 1)\n # logger.debug \"YGFS:T6 - future past next\"\n result << \"future \"\n end\n end\n #no years found\n else \n # logger.debug \"YGFS:T7 - none found\"\n result = \"none \"\n end\n \n # logger.debug \"YGFS: #{years} => #{result}\"\n result.strip.split(' ').uniq.sort.join(' ')\n end",
"def new\n @curriculum = Curriculum.new\n authorize! :create, @curriculum\n \n @terms = Term.order(:start_year).all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @curriculum }\n end\n end",
"def set_yearly_info\n @yearly_info = YearlyInfo.find(params[:id])\n end",
"def index\n @built_years = BuiltYear.all\n end",
"def bib_results_filter(result, year)\n missed_years = []\n result.each do |r|\n item = r.fetch\n item.fetched = Date.today.to_s\n return { ret: item } if !year\n\n item.date.select { |d| d.type == \"published\" }.each do |d|\n return { ret: item } if year.to_i == d.on(:year)\n\n missed_years << d.on(:year)\n end\n end\n { years: missed_years }\n end",
"def set_year\n @year = params[:year].blank? ? @today.year : params[:year].to_i\n end",
"def show\n @gss = @grade_section.students_for_academic_year(params[:year])\n end",
"def fiscal_year_params\n params.require(:fiscal_year).permit(:client_id, :year, :transactions)\n end",
"def year?\n @year\n end",
"def year_params\n params.require(:year).permit(:value)\n end",
"def populate(year, quarter)\n\n # make connection to db\n sql = ActiveRecord::Base.connection();\n\n # Process DB specific code\n sysdateFunction = \"SYSDATE()\"\n if ActiveRecord::Base::connection.is_a?(ActiveRecord::ConnectionAdapters::SQLServerAdapter)\n sysdateFunction = \"GETDATE()\"\n end\n \n # test if year/quarter already exists\n #count, dummy = sql.execute(\"SELECT COUNT(*), 0 FROM enclavequarters WHERE enclaveYear=#{year} AND enclaveQuarter=#{quarter}\").fetch_row\n count = sql.select_value(\"SELECT COUNT(*) FROM enclavequarters WHERE enclaveYear=#{year} AND enclaveQuarter=#{quarter}\")\n count = ((count != nil) ? count : 0)\n \n status = \"Failed\"\n if (count.to_i == 0) then\n\n # make sure that all enclavecontrol records have the quarter set\n #count = sql.execute(\"UPDATE enclavecontrols ec SET ec.enclavequarter=(SELECT enclaveQuarter FROM enclavequarters eq WHERE eq.id = ec.enclavequarter_id)\")\n count = sql.execute(\"UPDATE enclavecontrols SET enclavequarter=(SELECT enclaveQuarter FROM enclavequarters eq WHERE eq.id = enclavequarter_id)\")\n\n # get setup values\n #oldYear, dummy = sql.execute(\"SELECT MAX(enclaveYear), 0 FROM enclavequarters\").fetch_row\n oldYear = sql.select_value(\"SELECT MAX(enclaveYear) FROM enclavequarters\")\n #oldQuarter, dummy = sql.execute(\"SELECT MAX(enclaveQuarter), 0 FROM enclavequarters WHERE enclaveYear = #{oldYear}\").fetch_row\n oldQuarter = sql.select_value(\"SELECT MAX(enclaveQuarter) FROM enclavequarters WHERE enclaveYear = #{oldYear}\")\n #sysDate, dummy = sql.execute(\"SELECT SYSDATE()\").fetch_row\n sysDate = sql.select_value(\"SELECT #{sysdateFunction}\")\n conf = Configvalue.where(:name => :controlrevision).first\n controlRev = conf.ivalue\n\n # populate enclavecontrols for quarter/year with matching data from the previous quarter/year (only populate for active enclaves)\n enclvs = Enclave.where(\"active = 1\")\n enclvs.each do |enc|\n \n #count = sql.execute(\"INSERT INTO enclavequarters (enclave_id, enclaveQuarter, enclaveYear, created_at, updated_at) VALUES (#{enc.id}, #{quarter}, #{year}, '#{sysDate}', '#{sysDate}')\")\n #count = sql.execute(\"INSERT INTO enclavequarters (enclave_id, enclaveQuarter, enclaveYear, created_at, updated_at) VALUES (#{enc.id}, #{quarter}, #{year}, #{sysdateFunction}, #{sysdateFunction})\")\n count = sql.execute(\"INSERT INTO enclavequarters (enclave_id, enclaveQuarter, enclaveYear) VALUES (#{enc.id}, #{quarter}, #{year})\")\n count = sql.execute(\"UPDATE enclavequarters SET created_at=#{sysdateFunction} WHERE created_at IS NULL\")\n count = sql.execute(\"UPDATE enclavequarters SET updated_at=#{sysdateFunction} WHERE updated_at IS NULL\")\n #eqid, dummy = sql.execute(\"SELECT id FROM enclavequarters WHERE enclaveQuarter = #{quarter} AND enclaveYear = #{year} AND enclave_id = #{enc.id}\").fetch_row\n eqid = sql.select_value(\"SELECT id FROM enclavequarters WHERE enclaveQuarter = #{quarter} AND enclaveYear = #{year} AND enclave_id = #{enc.id}\")\n sqlstring = \"INSERT INTO enclavecontrols (enclave_id, enclaveYear, cybercontrol_id, enclavequarter_id, enclaveQuarter, RMF, SSPImplementationStatus, SSPImplementationDescription, \"\n sqlstring += \"implementingDocumentationOrArticfacts, deviationIdentifier, testMethod, testProcedure, plannedTestDate, scheduledTestYear, actualTestDate, testResult, testResultDescription, \"\n sqlstring += \"assessorName, cAndADoc, controlReference, created_at, updated_at) SELECT #{enc.id}, #{year}, cybercontrol_id, #{eqid}, #{quarter}, RMF, SSPImplementationStatus, SSPImplementationDescription, \"\n sqlstring += \"implementingDocumentationOrArticfacts, deviationIdentifier, testMethod, testProcedure, plannedTestDate, scheduledTestYear, actualTestDate, testResult, testResultDescription, \"\n #sqlstring += \"assessorName, cAndADoc, controlReference, '#{sysDate}', '#{sysDate}' FROM enclavecontrols WHERE enclave_id = #{enc.id} AND enclaveYear = #{oldYear} AND enclaveQuarter = #{oldQuarter} \"\n sqlstring += \"assessorName, cAndADoc, controlReference, #{sysdateFunction}, #{sysdateFunction} FROM enclavecontrols WHERE enclave_id = #{enc.id} AND enclaveYear = #{oldYear} AND enclaveQuarter = #{oldQuarter} \"\n count = sql.execute(sqlstring)\n end\n \n # Populate enclavecontrols for any new enclaves with matching data from the first enclave for the quarter/year\n enclvs = Enclave.where(\"active = 1 AND id NOT IN (SELECT enclave_id FROM enclavecontrols WHERE enclaveYear = #{oldYear} AND enclaveQuarter = #{oldQuarter})\")\n enclvs.each do |enc|\n # get the id of the first enclave with the new quarter/year\n #myid, dummy = sql.execute(\"SELECT MIN(enclave_id), 0 FROM enclavecontrols WHERE enclaveYear = #{year} AND enclaveQuarter = #{quarter}\").fetch_row\n myid = sql.select_value(\"SELECT MIN(enclave_id) FROM enclavecontrols WHERE enclaveYear = #{year} AND enclaveQuarter = #{quarter}\")\n # insert records for new enclave\n sqlstring = \"INSERT INTO enclavecontrols (enclave_id, enclaveYear, cybercontrol_id, enclavequarter_id, enclaveQuarter, RMF, SSPImplementationStatus, SSPImplementationDescription, \"\n sqlstring += \"implementingDocumentationOrArticfacts, deviationIdentifier, testMethod, testProcedure, plannedTestDate, scheduledTestYear, actualTestDate, testResult, testResultDescription, \"\n sqlstring += \"assessorName, cAndADoc, controlReference, created_at, updated_at) SELECT #{enc.id}, #{year}, cybercontrol_id, enclavequarter_id, #{quarter}, RMF, SSPImplementationStatus, SSPImplementationDescription, \"\n sqlstring += \"implementingDocumentationOrArticfacts, deviationIdentifier, testMethod, testProcedure, plannedTestDate, scheduledTestYear, actualTestDate, testResult, testResultDescription, \"\n #sqlstring += \"assessorName, cAndADoc, controlReference, '#{sysDate}', '#{sysDate}' FROM enclavecontrols WHERE enclave_id = #{myid} AND enclaveYear = #{year} AND enclaveQuarter = #{quarter} \"\n sqlstring += \"assessorName, cAndADoc, controlReference, #{sysdateFunction}, #{sysdateFunction} FROM enclavecontrols WHERE enclave_id = #{myid} AND enclaveYear = #{year} AND enclaveQuarter = #{quarter} \"\n count = sql.execute(sqlstring)\n end\n status = \"Finished - Adding Quarter/Year (#{quarter}/#{year}).\"\n else\n status = \"Failed - Quarter/Year (#{quarter}/#{year}) already exists!\"\n end\n \n status\n \n end",
"def create\n study_period_params.permit!\n @study_period = StudyPeriod.new(study_period_params)\n @study_period.study_year = @year\n\n respond_to do |format|\n if @study_period.save\n format.html { redirect_to new_study_year_study_process_graphic_path(current_user.current_year, @study_period), notice: 'Учебный отрезок успешно создан.' }\n format.json { render action: 'show', status: :created, location: @study_period }\n else\n format.html { render action: 'new' }\n format.json { render json: @study_period.errors, status: :unprocessable_entity }\n end\n end\n end",
"def team_year_params\n params.require(:team_year).permit(:athlete_id, :team_id, :year)\n end",
"def pupil_has_year_params\n params.require(:pupil_has_year).permit(:year_id, :payment_id, :pupil_id, :adjusted_price)\n end",
"def uni_years\n @uni_years = UniYear.where(university_id: params[:university_id])\n \n respond_to do |format|\n format.json { render json: @uni_years }\n end\n end",
"def first_eligible_qts_award_year(claim_year = nil)\n claim_year ||= configuration.current_academic_year\n claim_year - ELIGIBLE_CAREER_LENGTH\n end",
"def index\n @grad_years = GradYear.all\n end",
"def index\n @schoolyears = Schoolyear.all\n end",
"def index\n @firework_years = FireworkYear.all\n end",
"def fill_in_nil_fields_by_guess\n # Fiscal year\n # FIXME: year of fiscal_period_end_date may not be exactly the same with :year\n if @results[:year].nil?\n @results[:year] = Date.parse(@results[:fiscal_period_end_date]).year.to_i\n add_to_guess_fields(:year)\n end\n\n # Fiscal period\n if @results[:fiscal_period].nil?\n if @results[:document_type] == '10-K'\n @results[:fiscal_period] = 'FY'\n elsif @results[:document_type] == '10-Q'\n\n date = Date.parse(@results[:fiscal_period_end_date])\n\n if date.month == 3 && date.day == 31\n @results[:fiscal_period] = 'Q1'\n elsif date.month == 6 && date.day == 30\n @results[:fiscal_period] = 'Q2'\n elsif date.month == 9 && date.day == 30\n @results[:fiscal_period] = 'Q3'\n elsif date.month == 12 && date.day == 31\n @results[:fiscal_period] = 'Q4'\n else\n # TODO...\n end\n else\n raise ParseError, \"Wrong document type: #{@results[:document_type]}\"\n end\n add_to_guess_fields(:fiscal_period)\n end\n end",
"def load_view\n\n @fiscal_years = (current_fiscal_year_year..current_fiscal_year_year + 49).map{ |y| [fiscal_year(y), y] }\n render params[:view]\n\n end",
"def active_school_year\n load_school_years\n @active \n end",
"def sponsor_year_params\n params.require(:sponsor_year).permit(:sponsor_id, :year_id, :sponsor_level_id)\n end",
"def load_all_years\n @all_years = FiscalYear.order(:year)\n @year = FiscalYear.find_by_year(cookies[:year])\n @year = @current_fiscal_year if @year.blank?\n end",
"def academic_information_params\n params.require(:academic_information).permit(:b_date, :e_date, :description, :grade, :academic_degree_id, :course, :institution_id)\n end",
"def qts_award_year_answer\n year_for_answer = MathsAndPhysics.first_eligible_qts_award_year(claim_academic_year)\n year_for_answer -= 1 if awarded_qualified_status_before_cut_off_date?\n\n I18n.t(\"answers.qts_award_years.#{qts_award_year}\", year: year_for_answer.to_s(:long))\n end",
"def create\n @firework_year = FireworkYear.new(firework_year_params)\n\n respond_to do |format|\n if @firework_year.save\n format.html { redirect_to @firework_year, notice: 'Firework year was successfully created.' }\n format.json { render :show, status: :created, location: @firework_year }\n else\n format.html { render :new }\n format.json { render json: @firework_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def view_missing_fields\n\n # Update these to the proper values that you are interesting in\n student_id = 1321\n module_item_id = 3772\n course_id = 27\n module_name = 'Network Like a Pro'\n\n tag = ContentTag.where(:id => module_item_id, :context_id => course_id, :context_type => 'Course', :content_type => 'WikiPage').first\n page = WikiPage.find(tag.content_id)\n course = Course.find(course_id)\n get_the_page_id = page.id\n participation_assignment = course.assignments.active.where(:title => \"Course Participation - #{module_name}\").first\n\n puts \"### VIEWIING MISSING FIELDS IN COURSE PARTICIPATION GRADES FOR: https://portal.bebraven.org/courses/#{course_id}/pages/#{page.url}?module_item_id=#{module_item_id}\"\n\n\n user = User.find(student_id)\n puts \"### username = #{user.name}, userid = #{user.id},\"\n se = course.student_enrollments.active.where(:user_id => student_id).first\n names = {}\n missing_names = {}\n count = 0\n filled_count = 0\n selector = 'input[data-bz-retained]:not(.bz-optional-magic-field),textarea[data-bz-retained]:not(.bz-optional-magic-field)'\n page_html = page.body\n doc = Nokogiri::HTML(page_html)\n doc.css(selector).each do |o|\n n = o.attr('data-bz-retained')\n next if names[n]\n next if o.attr('type') == 'checkbox'\n names[n] = true\n count += 1\n found = RetainedData.where(:user_id => student_id, :name => n) \n filled_count += 1 if found.any?\n missing_names[n] = true if !found.any?\n end\n\n puts \"### names = #{names.inspect}, missing_names = #{missing_names.inspect}\"\n\nend",
"def new\n @all_registration = AllRegistration.new\n @all_registration.reg_no=number_retrive(\"REG\")\n @college_master = CollegeMaster.last\n @years = which_category.years.find(:all)\n # @year1.map!(&:year)\n @semesters = \"B-Tech\".include?(@college_master.category) ? @category.semesters : \"\" unless @college_master.blank?\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @all_registration }\n end\n end",
"def index\n @club_awards = ClubAward.all\n @years = ClubAward.pluck(:year).map{|x| x}.uniq.sort\n @award_types = AwardType.all\n end",
"def index\n @variables = Variable.all\n @years = {'2011' => '', '2012' => '', '2013' => '', '2014' => ''}\n end",
"def fiscal_years\n get_fiscal_years\n end",
"def conference_detail_params\n params.require(:conference_detail).permit(:academic_year, :sem, :conference_name, :conference_organizer, :address, :city, :conference_type, :isbn, :paper_title, :one_author_name, :one_department, :one_organization, :one_others, :two_author_name, :two_department, :two_organization, :two_others, :three_author_name, :three_department, :three_organization, :three_others, :volume_number, :issue_number, :page_start, :page_end, :date_submission, :date_acceptance, :date_published, :paper_abstract, :user_id, :paper)\n end",
"def update\n respond_to do |format|\n if @acedemic_year.update(acedemic_year_params)\n format.html { redirect_to @acedemic_year, notice: 'Academic year was successfully updated.' }\n format.json { render :show, status: :ok, location: @acedemic_year }\n else\n format.html { render :edit }\n format.json { render json: @acedemic_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def choose\n if params.has_key?(:year) && !params[:year].empty? && params.has_key?(:course) && !params[:course].empty? \n \t @year_of_study = params[:year]\n @course = params[:course]\n @course_obj = Course.find_by_id(@course) \n else\n redirect_to career_search_path\n end\n end",
"def new\r\n @academic_work=AcademicWork.find(params[:academic_work_id])\r\n @disciplines_study = @academic_work.disciplines_studies.build\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @disciplines_study }\r\n end\r\n end",
"def update\n study_period_params.permit!\n @study_period.study_year = @year\n respond_to do |format|\n if @study_period.update(study_period_params)\n format.html { redirect_to study_year_study_periods_path(current_user.current_year), notice: 'Учебный отрезок успешно обновлен.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @study_period.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @schedule_entry = ScheduleEntry.new\n handled_sections_id = current_user.sections.map {|section| section.id}\n @students = Student.where(:section_id => handled_sections_id).page(params[:page])\n @interview_types = InterviewType.all\n @period = Period.find(params[:period_id])\n end",
"def update_dates\n if params[:financial_year].present?\n # puts params.inspect\n # puts params[:financial_year].inspect\n @start_date, @end_date = FinancialYear.fetch_dates(params[:financial_year])\n render :update do |page|\n page.replace_html \"date_range_section\", :partial => \"finance_reports/filters/date_range\"\n end\n end\n end",
"def view_results\n \tif params.has_key?(:year) && !params[:year].empty? && params.has_key?(:course) && !params[:course].empty? && params.has_key?(:chosen_modules) && !params[:chosen_modules].empty? \n \t\t @year_of_study = params[:year]\n\t @course = params[:course]\n\t @chosen_modules = params[:chosen_modules]\n\t @course_obj = Course.find_by_id(@course) \n\n\t @uni_modules_array = []\n\t @chosen_modules.each do |unimodule|\n\t \tcurrent_uni_module = UniModule.find_by_code(unimodule)\n\t \tif !current_uni_module.nil?\n\t \t\t@uni_modules_array << current_uni_module\n\t \tend\n\t end\t\n\t @careers_found = get_career_tags_from_modules(@uni_modules_array)\n\n\telse\n\t\t#redirect_to \"/career-search/\"\n\tend\n end",
"def validate_year\n raise CarValidationErrors.new(\"Invalid Year\") unless (year >= 1960 && year < Date.today.year)\n end",
"def update\n @teaching = Teaching.find(params[:id])\n @period = @teaching.period\n period = Period.find_by_subperiod_and_year(params[:subperiod], params[:year])\n if period\n @teaching.period = period\n end\n respond_to do |format|\n if @teaching.update_attributes(params[:teaching])\n flash[:notice] = 'Insegnamento aggiornato con successo'\n format.html { redirect_to administration_teachings_url }\n format.js{render(:update) {|page| page.redirect_to(administration_teachings_url)}}\n else\n @graduate_courses = @current_user.graduate_courses\n @year = Period.find(:all, :select => \"DISTINCT year\")\n @subperiod = Period.find(:all, :select => \"DISTINCT subperiod\")\n format.html { render :action => \"edit\" }\n format.js{render :action => 'create.js.rjs'}\n end\n end\n end",
"def create\n @fiscal_year = FiscalYear.new(fiscal_year_params)\n\n respond_to do |format|\n if @fiscal_year.save\n format.html { redirect_to @fiscal_year, notice: 'Fiscal year was successfully created.' }\n format.json { render :show, status: :created, location: @fiscal_year }\n else\n format.html { render :new }\n format.json { render json: @fiscal_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n if params[:year].present?\n @filter = true\n if params[:extention].present?\n @teachers = @school.teachers.includes(:extension_of_tasks).where(extension_of_tasks:{year:params[:year]})#.sort\n elsif params[:sk].present?\n @teachers = @school.teachers.includes(:sks).where(sks:{year:params[:year]})\n else\n # @teachers = @school.teachers.includes(:sks, :extension_of_tasks)\n @teachers = @school.teachers.joins(\"RIGHT JOIN sks ON sks.teacher_id = teachers.id RIGHT JOIN extension_of_tasks ON extension_of_tasks.teacher_id = teachers.id\").where(\"sks.year = ? OR extension_of_tasks.year = ?\", params[:year], params[:year]).uniq\n # @teachers = @school.teachers#.includes(:sks, :extension_of_tasks).where(\"sks.year = ? OR extension_of_tasks.year = ?\"\n # @teachers = @school.teachers.includes(:sks, :extension_of_tasks).where(extension_of_tasks:{year:params[:year]}) if @teachers.blank?\n end\n else\n @teachers = @school.teachers.includes(:sks, :extension_of_tasks)\n end\n end",
"def standard_books(year)\n grade_section_books = StandardBook.where(academic_year:year,grade_section_id:self.id)\n if grade_section_books.count > 1\n grade_section_books.includes(:book_edition)\n #BookTitle.joins(:standard_books).where(standard_books: {grade_section_id:self.id, academic_year_id:AcademicYear.current_id})\n else\n StandardBook.where(academic_year:year,grade_level_id:self.grade_level_id).includes(:book_edition)\n #BookTitle.joins(:standard_books).where(standard_books: {grade_level_id:self.grade_level_id, academic_year_id:AcademicYear.current_id})\n end\n end",
"def new\n @year_insurances = YearInsurance.active.joins(:family)\n @reimbursement = Reimbursement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reimbursement }\n end\n end",
"def award_form\n if award_year.present?\n form_class = if self.class.const_defined?(award_form_class_name(award_year.year))\n self.class.const_get(award_form_class_name(award_year.year))\n elsif self.class.const_defined?(award_form_class_name(AwardYear.current.year))\n self.class.const_get(award_form_class_name(AwardYear.current.year))\n elsif Rails.env.test?\n year = Date.current.year\n if self.class.const_defined?(award_form_class_name(year + 1))\n self.class.const_get(award_form_class_name(year + 1))\n elsif self.class.const_defined?(award_form_class_name(year))\n self.class.const_get(award_form_class_name(year))\n end\n else\n raise ArgumentError, \"Can not find award form for the application\"\n end\n\n if award_type.present?\n unless form_class.respond_to?(award_type)\n form_class = self.class.const_get(award_form_class_name(2018))\n end\n form_class.public_send(award_type)\n end\n end\n end",
"def signature_year_params\n params.require(:signature_year).permit(:year)\n end",
"def new\n @events_by_year = EventsByYear.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @events_by_year }\n end\n end",
"def should_have_year?\n self.released\n end",
"def set_firework_year\n @firework_year = FireworkYear.find(params[:id])\n end",
"def expanded_years\n @expanded_years ||= work.date_of_work.collect { |date_of_work| years_for_date_of_work(date_of_work) }.flatten\n end",
"def create\n @built_year = BuiltYear.new(built_year_params)\n\n respond_to do |format|\n if @built_year.save\n format.html { redirect_to @built_year, notice: 'Built year was successfully created.' }\n format.json { render action: 'show', status: :created, location: @built_year }\n else\n format.html { render action: 'new' }\n format.json { render json: @built_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def annual_survey3_params\n params.require(:annual_survey3).permit(:Year, :Number_of_Factories_Agro_based, :Number_of_Factories_Non_Agro_based, :Total_Number_of_Factories, :Number_of_Factories_in_Operation_Agro_based, :Number_of_Factories_in_Operation_Non_Agro_Based, :Total_Number_of_Factories_in_Operation, :Percentage_of_Agro_based, :Percentage_of_Non_Agro_based, :Percentage_of_Total_Factories, :Percentage_of_Operation_Agro_based, :Percentage_of_Operation_Non_Agro_Based, :Percentage_of_Total_Factories_in_Operation, :Indicator)\n end",
"def years_needed\n 30\n end"
] |
[
"0.6009845",
"0.5981427",
"0.5612071",
"0.56035954",
"0.5588575",
"0.55849165",
"0.55576694",
"0.5552235",
"0.55222046",
"0.55044025",
"0.5484386",
"0.5467337",
"0.5418024",
"0.53917205",
"0.5362859",
"0.53558177",
"0.5354223",
"0.53499496",
"0.53434473",
"0.5319332",
"0.5310734",
"0.5302195",
"0.5298816",
"0.5298626",
"0.52904564",
"0.5276891",
"0.5273471",
"0.52525496",
"0.5252213",
"0.5239393",
"0.52298456",
"0.52298456",
"0.52293265",
"0.52108186",
"0.519909",
"0.519909",
"0.51986074",
"0.5195275",
"0.5182806",
"0.517875",
"0.51645094",
"0.51641303",
"0.51594484",
"0.51571006",
"0.51559895",
"0.515293",
"0.514601",
"0.5145933",
"0.5142841",
"0.51380455",
"0.51217484",
"0.511381",
"0.5101124",
"0.50949943",
"0.50844187",
"0.5084054",
"0.50761104",
"0.50751996",
"0.50606143",
"0.50595844",
"0.5055856",
"0.5051266",
"0.50487185",
"0.5043913",
"0.50415456",
"0.5040278",
"0.5034625",
"0.5023102",
"0.5022738",
"0.5021109",
"0.5021043",
"0.5020162",
"0.5018558",
"0.5016703",
"0.5011824",
"0.500097",
"0.49969855",
"0.49965277",
"0.49928504",
"0.49915",
"0.49907905",
"0.49870646",
"0.49859756",
"0.498556",
"0.49833816",
"0.49795407",
"0.49773416",
"0.497693",
"0.4976366",
"0.49721026",
"0.49632958",
"0.49592635",
"0.49530223",
"0.49499026",
"0.49439767",
"0.49426395",
"0.4939689",
"0.49378344",
"0.49360827",
"0.49350974",
"0.4934487"
] |
0.0
|
-1
|
GET /informacoes GET /informacoes.json
|
def index
@informacoes = Informacao.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @acoes = Acao.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @acoes }\n end\n end",
"def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end",
"def show\n @colegio = Colegio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colegio }\n end\n end",
"def show\n @oferta_academica = OfertaAcademica.find(params[:id])\n\n render json: @oferta_academica\n end",
"def show\n @indicacao = Indicacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicacao }\n end\n end",
"def index\n @instituicoes = Instituicao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instituicoes }\n end\n end",
"def show\n @indicativo = Indicativo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicativo }\n end\n end",
"def index\n @contas = Conta.all\n respond_to do |format|\n format.json { render json: @contas.to_json, status: :ok }\n end\n end",
"def show\n @areco = Areco.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @areco }\n end\n end",
"def index\n @conseilles = Conseille.all\n respond_to do |format|\n format.html\n format.json { render json: @conseilles}\n end\n end",
"def show\n @incucai = Incucai.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @incucai }\n end\n end",
"def index\n @anuncios = Anuncio.all\n render json: @anuncios, status: :ok\n end",
"def index\n @cofis = Cofi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cofis }\n end\n end",
"def index\n \n @controles_asistencias = ControlAsistencia.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @controles_asistencias }\n end\n end",
"def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"def show\n @caixa = Caixa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caixa }\n end\n end",
"def index\n @asociados = Asociado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @asociados }\n end\n end",
"def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end",
"def index\n @concursos = Concurso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @concursos }\n end\n end",
"def show\n @ejercicio = Ejercicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ejercicio }\n end\n end",
"def index\n @ores = Ore.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ores }\n end\n end",
"def index\n @enderecos = Endereco.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enderecos }\n end\n end",
"def show\n @cofi = Cofi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cofi }\n end\n end",
"def show\n @anuncio = Anuncio.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @anuncio }\n end\n end",
"def index\r\n @imobiliarias = Imobiliaria.all\r\n\r\n respond_to do |format|\r\n # format.html # index.html.erb\r\n format.json { render json: @imobiliarias }\r\n end\r\n end",
"def show\n @coisa = Coisa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @coisa }\n end\n end",
"def show\n @bico = Bico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bico }\n end\n end",
"def index\n @acuerdos = Acuerdo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @acuerdos }\n end\n end",
"def index\n @estadios = Estadio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @estadios }\n end\n end",
"def index\n @cooperativas = Cooperativa.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cooperativas }\n end\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end",
"def show\r\n @imobiliaria = Imobiliaria.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.json { render json: @imobiliaria }\r\n end\r\n end",
"def show\n @consumo = Consumo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @consumo }\n end\n end",
"def show\n @asociado = Asociado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asociado }\n end\n end",
"def index\n @ivas = Iva.all\n\n render json: @ivas\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tecnico }\n end\n end",
"def index\n @ativo_outros = AtivoOutro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ativo_outros }\n end\n end",
"def show\n @comentario = Comentario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comentario }\n end\n end",
"def show\n @comentario = Comentario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comentario }\n end\n end",
"def index\n @eicons = Eicon.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @eicons }\n end\n end",
"def show\n @colegiatura = Colegiatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colegiatura }\n end\n end",
"def show\n @informe = Informe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @informe }\n end\n end",
"def show\n\trespond_to do |format|\n format.json { render json: @conta.to_json, status: :ok }\n end\n end",
"def show\n @lista_contato = ListaContato.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lista_contato }\n end\n end",
"def show\n @concurso = Concurso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concurso }\n end\n end",
"def index\n @cadavres = Cadavre.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cadavres }\n end\n end",
"def show\n @tipo_convenio = TipoConvenio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_convenio }\n end\n end",
"def index\n @premios = Premio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @premios }\n end\n end",
"def index\n @detalles = Detalle.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @detalles }\n end\n end",
"def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end",
"def index\n @assuntos = Assunto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assuntos }\n end\n end",
"def index\n @itineraires = Itineraire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @itineraires }\n end\n end",
"def show\n @mecanicacomplejo = Mecanicacomplejo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mecanicacomplejo }\n end\n end",
"def show\n @escola = Escola.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @escola }\n end\n end",
"def show\n @inscrito = Inscrito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inscrito }\n end\n end",
"def index\n @listas_contato = ListaContato.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listas_contato }\n end\n end",
"def index\n @ofertas = Oferta.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ofertas }\n end\n end",
"def show\n @central_correio = CentralCorreio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @central_correio }\n end\n end",
"def index\n @tacos = Taco.all\n\n respond_to do |format|\n format.html { render :index }\n format.json { render @tacos }\n end\n end",
"def index\n @clientes = Cliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientes }\n end\n end",
"def show\n @agronomiaquimica = Agronomiaquimica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @agronomiaquimica }\n end\n end",
"def index\n @bitacoras = Bitacora.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bitacoras }\n end\n end",
"def show\n @aactio = Aactio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aactio }\n end\n end",
"def index\n @empresas = Empresa.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empresas }\n end\n end",
"def index\n @ideas = Idea.current_ideas_for(current_user).entries\n respond_with(@ideas) do |format|\n format.json { render json: @ideas }\n end\n end",
"def index\n @municipios = Municipio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @municipios }\n end\n end",
"def show\n @nabe = Nabe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nabe }\n end\n end",
"def show\n @etnia = Etnia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etnia }\n end\n end",
"def index\n @interno_unidads = InternoUnidad.all\n render json: @interno_unidads\n end",
"def show\n @accesorio = Accesorio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @accesorio }\n end\n end",
"def show\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @asiento }\n end\n end",
"def show\n @historial = Historial.find(params[:id])\n @receta = Recete.histori(@historial.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial }\n end\n end",
"def show\n @correo = Correo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @correo }\n end\n end",
"def show\n @correo = Correo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @correo }\n end\n end",
"def show\n @calificacione = Calificacione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @calificacione }\n end\n end",
"def informacoes\n empregado = Empregado.find(params[:empregado_id])\n solicitacoes = Solicitacao.where(empregado_id: parametros[:empregado_id], mes_ano: parametros[:mes_ano])\n valor_ja_solicitado = solicitacoes.sum(&:valor)\n salario_disponivel = (empregado.salario || 0) - valor_ja_solicitado - solicitacoes.sum(&:taxa) # FIXME Romuloset - taxas\n\n render json: {\n valor_ja_solicitado: valor_ja_solicitado,\n salario_disponivel: salario_disponivel\n }\n end",
"def show\n @causale = Causale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @causale }\n end\n end",
"def index\n @encriptions = Encription.all\n respond_to do |format|\n \n format.html \n format.json { render json: @encriptions }\n \n end\n end",
"def show\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @oferta }\n end\n end",
"def show\n @instituicao = Instituicao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instituicao }\n end\n end",
"def index\n render json: @fiestas\n end",
"def show\r\n @asistencia = Asistencia.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @asistencia }\r\n end\r\n end",
"def index\n find_dependencias\n respond_to do |format|\n format.html\n format.json { render :json => @dependencias.to_json(:methods => :alias_or_fullname, :only => [:id, :codigo, :nombre])}\n\n end\n end",
"def show\n @articulo = Articulo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articulo }\n end\n end",
"def show\n @articulo = Articulo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articulo }\n end\n end",
"def show\n @articulo = Articulo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articulo }\n end\n end",
"def show\n @cegonha = Cegonha.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cegonha }\n end\n end",
"def index\n @preparatoria_o_universidad_de_origens = PreparatoriaOUniversidadDeOrigen.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preparatoria_o_universidad_de_origens }\n end\n end",
"def index\n @informacioncomercials = Informacioncomercial.all\n end",
"def index\n @status_de_la_inscripcions = StatusDeLaInscripcion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_inscripcions }\n end\n end",
"def index\n @contas = Conta.where(nil) #Inicia Escopo\n @contas = @contas.conta_numero(params[:contaNumero]) if params[:contaNumero].present?\n @contas = @contas.conta_descricao(params[:contaDescricao]) if params[:contaDescricao].present?\n @contas = @contas.agencia_numero(params[:agenciaNumero]) if params[:agenciaNumero].present?\n @contas = @contas.banco_id(params[:bancoId]) if params[:bancoId].present?\n\n @contas = @contas.paginate(:page => params[:page], :per_page => params[:per_page])\n respond_to do |format|\n format.html { render :index }\n format.json { render json: {contas: @contas.as_json(:include => [:banco], methods: [:conta, :agencia, :saldo]), total: @contas.total_entries}}\n end\n end",
"def index\n @socios = Socio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @socios }\n end\n end",
"def show\n @contratacao = Contratacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contratacao }\n end\n end",
"def index\n @anios = Anio.all\n end",
"def show\n @empresa_servicio = EmpresaServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @empresa_servicio }\n end\n end",
"def index\n @finalidad_cultivos = FinalidadCultivo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @finalidad_cultivos }\n end\n end",
"def new\n @incucai = Incucai.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @incucai }\n end\n end",
"def index\n @expedientes = Expediente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expedientes }\n end\n end",
"def show\n @cita = Cita.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cita }\n end\n end"
] |
[
"0.6734839",
"0.67044973",
"0.6600473",
"0.65711117",
"0.6565081",
"0.65589184",
"0.65585595",
"0.6537309",
"0.65300554",
"0.6513718",
"0.6507799",
"0.6490077",
"0.64828587",
"0.64579546",
"0.6457692",
"0.6450913",
"0.640981",
"0.6407589",
"0.63979065",
"0.63931197",
"0.6385103",
"0.6380023",
"0.63675785",
"0.63674027",
"0.63576883",
"0.6346896",
"0.6345188",
"0.6328923",
"0.6327292",
"0.630998",
"0.6307052",
"0.6307052",
"0.63055277",
"0.6301192",
"0.6288666",
"0.62680566",
"0.62658185",
"0.62606376",
"0.62537074",
"0.62537074",
"0.6240342",
"0.62336373",
"0.6230955",
"0.6229259",
"0.62283164",
"0.6219933",
"0.6218832",
"0.62137645",
"0.62059027",
"0.6201401",
"0.61981654",
"0.6191387",
"0.61862993",
"0.61861277",
"0.6185407",
"0.61785275",
"0.6167086",
"0.61662346",
"0.6163741",
"0.6154297",
"0.6149425",
"0.6144403",
"0.61403424",
"0.61347634",
"0.61345965",
"0.61318135",
"0.61225754",
"0.61108404",
"0.61079305",
"0.60946035",
"0.60939395",
"0.608952",
"0.6087834",
"0.6084481",
"0.60838985",
"0.6081264",
"0.60728824",
"0.60718465",
"0.60713905",
"0.6068675",
"0.6064589",
"0.6062849",
"0.6061087",
"0.6058852",
"0.60575384",
"0.60575384",
"0.60575384",
"0.6056133",
"0.6052542",
"0.6052253",
"0.60506725",
"0.60481143",
"0.6046538",
"0.60459924",
"0.6043425",
"0.60426253",
"0.6042073",
"0.6041842",
"0.60401857",
"0.6038832"
] |
0.7033731
|
0
|
GET /informacoes/1 GET /informacoes/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @indicativo = Indicativo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicativo }\n end\n end",
"def show\n @indicacao = Indicacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicacao }\n end\n end",
"def index\n @informacoes = Informacao.all\n end",
"def show\n @colegio = Colegio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colegio }\n end\n end",
"def index\n @instituicoes = Instituicao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instituicoes }\n end\n end",
"def show\n @incucai = Incucai.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @incucai }\n end\n end",
"def show\r\n @imobiliaria = Imobiliaria.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.json { render json: @imobiliaria }\r\n end\r\n end",
"def show\n @caixa = Caixa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caixa }\n end\n end",
"def show\n @tipo_convenio = TipoConvenio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_convenio }\n end\n end",
"def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end",
"def show\n @areco = Areco.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @areco }\n end\n end",
"def show\n @oferta_academica = OfertaAcademica.find(params[:id])\n\n render json: @oferta_academica\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end",
"def show\n @consumo = Consumo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @consumo }\n end\n end",
"def show\n @ejercicio = Ejercicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ejercicio }\n end\n end",
"def show\n @anuncio = Anuncio.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @anuncio }\n end\n end",
"def show\n @cofi = Cofi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cofi }\n end\n end",
"def show\n @bico = Bico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bico }\n end\n end",
"def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tecnico }\n end\n end",
"def show\n @coisa = Coisa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @coisa }\n end\n end",
"def index\n @acoes = Acao.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @acoes }\n end\n end",
"def show\n @comentario = Comentario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comentario }\n end\n end",
"def show\n @comentario = Comentario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comentario }\n end\n end",
"def show\n @asociado = Asociado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asociado }\n end\n end",
"def show\n @inscrito = Inscrito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inscrito }\n end\n end",
"def show\n @informe = Informe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @informe }\n end\n end",
"def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"def show\n @instituicao = Instituicao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instituicao }\n end\n end",
"def show\n @colegiatura = Colegiatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colegiatura }\n end\n end",
"def index\n @cooperativas = Cooperativa.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cooperativas }\n end\n end",
"def index\n @contas = Conta.all\n respond_to do |format|\n format.json { render json: @contas.to_json, status: :ok }\n end\n end",
"def index\n @conseilles = Conseille.all\n respond_to do |format|\n format.html\n format.json { render json: @conseilles}\n end\n end",
"def show\n @historial = Historial.find(params[:id])\n @receta = Recete.histori(@historial.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial }\n end\n end",
"def show\n @central_correio = CentralCorreio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @central_correio }\n end\n end",
"def show\n @lista_contato = ListaContato.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lista_contato }\n end\n end",
"def show\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @veiculo }\n end\n end",
"def index\n @cofis = Cofi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cofis }\n end\n end",
"def show\n @concurso = Concurso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concurso }\n end\n end",
"def show\n @agronomiaquimica = Agronomiaquimica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @agronomiaquimica }\n end\n end",
"def index\r\n @imobiliarias = Imobiliaria.all\r\n\r\n respond_to do |format|\r\n # format.html # index.html.erb\r\n format.json { render json: @imobiliarias }\r\n end\r\n end",
"def index\n @ores = Ore.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ores }\n end\n end",
"def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end",
"def index\n @asociados = Asociado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @asociados }\n end\n end",
"def show\n @calcmecanico = Calcmecanico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @calcmecanico }\n end\n end",
"def show\n @mecanicacomplejo = Mecanicacomplejo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mecanicacomplejo }\n end\n end",
"def index\n @anuncios = Anuncio.all\n render json: @anuncios, status: :ok\n end",
"def show\n @tipo_contrato = TipoContrato.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_contrato }\n end\n end",
"def index\n @ofertas = Oferta.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ofertas }\n end\n end",
"def show\n @empresa_servicio = EmpresaServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @empresa_servicio }\n end\n end",
"def show\n @articulo = Articulo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articulo }\n end\n end",
"def show\n @articulo = Articulo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articulo }\n end\n end",
"def show\n @articulo = Articulo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articulo }\n end\n end",
"def index\n @concursos = Concurso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @concursos }\n end\n end",
"def show\n @leito = Leito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leito }\n end\n end",
"def show\r\n @asistencia = Asistencia.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @asistencia }\r\n end\r\n end",
"def show\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @asiento }\n end\n end",
"def show\n @calificacione = Calificacione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @calificacione }\n end\n end",
"def index\n @enderecos = Endereco.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enderecos }\n end\n end",
"def show\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asignatura }\n end\n end",
"def show\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asignatura }\n end\n end",
"def index\n @itineraires = Itineraire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @itineraires }\n end\n end",
"def show\n @iniciativa = Iniciativa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @iniciativa }\n end\n end",
"def show\n\trespond_to do |format|\n format.json { render json: @conta.to_json, status: :ok }\n end\n end",
"def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estudiante }\n end\n end",
"def show\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @oferta }\n end\n end",
"def show\n @articulo = Articulo.find(params[:id])\n @noticias = Articulo.where(\"tipo = 'noticia'\").order(\"created_at desc\")\n @title = @articulo.titulo\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articulo }\n end\n end",
"def show\n @contratacao = Contratacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contratacao }\n end\n end",
"def index\n @premios = Premio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @premios }\n end\n end",
"def show\n @ativo_outro = AtivoOutro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ativo_outro }\n end\n end",
"def show\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @servicio }\n end\n end",
"def show\n @dependencia = Dependencia.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dependencia }\n end\n end",
"def index\n \n @controles_asistencias = ControlAsistencia.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @controles_asistencias }\n end\n end",
"def show\n @escola = Escola.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @escola }\n end\n end",
"def show\n @etnia = Etnia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etnia }\n end\n end",
"def show\n @reconocimiento = Reconocimiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @reconocimiento }\n end\n end",
"def show\n @cegonha = Cegonha.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cegonha }\n end\n end",
"def show\n @correo = Correo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @correo }\n end\n end",
"def show\n @correo = Correo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @correo }\n end\n end",
"def show\n @nabe = Nabe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nabe }\n end\n end",
"def show\n @calificacion_servicio = CalificacionServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @calificacion_servicio }\n end\n end",
"def show\n @chaine = Chaine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chaine }\n end\n end",
"def show\n @cita = Cita.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cita }\n end\n end",
"def new\n @indicacao = Indicacao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @indicacao }\n end\n end",
"def show\n @tipo_documento = TipoDocumento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_documento }\n end\n end",
"def show\n @aactio = Aactio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aactio }\n end\n end",
"def show\n @documentotipo = Documentotipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @documentotipo }\n end\n end",
"def show\n @concedente = Concedente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concedente }\n end\n end",
"def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"def index\n @acuerdos = Acuerdo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @acuerdos }\n end\n end",
"def show\n @arquivo = Arquivo.find(params[:id])\n @comentarios = Comentario.where(:comentavel_id => @arquivo.id, :comentavel_type => \"Arquivo\").order('created_at DESC')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @arquivo }\n end\n end",
"def show\n @sistema = Sistema.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sistema }\n end\n end",
"def index\n @ivas = Iva.all\n\n render json: @ivas\n end",
"def show\n @observacao_vocacionada = ObservacaoVocacionada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @observacao_vocacionada }\n end\n end",
"def show\n @control_asistencia = ControlAsistencia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @control_asistencia }\n end\n end",
"def index\n @ativo_outros = AtivoOutro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ativo_outros }\n end\n end",
"def show\n @contum = Contum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contum }\n end\n end",
"def show\n @periodo_academico = PeriodoAcademico.find(params[:id])\n\n render json: @periodo_academico\n end",
"def index\n @municipios = Municipio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @municipios }\n end\n end"
] |
[
"0.701355",
"0.6954598",
"0.6938939",
"0.6932047",
"0.68274456",
"0.68122447",
"0.6790883",
"0.6786332",
"0.6780297",
"0.6771523",
"0.67550176",
"0.674346",
"0.67333555",
"0.67333555",
"0.67173594",
"0.67131746",
"0.6711438",
"0.6710891",
"0.67026955",
"0.6690215",
"0.6680572",
"0.6646582",
"0.66435397",
"0.66435397",
"0.6634743",
"0.66339564",
"0.6624739",
"0.6618222",
"0.66161954",
"0.66063166",
"0.65893537",
"0.65866494",
"0.6582191",
"0.65816325",
"0.6572085",
"0.65676826",
"0.6547161",
"0.6537527",
"0.65312976",
"0.651832",
"0.65051293",
"0.650341",
"0.6503139",
"0.6499314",
"0.64934206",
"0.6482092",
"0.6478396",
"0.64749414",
"0.6465513",
"0.6443112",
"0.64408696",
"0.64408696",
"0.64408696",
"0.6440349",
"0.64340115",
"0.64338374",
"0.64222896",
"0.6419366",
"0.64146",
"0.6413296",
"0.6413296",
"0.64108276",
"0.64043844",
"0.6404238",
"0.639836",
"0.63960946",
"0.6392742",
"0.63858867",
"0.6385755",
"0.63852483",
"0.63834023",
"0.6382051",
"0.63814276",
"0.6380763",
"0.6379169",
"0.63785845",
"0.63782454",
"0.6376248",
"0.6375371",
"0.63743997",
"0.63717586",
"0.6358093",
"0.6354577",
"0.6350449",
"0.6349651",
"0.6343965",
"0.63433224",
"0.63427883",
"0.6342594",
"0.6342594",
"0.6342594",
"0.63419193",
"0.6339436",
"0.6339093",
"0.63323313",
"0.63312924",
"0.6331214",
"0.6323868",
"0.632351",
"0.63234967",
"0.63202375"
] |
0.0
|
-1
|
POST /informacoes POST /informacoes.json
|
def create
@informacao = Informacao.new(informacao_params)
respond_to do |format|
if @informacao.save
format.html { redirect_to @informacao, notice: 'Informacao was successfully created.' }
format.json { render action: 'show', status: :created, location: @informacao }
else
format.html { render action: 'new' }
format.json { render json: @informacao.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @oferta_academica = OfertaAcademica.new(params[:oferta_academica])\n\n if @oferta_academica.save\n render json: @oferta_academica, status: :created, location: @oferta_academica\n else\n render json: @oferta_academica.errors, status: :unprocessable_entity\n end\n end",
"def create\n\n @anuncio = Anuncio.new(anuncio_params)\n\n if @anuncio.save\n render :show, status: :created, location: @anuncio\n else\n render json: @anuncio.errors, status: :unprocessable_entity\n end\n end",
"def create\n @anio = Anio.new(anio_params)\n\n respond_to do |format|\n if @anio.save\n format.html { redirect_to @anio, notice: 'Anio was successfully created.' }\n format.json { render :show, status: :created, location: @anio }\n else\n format.html { render :new }\n format.json { render json: @anio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @conta = Conta.new(conta_params)\n\n # @conta.correntista = Correntista.find(params[:id])\n respond_to do |format|\n if @conta.save\n format.html { redirect_to correntista_conta_index_path, notice: 'Conta was successfully created.' }\n format.json { render :show, status: :created, location: @conta }\n else\n format.html { render :new }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @taco = Taco.new(taco_params)\n\n respond_to do |format|\n if @taco.save\n format.html { redirect_to @taco, notice: 'Taco was successfully created.' }\n format.json { render :show, status: :created, location: @taco }\n else\n format.html { render :new }\n format.json { render json: @taco.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @areco = Areco.new(params[:areco])\n\n respond_to do |format|\n if @areco.save\n format.html { redirect_to @areco, notice: 'Areco was successfully created.' }\n format.json { render json: @areco, status: :created, location: @areco }\n else\n format.html { render action: \"new\" }\n format.json { render json: @areco.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @quinto = Quinto.new(quinto_params)\n \n @quinto.anio = params[:anio]\n @quinto.mes = params[:mes]\n \n \n respond_to do |format|\n if @quinto.save\n format.html { redirect_to @quinto, notice: 'Quinto was successfully created.' }\n format.json { render :show, status: :created, location: @quinto }\n else\n format.html { render :new }\n format.json { render json: @quinto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @oferta_academica = OfertaAcademica.new(oferta_academica_params)\n\n respond_to do |format|\n if @oferta_academica.save\n format.html { redirect_to @oferta_academica, notice: 'Oferta academica was successfully created.' }\n format.json { render :show, status: :created, location: api_v1_oferta_academica_url(@oferta_academica) }\n else\n format.html { render :new }\n format.json { render json: @oferta_academica.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @imobiliaria = Imobiliaria.new(imobiliaria_params)\r\n\r\n respond_to do |format|\r\n if @imobiliaria.save\r\n format.json { render json: @imobiliaria, status: :created }\r\n else \r\n format.json { render json: @imobiliaria.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\r\n\r\n respond_to do |format|\r\n if @electronica_consejero.save\r\n format.html { redirect_to @electronica_consejero, notice: 'Se añadió un nombre de consejero de ingeniería electrónica correctamente.' }\r\n format.json { render :show, status: :created, location: @electronica_consejero }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @electronica_consejero.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @incucai = Incucai.new(params[:incucai])\n\n respond_to do |format|\n if @incucai.save\n format.html { redirect_to @incucai, notice: 'Incucai was successfully created.' }\n format.json { render json: @incucai, status: :created, location: @incucai }\n else\n format.html { render action: \"new\" }\n format.json { render json: @incucai.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @coisa = Coisa.new(params[:coisa])\n\n respond_to do |format|\n if @coisa.save\n format.html { redirect_to @coisa, :notice => 'Coisa was successfully created.' }\n format.json { render :json => @coisa, :status => :created, :location => @coisa }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @coisa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @indicativo = Indicativo.new(params[:indicativo])\n\n respond_to do |format|\n if @indicativo.save\n format.html { redirect_to @indicativo, notice: 'Indicativo was successfully created.' }\n format.json { render json: @indicativo, status: :created, location: @indicativo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @indicativo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ejercicio = Ejercicio.new(params[:ejercicio])\n\n respond_to do |format|\n if @ejercicio.save\n format.html { redirect_to @ejercicio, notice: 'Ejercicio was successfully created.' }\n format.json { render json: @ejercicio, status: :created, location: @ejercicio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ejercicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @agronomiaquimica = Agronomiaquimica.new(params[:agronomiaquimica])\n\n respond_to do |format|\n if @agronomiaquimica.save\n format.html { redirect_to @agronomiaquimica, notice: 'Agronomiaquimica was successfully created.' }\n format.json { render json: @agronomiaquimica, status: :created, location: @agronomiaquimica }\n else\n format.html { render action: \"new\" }\n format.json { render json: @agronomiaquimica.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @indicacao = Indicacao.new(params[:indicacao])\n\n respond_to do |format|\n if @indicacao.save\n format.html { redirect_to @indicacao, notice: 'A Indicação de Condutor foi criada com sucesso.' }\n format.json { render json: @indicacao, status: :created, location: @indicacao }\n else\n format.html { render action: \"new\" }\n format.json { render json: @indicacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @aliado = Aliado.new(aliado_params)\n\n respond_to do |format|\n if @aliado.save\n format.html { redirect_to @aliado, notice: 'Aliado was successfully created.' }\n format.json { render :show, status: :created, location: @aliado }\n else\n format.html { render :new }\n format.json { render json: @aliado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @oncokb = Oncokb.new(oncokb_params)\n\n respond_to do |format|\n if @oncokb.save\n format.html { redirect_to @oncokb, notice: 'Oncokb was successfully created.' }\n format.json { render :show, status: :created, location: @oncokb }\n else\n format.html { render :new }\n format.json { render json: @oncokb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @aactio = Aactio.new(params[:aactio])\n\n respond_to do |format|\n if @aactio.save\n format.html { redirect_to @aactio, notice: 'Aactio was successfully created.' }\n format.json { render json: @aactio, status: :created, location: @aactio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @aactio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tecnico = Tecnico.new(params[:tecnico])\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, :notice => 'Tecnico was successfully created.' }\n format.json { render :json => @tecnico, :status => :created, :location => @tecnico }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tecnico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @inicio = Inicio.new(inicio_params)\n\n respond_to do |format|\n if @inicio.save\n format.html { redirect_to @inicio, notice: 'Inicio was successfully created.' }\n format.json { render :show, status: :created, location: @inicio }\n else\n format.html { render :new }\n format.json { render json: @inicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @informacioncomercial = Informacioncomercial.new(informacioncomercial_params)\n\n respond_to do |format|\n if @informacioncomercial.save\n format.html { redirect_to @informacioncomercial, notice: 'Informacioncomercial was successfully created.' }\n format.json { render :show, status: :created, location: @informacioncomercial }\n else\n format.html { render :new }\n format.json { render json: @informacioncomercial.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @caixa = Caixa.new(params[:caixa])\n\n respond_to do |format|\n if @caixa.save\n format.html { redirect_to @caixa, notice: 'Caixa was successfully created.' }\n format.json { render json: @caixa, status: :created, location: @caixa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @caixa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @asignatura = Asignatura.new(asignatura_params)\n\n respond_to do |format|\n if @asignatura.save\n format.json { render json: \"Asignatura Creada\", status: :created, location: @asignatura }\n else\n format.json { render json: @asignatura.errors, status: :unprocessable_entity }\n end\n end\n end",
"def caixa_params\n params.require(:caixa).permit(:data, :responsavel, :status)\n end",
"def create\n @caixa = Caixa.new(caixa_params)\n\n respond_to do |format|\n if @caixa.save\n format.html { redirect_to @caixa, notice: 'Caixa was successfully created.' }\n format.json { render :show, status: :created, location: @caixa }\n else\n format.html { render :new }\n format.json { render json: @caixa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tecnica_de_impresion = TecnicaDeImpresion.new(tecnica_de_impresion_params)\n\n respond_to do |format|\n if @tecnica_de_impresion.save\n format.html { redirect_to @tecnica_de_impresion, notice: 'Tecnica de impresion was successfully created.' }\n format.json { render :show, status: :created, location: @tecnica_de_impresion }\n else\n format.html { render :new }\n format.json { render json: @tecnica_de_impresion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @periodo_academico = PeriodoAcademico.new(params[:periodo_academico])\n\n if @periodo_academico.save\n render json: @periodo_academico, status: :created, location: @periodo_academico\n else\n render json: @periodo_academico.errors, status: :unprocessable_entity\n end\n end",
"def create\n puts 'AQQQQQUUUUUUUIIIIII'\n json = ActiveSupport::JSON.decode(params[:pessoa])\n puts json\n @pessoa = Pessoa.new(json)\n # @address = Address.new(params[:address])\n\n # @client.addresses = @address\n\n respond_to do |format|\n if @pessoa.save\n format.html { redirect_to @pessoa, notice: 'Pessoa was successfully created.' }\n format.json { render json: @pessoa, status: :created, location: @pessoa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @etnia = Etnia.new(params[:etnia])\n\n respond_to do |format|\n if @etnia.save\n format.html { redirect_to @etnia, notice: 'Etnia was successfully created.' }\n format.json { render json: @etnia, status: :created, location: @etnia }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etnia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cio = Cio.new(cio_params)\n\n respond_to do |format|\n if @cio.save\n format.html { redirect_to @cio, notice: 'Cio cadastrado com sucesso.' }\n format.json { render :show, status: :created, location: @cio }\n else\n format.html { render :new }\n format.json { render json: @cio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @oferta = Oferta.new(params[:oferta])\n\n respond_to do |format|\n if @oferta.save\n format.html { redirect_to [:admin, @oferta], :notice => 'Exemplo was successfully created.' }\n format.json { render :json => @oferta, :status => :created, :location => @oferta }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @osoba = Osoba.new(params[:osoba])\n\n if @osoba.save\n render json: @osoba, status: :created, location: @osoba\n else\n render json: @osoba.errors, status: :unprocessable_entity\n end\n end",
"def create\n @information_cone = InformationCone.new(information_cone_params)\n\n respond_to do |format|\n if @information_cone.save\n format.html { redirect_to @information_cone, notice: 'Information cone was successfully created.' }\n format.json { render action: 'show', status: :created, location: @information_cone }\n else\n format.html { render action: 'new' }\n format.json { render json: @information_cone.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @inventario_cosa = InventarioCosa.new(inventario_cosa_params)\n\n respond_to do |format|\n if @inventario_cosa.save\n format.html { redirect_to @inventario_cosa, notice: 'Inventario cosa was successfully created.' }\n format.json { render :show, status: :created, location: @inventario_cosa }\n else\n format.html { render :new }\n format.json { render json: @inventario_cosa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @etapa = Etapa.new(etapa_params)\n\n respond_to do |format|\n if @etapa.save\n format.html { redirect_to @etapa, notice: 'Etapa fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @etapa }\n else\n format.html { render :new }\n format.json { render json: @etapa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cooperativa = Cooperativa.new(params[:cooperativa])\n\n respond_to do |format|\n if @cooperativa.save\n format.html { redirect_to [:admin, @cooperativa], :notice => 'Exemplo was successfully created.' }\n format.json { render :json => @cooperativa, :status => :created, :location => @cooperativa }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @cooperativa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @objeto = Etiqueta.new(etiqueta_params)\n\n respond_to do |format|\n if @objeto.save\n format.html { redirect_to @objeto, notice: 'Etiqueta was successfully created.' }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @colegio = Colegio.new(params[:colegio])\n\n respond_to do |format|\n if @colegio.save\n format.html { redirect_to @colegio, notice: 'El colegio fue creado satisfactoriamente.' }\n format.json { render json: @colegio, status: :created, location: @colegio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @colegio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @coin_ico = CoinIco.new(coin_ico_params)\n\n respond_to do |format|\n if @coin_ico.save\n format.html { redirect_to coin_icos_path, notice: 'Coin ico was successfully created.' }\n format.json { render :show, status: :created, location: @coin_ico }\n else\n format.html { render :new }\n format.json { render json: @coin_ico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @informations = Information.order('created_at desc')\n @information = Information.new(information_params)\n\n respond_to do |format|\n if @information.save\n format.html { redirect_to kegiatan_path, notice: 'Information was successfully created.' }\n format.json { render :show, status: :created, location: @information }\n else\n format.html { render :new }\n format.json { render json: @information.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @inscricao = Inscricao.new(inscricao_params)\n\n respond_to do |format|\n if @inscricao.save\n format.html { redirect_to @inscricao, notice: \"Inscricao was successfully created.\" }\n format.json { render :show, status: :created, location: @inscricao }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @inscricao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @areco = Areco.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @areco }\n end\n end",
"def create\n @azienda = Azienda.new(azienda_params)\n\n respond_to do |format|\n if @azienda.save\n format.html { redirect_to @azienda, notice: 'Azienda was successfully created.' }\n format.json { render :show, status: :created, location: @azienda }\n else\n format.html { render :new }\n format.json { render json: @azienda.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @caixa = Caixa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @caixa }\n end\n end",
"def create\n @interesado = Interesado.new(interesado_params)\n\n respond_to do |format|\n if @interesado.save\n format.html { redirect_to @interesado, notice: 'Interesado was successfully created.' }\n format.json { render :show, status: :created, location: @interesado }\n else\n format.html { render :new }\n format.json { render json: @interesado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @causale = Causale.new(params[:causale])\n\n respond_to do |format|\n if @causale.save\n format.html { redirect_to @causale, notice: 'Causale creata con successo.' }\n format.json { render json: @causale, status: :created, location: @causalo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @causale.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bienvenido = Bienvenido.new(bienvenido_params)\n\n respond_to do |format|\n if @bienvenido.save\n format.html { redirect_to @bienvenido, notice: 'Bienvenido was successfully created.' }\n format.json { render :show, status: :created, location: @bienvenido }\n else\n format.html { render :new }\n format.json { render json: @bienvenido.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @informacoes = Informacao.all\n end",
"def create\r\n\r\n respond_to do |format|\r\n if @electrica_consejero.save\r\n format.html { redirect_to @electrica_consejero, notice: 'Se añadió un nombre de consejero de ingeniería eléctrica correctamente.' }\r\n format.json { render :show, status: :created, location: @electrica_consejero }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @electrica_consejero.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @nabe = Nabe.new(params[:nabe])\n\n respond_to do |format|\n if @nabe.save\n format.html { redirect_to @nabe, notice: 'Nabe was successfully created.' }\n format.json { render json: @nabe, status: :created, location: @nabe }\n else\n format.html { render action: \"new\" }\n format.json { render json: @nabe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @nebulosa = Nebulosa.new(nebulosa_params)\n\n respond_to do |format|\n if @nebulosa.save\n format.html { redirect_to @nebulosa, notice: 'Nebulosa was successfully created.' }\n format.json { render :show, status: :created, location: @nebulosa }\n else\n format.html { render :new }\n format.json { render json: @nebulosa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @incucai = Incucai.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @incucai }\n end\n end",
"def create\n @escola = Escola.new(params[:escola])\n\n respond_to do |format|\n if @escola.save\n format.html { redirect_to @escola, :notice => 'Escola was successfully created.' }\n format.json { render :json => @escola, :status => :created, :location => @escola }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @escola.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @indicacao = Indicacao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @indicacao }\n end\n end",
"def create\n @esjiaoben = Esjiaoben.new(esjiaoben_params)\n\n respond_to do |format|\n if @esjiaoben.save\n format.html { redirect_to @esjiaoben, notice: 'Esjiaoben was successfully created.' }\n format.json { render :show, status: :created, location: @esjiaoben }\n else\n format.html { render :new }\n format.json { render json: @esjiaoben.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @intranet_financeiro_tipos_cobanca = Intranet::FinanceiroTiposCobanca.new(intranet_financeiro_tipos_cobanca_params)\n\n respond_to do |format|\n if @intranet_financeiro_tipos_cobanca.save\n format.html { redirect_to @intranet_financeiro_tipos_cobanca, notice: \"Financeiro tipos cobanca was successfully created.\" }\n format.json { render :show, status: :created, location: @intranet_financeiro_tipos_cobanca }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @intranet_financeiro_tipos_cobanca.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @estadio = Estadio.new(params[:estadio])\n\n respond_to do |format|\n if @estadio.save\n newAuditoria = Auditoria.new\n newAuditoria.tabla = params[:controller]\n newAuditoria.action = params[:action]\n newAuditoria.usuario = User.all.first.id\n newAuditoria.clave = @estadio.id\n newAuditoria.save\n format.html { redirect_to @estadio, notice: 'Estadio was successfully created.' }\n format.json { render json: @estadio, status: :created, location: @estadio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @estadio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @objeto = Cita.new(cita_params)\n\n respond_to do |format|\n if @objeto.save\n format.html { redirect_to @objeto, notice: \"Cita was successfully created.\" }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @accesorio = Accesorio.new(accesorio_params)\n\n respond_to do |format|\n if @accesorio.save\n format.html { redirect_to @accesorio, notice: 'Accesorio was successfully created.' }\n format.json { render :show, status: :created, location: @accesorio }\n else\n format.html { render :new }\n format.json { render json: @accesorio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @apoio_educacioanl = ApoioEducacioanl.new(apoio_educacioanl_params)\n\n respond_to do |format|\n if @apoio_educacioanl.save\n format.html { redirect_to @apoio_educacioanl, notice: 'Apoio educacioanal foi cadastrado com Sucesso !' }\n format.json { render :show, status: :created, location: @apoio_educacioanl }\n else\n format.html { render :new }\n format.json { render json: @apoio_educacioanl.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @celulare = Celulare.new(celulare_params)\n\n respond_to do |format|\n if @celulare.save\n format.html { redirect_to @celulare, notice: 'Celulare was successfully created.' }\n format.json { render :show, status: :created, location: @celulare }\n else\n format.html { render :new }\n format.json { render json: @celulare.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @oficio = Oficio.new(oficio_params)\n\n respond_to do |format|\n if @oficio.save\n format.html { redirect_to oficios_url, notice: 'Oficio agregado exitosamente.' }\n format.json { render :show, status: :created, location: oficios_url }\n else\n format.html { render :new }\n format.json { render json: @oficio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n respond_to do |format|\n \n if @citum.save\n format.html { redirect_to @citum, notice: 'Cita creada exitosamente.' }\n format.json { render :show, status: :created, location: @citum }\n else\n format.html { render :new }\n format.json { render json: @citum.errors, status: :unprocessable_entity }\n end \n \n end\n end",
"def create\n @asignatura = Asignatura.new(params[:asignatura])\n\n respond_to do |format|\n if @asignatura.save\n format.html { redirect_to @asignatura, notice: 'Asignatura was successfully created.' }\n format.json { render json: @asignatura, status: :created, location: @asignatura }\n else\n format.html { render action: \"new\" }\n format.json { render json: @asignatura.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tecnico = Tecnico.new(params[:tecnico])\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, notice: 'Tecnico criado com sucesso.' }\n format.json { render json: @tecnico, status: :created, location: @tecnico }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @imakoko = Imakoko.new(imakoko_params)\n\n respond_to do |format|\n if @imakoko.save\n format.html { redirect_to @imakoko, notice: 'Imakoko was successfully created.' }\n format.json { render :show, status: :created, location: @imakoko }\n else\n format.html { render :new }\n format.json { render json: @imakoko.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @aki = Aki.new(aki_params)\n\n respond_to do |format|\n if @aki.save\n format.html { redirect_to @aki, notice: 'Aki was successfully created.' }\n format.json { render :show, status: :created, location: @aki }\n else\n format.html { render :new }\n format.json { render json: @aki.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ingeniero = Ingeniero.new(ingeniero_params)\n\n respond_to do |format|\n if @ingeniero.save\n format.html { redirect_to @ingeniero, notice: 'Ingeniero was successfully created.' }\n format.json { render :show, status: :created, location: @ingeniero }\n else\n format.html { render :new }\n format.json { render json: @ingeniero.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @accesorio = Accesorio.new(params[:accesorio])\n\n respond_to do |format|\n if @accesorio.save\n format.html { redirect_to @accesorio, notice: 'Accesorio was successfully created.' }\n format.json { render json: @accesorio, status: :created, location: @accesorio }\n else\n format.html { render \"new\" }\n format.json { render json: @accesorio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @asiento = Asiento.new(params[:asiento])\n\n respond_to do |format|\n if @asiento.save\n format.html { redirect_to @asiento, :notice => 'El apunte fue creado.' }\n format.json { render :json => @asiento, :status => :created, :location => @asiento }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @asiento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @novedad_mecanica = @unidad.novedades_mecanicas.build(novedad_mecanica_params)\n\n respond_to do |format|\n if @novedad_mecanica.save\n format.html { redirect_to [@unidad,@novedad_mecanica], notice: 'Novedad mecanica was successfully created.' }\n format.json { render :show, status: :created, location: @novedad_mecanica }\n else\n format.html { render :new }\n format.json { render json: @novedad_mecanica.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @arqueo_caja = ArqueoCaja.new(arqueo_caja_params)\n\n respond_to do |format|\n if @arqueo_caja.save\n format.html { redirect_to @arqueo_caja, notice: 'Arqueo caja was successfully created.' }\n format.json { render :show, status: :created, location: @arqueo_caja }\n else\n format.html { render :new }\n format.json { render json: @arqueo_caja.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @informacao_ged = InformacaoGed.new(informacao_ged_params)\n\n respond_to do |format|\n if @informacao_ged.save\n format.html { redirect_to @informacao_ged, notice: 'Informação sobre o GED criada com sucesso.' }\n format.json { render action: 'show', status: :created, location: @informacao_ged }\n else\n format.html { render action: 'new' }\n format.json { render json: @informacao_ged.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ejercicio = Ejercicio.new(ejercicio_params)\n\n respond_to do |format|\n if @ejercicio.save\n format.html { redirect_to @ejercicio, notice: 'Ejercicio creado con exito..' }\n format.json { render :show, status: :created, location: @ejercicio }\n else\n format.html { render :new }\n format.json { render json: @ejercicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @agronomiaquimica = Agronomiaquimica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @agronomiaquimica }\n end\n end",
"def create\n @analise = Analisis.new(analise_params)\n\n respond_to do |format|\n if @analise.save\n format.html { redirect_to @analise, notice: 'Analisis was successfully created.' }\n format.json { render action: 'show', status: :created, location: @analise }\n else\n format.html { render action: 'new' }\n format.json { render json: @analise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @detalles_basico = DetallesBasico.new(detalles_basico_params)\n\n respond_to do |format|\n if @detalles_basico.save\n format.html { redirect_to @detalles_basico, notice: 'Detalles basico was successfully created.' }\n format.json { render :show, status: :created, location: @detalles_basico }\n else\n format.html { render :new }\n format.json { render json: @detalles_basico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @informe = Informe.new(params[:informe])\n\n respond_to do |format|\n if @informe.save\n format.html { redirect_to @informe, notice: 'Informe was successfully created.' }\n format.json { render json: @informe, status: :created, location: @informe }\n else\n format.html { render action: \"new\" }\n format.json { render json: @informe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @instituicao_responsavel = InstituicaoResponsavel.new(instituicao_responsavel_params)\n\n respond_to do |format|\n if @instituicao_responsavel.save\n format.html { redirect_to @instituicao_responsavel, notice: 'Instituicao responsavel was successfully created.' }\n format.json { render :show, status: :created, location: @instituicao_responsavel }\n else\n format.html { render :new }\n format.json { render json: @instituicao_responsavel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @auditoria = Auditoria.new(params[:auditoria])\n\n respond_to do |format|\n if @auditoria.save\n format.html { redirect_to @auditoria, :notice => 'Auditoria was successfully created.' }\n format.json { render :json => @auditoria, :status => :created, :location => @auditoria }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @auditoria.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create \n pai = params[:pai] ? Conta.find_by_id(params[:pai]): nil\n @conta = Conta.new(nome: params[:nome], status: params[:status])\n @conta.pai = pai\n @conta.data_criacao = Time.now\n \n respond_to do |format|\n if @conta.save\n #format.html { redirect_to @conta, notice: 'Conta was successfully created.' }\n #format.json { render :show, status: :created, location: @conta }\n format.json { render json: @conta.to_json, status: :created }\n #@conta.to_json\n else\n #format.html { render :new }\n format.json { render json: @conta.errors, status: :unprocessable_entity } \n end\n end\n end",
"def create\n @aki_diagnosis = AkiDiagnosis.new(aki_diagnosis_params)\n\n respond_to do |format|\n if @aki_diagnosis.save\n format.html { redirect_to @aki_diagnosis, notice: 'Diagnosis aki was successfully created.' }\n format.json { render :show, status: :created, location: @aki_diagnosis }\n else\n format.html { render :new }\n format.json { render json: @aki_diagnosis.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @apoio = Apoio.new(apoio_params)\n\t\t\n\t\t@apoio.user_id = current_user.id\n\t\t@apoio.causa_id = @causa.id\n\t\t\n\t\t@apoio.save\n\t\t\n\t\tredirect_to @causa\n #respond_to do |format|\n # if @apoio.save\n # format.html { redirect_to @apoio, notice: 'Apoio was successfully created.' }\n # format.json { render :show, status: :created, location: @apoio }\n # else\n # format.html { render :new }\n # format.json { render json: @apoio.errors, status: :unprocessable_entity }\n # end\n end",
"def create\n @cicada = Cicada.new(cicada_params)\n\n respond_to do |format|\n if @cicada.save\n format.html { redirect_to @cicada, notice: 'Cicada was successfully created.' }\n format.json { render :show, status: :created, location: @cicada }\n else\n format.html { render :new }\n format.json { render json: @cicada.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @colegiatura = Colegiatura.new(params[:colegiatura])\n\n respond_to do |format|\n if @colegiatura.save\n format.html { redirect_to @colegiatura, notice: 'Colegiatura was successfully created.' }\n format.json { render json: @colegiatura, status: :created, location: @colegiatura }\n else\n format.html { render action: \"new\" }\n format.json { render json: @colegiatura.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @chaine = Chaine.new(params[:chaine])\n\n respond_to do |format|\n if @chaine.save\n format.html { redirect_to @chaine, notice: 'Chaine was successfully created.' }\n format.json { render json: @chaine, status: :created, location: @chaine }\n else\n format.html { render action: \"new\" }\n format.json { render json: @chaine.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @abastecimento = Abastecimento.new(abastecimento_params)\n\n respond_to do |format|\n if @abastecimento.save\n format.html { redirect_to abastecimentos_url, notice: 'Abastecimento criado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :new }\n format.json { render json: @abastecimento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @faixa_etarium = FaixaEtarium.new(faixa_etarium_params)\n\n respond_to do |format|\n if @faixa_etarium.save\n format.html { redirect_to @faixa_etarium, notice: 'Faixa etarium was successfully created.' }\n format.json { render :show, status: :created, location: @faixa_etarium }\n else\n format.html { render :new }\n format.json { render json: @faixa_etarium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @coisa = Coisa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @coisa }\n end\n end",
"def create\n @nota_aluno = NotaAluno.new(nota_aluno_params)\n\n respond_to do |format|\n if @nota_aluno.save\n format.html { redirect_to @nota_aluno, notice: 'Nota aluno was successfully created.' }\n format.json { render :show, status: :created, location: @nota_aluno }\n else\n format.html { render :new }\n format.json { render json: @nota_aluno.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @datos_estudiante = DatosEstudiante.new(datos_estudiante_params)\n\n respond_to do |format|\n if @datos_estudiante.save\n format.html { redirect_to @datos_estudiante, notice: 'Datos estudiante was successfully created.' }\n format.json { render :show, status: :created, location: @datos_estudiante }\n else\n format.html { render :new }\n format.json { render json: @datos_estudiante.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consumo = Consumo.new(params[:consumo])\n\n respond_to do |format|\n if @consumo.save\n format.html { redirect_to @consumo.cliente, :notice => 'Consumo adicionado com sucesso.' }\n format.json { render :json => @consumo, :status => :created, :location => @consumo }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @consumo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @miscellaneou = Miscellaneou.new(miscellaneou_params)\n\n respond_to do |format|\n if @miscellaneou.save\n format.html { redirect_to @miscellaneou, notice: 'Accessory was successfully created.' }\n format.json { render :show, status: :created, location: @miscellaneou }\n else\n format.html { render :new }\n format.json { render json: @miscellaneou.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @arealizar = Arealizar.new(arealizar_params)\n\n respond_to do |format|\n if @arealizar.save\n format.html { redirect_to @arealizar, notice: 'Arealizar was successfully created.' }\n format.json { render :show, status: :created, location: @arealizar }\n else\n format.html { render :new }\n format.json { render json: @arealizar.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @asociacion = Asociacion.new(asociacion_params)\n\n respond_to do |format|\n if @asociacion.save\n format.html { redirect_to @asociacion, notice: 'Asociacion was successfully created.' }\n format.json { render :show, status: :created, location: @asociacion }\n else\n format.html { render :new }\n format.json { render json: @asociacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bico = Bico.new(params[:bico])\n\n respond_to do |format|\n if @bico.save\n format.html { redirect_to @bico, notice: 'Bico was successfully created.' }\n format.json { render json: @bico, status: :created, location: @bico }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @contato = Contato.new(contato_params)\n\n respond_to do |format|\n if @contato.save\n format.html { redirect_to @contato, flash: { success: 'Contato was successfully created.' } }\n format.json { render :show, status: :created, location: @contato }\n else\n format.html { render :new }\n format.json { render json: @contato.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @atracao = Atracao.new(params[:atracao])\n\n respond_to do |format|\n if @atracao.save\n format.html { redirect_to @atracao, :notice => 'Atracao was successfully created.' }\n format.json { render :json => @atracao, :status => :created, :location => @atracao }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @atracao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @conta = Conta.new(conta_params)\n\n respond_to do |format|\n if @conta.save\n format.html { redirect_to contas_path, notice: @@titulo + t('msg.salva')}\n format.json { render :index, status: :created, location: @conta }\n else\n format.html { redirect_to contas_path, alert: @conta.errors.messages }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.62956244",
"0.6102647",
"0.60587376",
"0.60551256",
"0.5969321",
"0.59630847",
"0.59245616",
"0.5913291",
"0.59069043",
"0.58761394",
"0.587593",
"0.5864844",
"0.58629566",
"0.58441293",
"0.58415395",
"0.5834704",
"0.5833787",
"0.5833706",
"0.5833143",
"0.5828265",
"0.58280325",
"0.58178836",
"0.5815732",
"0.579283",
"0.5791412",
"0.5785421",
"0.5781072",
"0.5780484",
"0.57799244",
"0.5779574",
"0.57732576",
"0.57696617",
"0.5768992",
"0.57630634",
"0.57540405",
"0.57497674",
"0.574319",
"0.5739442",
"0.57378775",
"0.5733975",
"0.57337534",
"0.5727946",
"0.5726114",
"0.5723318",
"0.5701525",
"0.56983715",
"0.5692421",
"0.5690686",
"0.5688675",
"0.5687741",
"0.56863344",
"0.56811196",
"0.5677272",
"0.5676491",
"0.5671735",
"0.5670954",
"0.56640863",
"0.5663026",
"0.56570154",
"0.56566226",
"0.56564295",
"0.56460214",
"0.56459016",
"0.5644668",
"0.5643405",
"0.56427675",
"0.56416076",
"0.5639958",
"0.5638983",
"0.5635938",
"0.56326133",
"0.5631034",
"0.5629372",
"0.5627853",
"0.56256604",
"0.56186306",
"0.5617465",
"0.5616618",
"0.5614227",
"0.56125486",
"0.56124413",
"0.56086713",
"0.56014365",
"0.56005585",
"0.5598575",
"0.5597091",
"0.55970055",
"0.55932903",
"0.5591798",
"0.5587827",
"0.5586724",
"0.5583045",
"0.55824214",
"0.5580015",
"0.5578586",
"0.55773896",
"0.5576742",
"0.55759686",
"0.55758464",
"0.55718625"
] |
0.61918765
|
1
|
PATCH/PUT /informacoes/1 PATCH/PUT /informacoes/1.json
|
def update
respond_to do |format|
if @informacao.update(informacao_params)
format.html { redirect_to @informacao, notice: 'Informacao was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @informacao.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to [:admin, @oferta], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n if @veiculo.update_attributes(params[:veiculo])\n format.html { redirect_to @veiculo, :notice => 'Veiculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @caixa = Caixa.find(params[:id])\n\n respond_to do |format|\n if @caixa.update_attributes(params[:caixa])\n format.html { redirect_to @caixa, notice: 'Caixa was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @caixa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n if @servicio.update_attributes(params[:servicio])\n format.html { redirect_to @servicio, :notice => 'Servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @servicio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n pai = params[:pai] ? Conta.find_by_id(params[:pai]): nil\n \n respond_to do |format|\n if @conta.update(nome: conta_params[:nome], status: conta_params[:status], pai: pai) \n #format.json { render :show, status: :ok, location: @conta }\n format.json { render json: @conta.to_json, status: :ok }\n else \n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @areco = Areco.find(params[:id])\n\n respond_to do |format|\n if @areco.update_attributes(params[:areco])\n format.html { redirect_to @areco, notice: 'Areco was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @areco.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @oferta_academica = OfertaAcademica.find(params[:id])\n\n if @oferta_academica.update(params[:oferta_academica])\n head :no_content\n else\n render json: @oferta_academica.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @servico_pacote.update(servico_pacote_params)\n format.html { redirect_to @servico_pacote, notice: 'Pacote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_pacote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @colegio = Colegio.find(params[:id])\n\n respond_to do |format|\n if @colegio.update_attributes(params[:colegio])\n format.html { redirect_to @colegio, notice: 'El Colegio fue actualizado satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @colegio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @apoio.update(apoio_params)\n format.html { redirect_to @apoio, notice: 'Apoio was successfully updated.' }\n format.json { render :show, status: :ok, location: @apoio }\n else\n format.html { render :edit }\n format.json { render json: @apoio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @consumo = Consumo.find(params[:id])\n\n respond_to do |format|\n if @consumo.update_attributes(params[:consumo])\n format.html { redirect_to @consumo.cliente, :notice => 'Consumo alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @consumo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @clientes_servico.update(clientes_servico_params)\n format.html { redirect_to @clientes_servico, notice: 'Clientes servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @clientes_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @inicio.update(inicio_params)\n format.html { redirect_to @inicio, notice: 'Inicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @inicio }\n else\n format.html { render :edit }\n format.json { render json: @inicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @coisa = Coisa.find(params[:id])\n\n respond_to do |format|\n if @coisa.update_attributes(params[:coisa])\n format.html { redirect_to @coisa, :notice => 'Coisa was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @coisa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @documentotipo = Documentotipo.find(params[:id])\n\n respond_to do |format|\n if @documentotipo.update_attributes(params[:documentotipo])\n format.html { redirect_to @documentotipo, notice: 'Documentotipo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @documentotipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def activo_update\n respond_to do |format|\n activo = params[:laboratorio][:activo]\n id = params[:id]\n Laboratorio.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"def update\n respond_to do |format|\n if @apologetic.update(apologetic_params)\n format.html { redirect_to @apologetic, notice: 'Apologetic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @apologetic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n if @tecnico.update_attributes(params[:tecnico])\n format.html { redirect_to @tecnico, :notice => 'Tecnico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @tecnico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @caixa.update(caixa_params)\n format.html { redirect_to @caixa, notice: 'Caixa was successfully updated.' }\n format.json { render :show, status: :ok, location: @caixa }\n else\n format.html { render :edit }\n format.json { render json: @caixa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @informe = Informe.find(params[:id])\n\n respond_to do |format|\n if @informe.update_attributes(params[:informe])\n format.html { redirect_to @informe, notice: 'Informe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @informe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @oficio.update(oficio_params)\n format.html { redirect_to oficios_url, notice: 'Oficio actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: oficios_url }\n else\n format.html { render :edit }\n format.json { render json: @oficio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @conta.update(conta_params)\n format.html { redirect_to contas_path, notice: @@titulo + t('msg.update') }\n format.json { render :show, status: :ok, location: @conta }\n else\n format.html { render :edit }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def actualizacion \n fiesta.update (params[:id]) \n render json: fiesta\n end",
"def update\n @formulary = Formulary.find(params[:id])\n\n respond_to do |format|\n if @formulary.update_attributes(params[:formulary])\n format.html { redirect_to @formulary, notice: 'Formulario actualizado exitosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @formulary.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(etiqueta_params)\n format.html { redirect_to @objeto, notice: 'Etiqueta was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @alumno = Alumno.find(params[:id])\n\n respond_to do |format|\n if @alumno.update_attributes(params[:alumno])\n head :no_content\n else\n render json: @alumno.errors, status: :unprocessable_entity\n end\n end\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update\n respond_to do |format|\n if @anio.update(anio_params)\n format.html { redirect_to @anio, notice: 'Anio was successfully updated.' }\n format.json { render :show, status: :ok, location: @anio }\n else\n format.html { render :edit }\n format.json { render json: @anio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @nota_tecnica.update(nota_tecnica_params)\n format.html { redirect_to @nota_tecnica, notice: 'Nota tecnica was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @nota_tecnica.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ejercicio = Ejercicio.find(params[:id])\n\n respond_to do |format|\n if @ejercicio.update_attributes(params[:ejercicio])\n format.html { redirect_to @ejercicio, notice: 'Ejercicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ejercicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @articulo = Articulo.find(params[:id])\n\n respond_to do |format|\n if @articulo.update_attributes(params[:articulo])\n format.html { redirect_to @articulo, notice: 'Articulo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @articulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tapioca.update(tapioca_params)\n format.html { redirect_to @tapioca, notice: 'Tapioca was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tapioca.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @conta.update(conta_params)\n format.html { redirect_to(@conta, :notice => t('activerecord.successful.messages.updated', :model => @conta.class.model_name.human))}\n format.json { render :show, status: :ok, location: @conta }\n else\n format.html { render :edit }\n format.json { render :json => { :errors => @conta.errors.full_messages }, :status => 422 }\n end\n end\n end",
"def update\n respond_to do |format|\n if @inventario_cosa.update(inventario_cosa_params)\n format.html { redirect_to @inventario_cosa, notice: 'Inventario cosa was successfully updated.' }\n format.json { render :show, status: :ok, location: @inventario_cosa }\n else\n format.html { render :edit }\n format.json { render json: @inventario_cosa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @contato.update(contato_params)\n format.html { redirect_to @contato, flash: { success: 'Contato was successfully updated.' } }\n format.json { render :show, status: :ok, location: @contato }\n else\n format.html { render :edit }\n format.json { render json: @contato.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cooperativa = Cooperativa.find(params[:id])\n\n respond_to do |format|\n if @cooperativa.update_attributes(params[:cooperativa])\n format.html { redirect_to [:admin, @cooperativa], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cooperativa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @aactio = Aactio.find(params[:id])\n\n respond_to do |format|\n if @aactio.update_attributes(params[:aactio])\n format.html { redirect_to @aactio, notice: 'Aactio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aactio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @articulo = Articulo.find(params[:id])\n\n respond_to do |format|\n if @articulo.update_attributes(params[:articulo])\n format.html { redirect_to @articulo, notice: 'Articulo se ha actualizado correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @articulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n if @tecnico.update_attributes(params[:tecnico])\n format.html { redirect_to @tecnico, notice: 'Tecnico atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @indicativo = Indicativo.find(params[:id])\n\n respond_to do |format|\n if @indicativo.update_attributes(params[:indicativo])\n format.html { redirect_to @indicativo, notice: 'Indicativo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @indicativo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ficheiro.update(ficheiro_params)\n format.html { redirect_to @ficheiro, notice: 'File was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ficheiro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @solicitacoes_avaliacoes_servico.update(solicitacoes_avaliacoes_servico_params)\n format.html { redirect_to @solicitacoes_avaliacoes_servico, notice: 'Solicitacoes avaliacoes servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @solicitacoes_avaliacoes_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def update\n @sistema = Sistema.find(params[:id])\n\n respond_to do |format|\n if @sistema.update_attributes(params[:sistema])\n format.html { redirect_to @sistema, notice: 'Sistema was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sistema.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @atracao = Atracao.find(params[:id])\n\n respond_to do |format|\n if @atracao.update_attributes(params[:atracao])\n format.html { redirect_to @atracao, :notice => 'Atracao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @atracao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n if @premio.update_attributes(params[:premio])\n format.html { redirect_to @premio, :notice => 'Premio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @premio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @fluxomatricula = Fluxomatricula.find(params[:id])\n\n respond_to do |format|\n if @fluxomatricula.update_attributes(params[:fluxomatricula])\n format.html { redirect_to @fluxomatricula, notice: 'Fluxomatricula was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fluxomatricula.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @acao = Acao.find(params[:id])\n\n respond_to do |format|\n if @acao.update_attributes(params[:acao])\n format.html { redirect_to acao_url(@acao), notice: 'Acao atualizada.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @acao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @osoba = Osoba.find(params[:id])\n\n if @osoba.update(params[:osoba])\n head :no_content\n else\n render json: @osoba.errors, status: :unprocessable_entity\n end\n end",
"def update\n @tipo_documento = TipoDocumento.find(params[:id])\n\n respond_to do |format|\n if @tipo_documento.update_attributes(params[:tipo_documento])\n format.html { redirect_to @tipo_documento, notice: 'Tipo documento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_documento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(cita_params)\n format.html { redirect_to @objeto, notice: \"Cita was successfully updated.\" }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @chaine = Chaine.find(params[:id])\n\n respond_to do |format|\n if @chaine.update_attributes(params[:chaine])\n format.html { redirect_to @chaine, notice: 'Chaine was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chaine.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @indicacao = Indicacao.find(params[:id])\n\n respond_to do |format|\n if @indicacao.update_attributes(params[:indicacao])\n format.html { redirect_to @indicacao, notice: 'A Indicação do Condutor foi atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @indicacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to servicos_url, notice: 'Serviço atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @calificacion_servicio = CalificacionServicio.find(params[:id])\n\n respond_to do |format|\n if @calificacion_servicio.update_attributes(params[:calificacion_servicio])\n format.html { redirect_to @calificacion_servicio, notice: 'Calificacion servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @calificacion_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ocorrencia.update(ocorrencia_params)\n format.html { redirect_to @ocorrencia, notice: 'Ocorrencia was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ocorrencia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to @cliente, notice: 'Cliente atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @bico = Bico.find(params[:id])\n\n respond_to do |format|\n if @bico.update_attributes(params[:bico])\n format.html { redirect_to @bico, notice: 'Bico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\n end",
"def update\n respond_to do |format|\n if @topico.update(topico_params)\n format.html { redirect_to set_path, notice: 'Tópico atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @topico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to @cliente, notice: 'Cliente was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to @cliente, notice: 'Cliente was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ficha = Ficha.find(params[:id])\n\n respond_to do |format|\n if @ficha.update_attributes(params[:ficha])\n format.html { redirect_to @ficha, notice: 'Ficha alterada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ficha.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @abastecimento.update(abastecimento_params)\n format.html { redirect_to abastecimentos_url, notice: 'Abastecimento editado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @abastecimento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @idiom = Idiom.find(params[:id])\n\n respond_to do |format|\n if @idiom.update_attributes(params[:idiom])\n format.html { redirect_to @idiom, notice: 'Idiom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @idiom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ejemplo.update(ejemplo_params)\n format.html { redirect_to @ejemplo, notice: 'Ejemplo was successfully updated.' }\n format.json { render :show, status: :ok, location: @ejemplo }\n else\n format.html { render :edit }\n format.json { render json: @ejemplo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cocoon_example.update(cocoon_example_params)\n format.html { redirect_to @cocoon_example, notice: 'Cocoon example was successfully updated.' }\n format.json { render :show, status: :ok, location: @cocoon_example }\n else\n format.html { render :edit }\n format.json { render json: @cocoon_example.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cofi = Cofi.find(params[:id])\n\n respond_to do |format|\n if @cofi.update_attributes(params[:cofi])\n format.html { redirect_to cofis_url, notice: 'Cofi was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cofi.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_celula.update(sivic_celula_params)\r\n format.html { redirect_to @sivic_celula, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_celula.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_contcelula.update(sivic_contcelula_params)\r\n format.html { redirect_to @sivic_contcelula, notice: 'Sivic contcelula was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_contcelula.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def activo_update\n respond_to do |format|\n activo = params[:producto][:activo]\n id = params[:id]\n Producto.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"def update\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n if @premio.update_attributes(params[:premio])\n format.html { redirect_to @premio, notice: 'Premio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @premio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @coin_ico.update(coin_ico_params)\n format.html { redirect_to coin_icos_path, notice: 'Coin ico was successfully updated.' }\n format.json { render :show, status: :ok, location: @coin_ico }\n else\n format.html { render :edit }\n format.json { render json: @coin_ico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def update\n @comentario = Comentario.find(params[:id])\n\n respond_to do |format|\n if @comentario.update_attributes(params[:comentario])\n format.html { redirect_to @comentario, notice: 'Comentario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comentario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to @cliente, notice: 'Cliente was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @metodologia.update(metodologia_params)\n format.html { redirect_to @metodologia, notice: 'Metodologia was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @metodologia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tiposveiculo.update(tiposveiculo_params)\n format.html { redirect_to tiposveiculos_url, notice: 'Tipo de Veículo editado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @tiposveiculo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @prueba_json.update(prueba_json_params)\n format.html { redirect_to @prueba_json, notice: 'Prueba json was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @prueba_json.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @opcao.update(opcao_params)\n format.html { redirect_to @opcao, notice: 'Opcao atualizada com sucesso!' }\n format.json { render :show, status: :ok, location: @opcao }\n else\n format.html { render :edit }\n format.json { render json: @opcao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tb_servicio.update(tb_servicio_params)\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @tb_servicio }\n else\n format.html { render :edit }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(objeto_params)\n format.html { redirect_to @objeto, notice: 'Objeto was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(objeto_params)\n format.html { redirect_to @objeto, notice: 'Objeto was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @contato.update(contato_params)\n format.html { redirect_to @contato, notice: 'Contato was successfully updated.' }\n format.json { render :show, status: :ok, location: @contato }\n else\n format.html { render :edit }\n format.json { render json: @contato.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @metodo = Metodo.find(params[:id])\n\n respond_to do |format|\n if @metodo.update_attributes(params[:metodo])\n format.html { redirect_to metodos_url }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @metodo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @escola = Escola.find(params[:id])\n\n respond_to do |format|\n if @escola.update_attributes(params[:escola])\n format.html { redirect_to @escola, :notice => 'Escola was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @escola.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @selecao = Selecao.find(params[:id])\n\n respond_to do |format|\n if @selecao.update_attributes(params[:selecao])\n format.html { redirect_to @selecao, notice: 'Selecao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @selecao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @celulare.update(celulare_params)\n format.html { redirect_to @celulare, notice: 'Celulare was successfully updated.' }\n format.json { render :show, status: :ok, location: @celulare }\n else\n format.html { render :edit }\n format.json { render json: @celulare.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n @empresa_servicio = EmpresaServicio.find(params[:id])\n respond_to do |format|\n if @empresa_servicio.update_attributes(params[:empresa_servicio])\n\n format.html { redirect_to empresa_empresa_servicios_path, notice: \"Los datos del servicio fueron actualizados para la empresa #{@empresa_servicio.empresa.nombre_empresa}\"}\n \n else\n format.html { render action: \"edit\" }\n format.json { render json: @empresa_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @conta.update(conta_params)\n format.html { redirect_to @conta, notice: 'Conta was successfully updated.' }\n format.json { render :show, status: :ok, location: @conta }\n else\n format.html { render :edit }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to edit_cliente_path(@cliente), notice: 'Cliente was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @information_cone.update(information_cone_params)\n format.html { redirect_to @information_cone, notice: 'Information cone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @information_cone.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_convenio = TipoConvenio.find(params[:id])\n\n respond_to do |format|\n if @tipo_convenio.update_attributes(params[:tipo_convenio])\n format.html { redirect_to @tipo_convenio, notice: 'Tipo convenio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_convenio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @peso = Peso.find(params[:id])\n\n respond_to do |format|\n if @peso.update_attributes(params[:peso])\n format.html { redirect_to @peso, notice: 'Peso was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @peso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n if @asiento.update_attributes(params[:asiento])\n format.html { redirect_to @asiento, :notice => 'El apunte fue cambiado.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @asiento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @iglesia.update(iglesia_params)\n format.html { redirect_to @iglesia, notice: 'La iglesia #{@iglesia.nombre} ha sido actualizada.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @iglesia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @protocolo.update(protocolo_params)\n addlog(\"Protocolo alterado\")\n format.html { redirect_to @protocolo, notice: 'Protocolo foi atualizado.' }\n format.json { render :show, status: :ok, location: @protocolo }\n else\n format.html { render :edit }\n format.json { render json: @protocolo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @articulocomp = Articulocomp.find(params[:id])\n\n respond_to do |format|\n if @articulocomp.update_attributes(params[:articulocomp])\n format.html { redirect_to @articulocomp, :notice => 'Articulocomp was successfully updated.' }\n #format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n #format.json { render json: @articulocomp.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.65530336",
"0.64548326",
"0.6431989",
"0.64108175",
"0.63808995",
"0.6363888",
"0.6317398",
"0.6305271",
"0.62981606",
"0.62940466",
"0.628917",
"0.6281836",
"0.6280173",
"0.6278274",
"0.62768215",
"0.6264136",
"0.6253898",
"0.6251042",
"0.6234598",
"0.6232322",
"0.62316424",
"0.623119",
"0.62183505",
"0.6213783",
"0.6209569",
"0.6208933",
"0.62051517",
"0.6198027",
"0.619499",
"0.6194433",
"0.6192205",
"0.6189826",
"0.61879337",
"0.61873454",
"0.6169718",
"0.6168852",
"0.6165735",
"0.6164651",
"0.6161897",
"0.6148877",
"0.61485875",
"0.61423165",
"0.6141167",
"0.61329055",
"0.61302847",
"0.61276937",
"0.6124449",
"0.6120586",
"0.6119973",
"0.61167175",
"0.6113608",
"0.6113207",
"0.610984",
"0.6106978",
"0.6105103",
"0.6104804",
"0.61029345",
"0.61017185",
"0.60975116",
"0.6092483",
"0.6091671",
"0.60899264",
"0.60882294",
"0.60882294",
"0.60872346",
"0.60833514",
"0.6081272",
"0.60810995",
"0.6074469",
"0.60738105",
"0.6064887",
"0.6063822",
"0.60604453",
"0.6058003",
"0.60572773",
"0.60513484",
"0.60512596",
"0.605088",
"0.6050408",
"0.6048445",
"0.60475975",
"0.6041223",
"0.60403854",
"0.60397685",
"0.60397685",
"0.6036963",
"0.60368073",
"0.60349834",
"0.60345036",
"0.6034487",
"0.6033071",
"0.603011",
"0.6024615",
"0.60224164",
"0.6020024",
"0.601579",
"0.601529",
"0.6012947",
"0.6012159",
"0.60118216"
] |
0.64500946
|
2
|
DELETE /informacoes/1 DELETE /informacoes/1.json
|
def destroy
@informacao.destroy
respond_to do |format|
format.html { redirect_to informacoes_url }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @indicacao = Indicacao.find(params[:id])\n @indicacao.destroy\n\n respond_to do |format|\n format.html { redirect_to indicacoes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @informacao_ged.destroy\n respond_to do |format|\n format.html { redirect_to informacoes_ged_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @indicativo = Indicativo.find(params[:id])\n @indicativo.destroy\n\n respond_to do |format|\n format.html { redirect_to indicativos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @colegio = Colegio.find(params[:id])\n @colegio.destroy\n\n respond_to do |format|\n format.html { redirect_to colegios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @areco = Areco.find(params[:id])\n @areco.destroy\n\n respond_to do |format|\n format.html { redirect_to arecos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @datos_insumos_reactivo.destroy\n respond_to do |format|\n format.html { redirect_to datos_insumos_reactivos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @arquivo = Arquivo.find(params[:id])\n\n @comentarios = Comentario.where(:comentavel_id => @arquivo.id)\n\n if @comentarios\n @comentarios.delete_all\n end\n\n @arquivo.destroy\n\n respond_to do |format|\n format.html { redirect_to arquivos_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render :json => @fiestas.delete_at(params[:id].to_i)\n end",
"def destroy\n @agronomiaquimica = Agronomiaquimica.find(params[:id])\n @agronomiaquimica.destroy\n\n respond_to do |format|\n format.html { redirect_to agronomiaquimicas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @nota_tecnica.destroy\n respond_to do |format|\n format.html { redirect_to nota_tecnicas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @caixa = Caixa.find(params[:id])\n @caixa.destroy\n\n respond_to do |format|\n format.html { redirect_to caixas_url }\n format.json { head :no_content }\n end\n end",
"def delete\n unless possui_acesso?()\n return\n end\n @aviso = Aviso.find(params[:id])\n @aviso.destroy\n\n respond_to do |format|\n format.html { redirect_to avisos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @coisa = Coisa.find(params[:id])\n @coisa.destroy\n\n respond_to do |format|\n format.html { redirect_to coisas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cio.destroy\n respond_to do |format|\n format.html { redirect_to cios_url, notice: 'Cio excluido.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @detalle_documento_de_compra.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Linea eliminada' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consumo = Consumo.find(params[:id])\n @consumo.destroy\n\n respond_to do |format|\n format.html { redirect_to consumos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @aactio = Aactio.find(params[:id])\n @aactio.destroy\n\n respond_to do |format|\n format.html { redirect_to aactios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @oficio.destroy\n respond_to do |format|\n format.html { redirect_to oficios_url, notice: 'Oficio eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Alien.delete(params[\"id\"])\n end",
"def destroy\n @asociado = Asociado.find(params[:id])\n @asociado.destroy\n\n respond_to do |format|\n format.html { redirect_to asociados_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @tipo_convenio = TipoConvenio.find(params[:id])\n @tipo_convenio.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_convenios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @chaine = Chaine.find(params[:id])\n @chaine.destroy\n\n respond_to do |format|\n format.html { redirect_to chaines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @apologetic.destroy\n respond_to do |format|\n format.html { redirect_to apologetics_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @veiculo = Veiculo.find(params[:id])\n @veiculo.destroy\n\n respond_to do |format|\n format.html { redirect_to veiculos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_documento = TipoDocumento.find(params[:id])\n @tipo_documento.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_documentos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @apoio_educacioanl.destroy\n respond_to do |format|\n format.html { redirect_to apoio_educacioanls_url, notice: 'Apoio educacioanal foi excluído com Sucesso !' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ficha = Ficha.find(params[:id])\n @ficha.destroy\n\n respond_to do |format|\n format.html { redirect_to fichas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @conta.destroy\n params[:id] = nil\n respond_to do |format|\n format.html { redirect_to contas_path, notice: @@titulo + t('msg.remove') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @imobiliaria = Imobiliaria.find(params[:id])\r\n @imobiliaria.destroy\r\n\r\n respond_to do |format|\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\r\n @electronica_consejero.destroy\r\n respond_to do |format|\r\n format.html { redirect_to electronica_consejeros_url, notice: 'El nombre del consejero de ingeniería electrónica se eliminó correctamente.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @bico = Bico.find(params[:id])\n @bico.destroy\n\n respond_to do |format|\n format.html { redirect_to bicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inventario_cosa.destroy\n respond_to do |format|\n format.html { redirect_to inventario_cosas_url, notice: 'Inventario cosa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inicio.destroy\n respond_to do |format|\n format.html { redirect_to inicios_url, notice: 'Inicio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reconocimiento = Reconocimiento.find(params[:id])\n @reconocimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to reconocimientos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @information_cone.destroy\n respond_to do |format|\n format.html { redirect_to information_cones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ejercicio = Ejercicio.find(params[:id])\n @ejercicio.destroy\n\n respond_to do |format|\n format.html { redirect_to ejercicios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @contum = Contum.find(params[:id])\n @contum.destroy\n\n respond_to do |format|\n format.html { redirect_to conta_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n string = \"DELETE FROM notes WHERE famille_id = #{@famille.id}\"\n connection = Demande.connection\n connection.delete(string)\n @famille.destroy\n respond_to do |format|\n format.html { redirect_to familles_url, notice: 'Famille was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ocorrencia.destroy\n respond_to do |format|\n format.html { redirect_to ocorrencias_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_contrato = TipoContrato.find(params[:id])\n @tipo_contrato.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_contratos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @caixa.destroy\n respond_to do |format|\n format.html { redirect_to caixas_url, notice: 'Caixa foi excluído(a) com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @uchronia = Uchronia.find(params[:id])\n @uchronia.destroy\n\n respond_to do |format|\n format.html { redirect_to uchronias_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @central_correio = CentralCorreio.find(params[:id])\n @central_correio.destroy\n\n respond_to do |format|\n format.html { redirect_to central_correios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente.destroy\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exura = Exura.find(params[:id])\n @exura.destroy\n\n respond_to do |format|\n format.html { redirect_to exuras_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @servico_pacote.destroy\n respond_to do |format|\n format.html { redirect_to servico_pacotes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @sivic_contcelula.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_contcelulas_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n category = Formulario::REFERENCES_CATEGORY[@formulario.categoria]\n file = File.join(\"#{Formulario::ROUTE_PATH}\",category, @formulario.title)\n FileUtils.rm file\n @formulario.destroy\n respond_to do |format|\n puts \"----------> #{formularios_url}\"\n format.html { redirect_to formularios_url, notice: 'Formulario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @servicio = Servicio.find(params[:id])\n @servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to servicios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @archivo = Archivo.find(params[:id])\n @archivo.destroy\n\n respond_to do |format|\n format.html { redirect_to archivos_url }\n format.json { head :ok }\n end\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def destroy\n #@clinica.destroy\n @clinica.update(:status => 0)\n respond_to do |format|\n format.html { redirect_to clinicas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignarmultiplebeneficio.destroy\n respond_to do |format|\n format.html { redirect_to asignarmultiplebeneficios_url, notice: 'Asignarmultiplebeneficio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignarmultiplebeneficio.destroy\n respond_to do |format|\n format.html { redirect_to asignarmultiplebeneficios_url, notice: 'Asignarmultiplebeneficio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ativo_outro = AtivoOutro.find(params[:id])\n @ativo_outro.destroy\n\n respond_to do |format|\n format.html { redirect_to ativo_outros_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dato = Dato.find(params[:id])\n @dato.destroy\n\n respond_to do |format|\n format.html { redirect_to datos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @sivic_contabanco.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_contabancos_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @cargo_eleicao = CargoEleicao.find(params[:id])\n @cargo_eleicao.destroy\n\n respond_to do |format|\n format.html { redirect_to cargo_eleicaos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @oferta_academica = OfertaAcademica.find(params[:id])\n @oferta_academica.destroy\n\n head :no_content\n end",
"def destroy\n @arquivo = Arquivo.find(params[:id])\n @arquivo.destroy\n\n respond_to do |format|\n format.html { redirect_to arquivos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @incucai = Incucai.find(params[:id])\n @incucai.destroy\n\n respond_to do |format|\n format.html { redirect_to incucais_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @documentotipo = Documentotipo.find(params[:id])\n @documentotipo.destroy\n\n respond_to do |format|\n format.html { redirect_to documentotipos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @relogio = Relogio.find(params[:id])\n @relogio.destroy\n\n respond_to do |format|\n format.html { redirect_to relogios_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @tecnico = Tecnico.find(params[:id])\n @tecnico.destroy\n\n respond_to do |format|\n format.html { redirect_to tecnicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tecnico = Tecnico.find(params[:id])\n @tecnico.destroy\n\n respond_to do |format|\n format.html { redirect_to tecnicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tecnico = Tecnico.find(params[:id])\n @tecnico.destroy\n\n respond_to do |format|\n format.html { redirect_to tecnicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @iglesia.destroy\n respond_to do |format|\n format.html { redirect_to iglesias_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sistema = Sistema.find(params[:id])\n @sistema.destroy\n\n respond_to do |format|\n format.html { redirect_to sistemas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @escola = Escola.find(params[:id])\n @escola.destroy\n\n respond_to do |format|\n format.html { redirect_to escolas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asiento = Asiento.find(params[:id])\n @asiento.destroy\n\n respond_to do |format|\n format.html { redirect_to asientos_url }\n format.json { head :ok }\n end\n end",
"def destroy\r\n @electrica_consejero.destroy\r\n respond_to do |format|\r\n format.html { redirect_to electrica_consejeros_url, notice: 'El nombre del consejero de eléctrica se eliminó corrctamente.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @receita_medica = ReceitaMedica.find(params[:id])\n @receita_medica.destroy\n\n respond_to do |format|\n format.html { redirect_to receita_medicas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clientes_servico.destroy\n respond_to do |format|\n format.html { redirect_to clientes_servicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente_documento.destroy\n respond_to do |format|\n format.html { redirect_to cliente_documentos_url, notice: 'Cliente documento was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @detalles_basico.destroy\n respond_to do |format|\n format.html { redirect_to detalles_basicos_url, notice: 'Detalles basico was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def borrar \n\n fiesta.destroy\n render json: fiesta \n end",
"def destroy\n arquivo = Arquivo.find(@pregoestitulosgrafico.arquivo_id)\n\n File.delete(arquivo.caminho)\n\n pregoestitulo = Pregoestitulo.find(@pregoestitulosgrafico.pregoestitulo_id)\n \n @pregoestitulosgrafico.destroy\n respond_to do |format|\n format.html { redirect_to pregoestitulo, notice: 'Arquivo excluído com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @datosgenerale.destroy\n respond_to do |format|\n format.html { redirect_to datosgenerales_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @unidad.destroy\n respond_to do |format|\n format.html { redirect_to unidades_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @example.destroy\n respond_to do |format|\n format.html { redirect_to examples_url, notice: 'Operação realizada com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @datos_estudiante.destroy\n respond_to do |format|\n format.html { redirect_to datos_estudiantes_url, notice: 'Datos estudiante was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @informacioncomercial.destroy\n respond_to do |format|\n format.html { redirect_to informacioncomercials_url, notice: 'Informacioncomercial was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @concedente = Concedente.find(params[:id])\n @concedente.destroy\n\n respond_to do |format|\n format.html { redirect_to concedentes_url }\n format.json { head :no_content }\n end\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def destroy\n @archivo.destroy\n respond_to do |format|\n format.html { redirect_to archivos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contatos_cliente.destroy\n respond_to do |format|\n format.html { redirect_to contatos_clientes_url, notice: 'Contatos cliente was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clientepedido = Clientepedido.find(params[:id])\n @clientepedido.destroy\n\n respond_to do |format|\n format.html { redirect_to clientepedidos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @caixa.destroy\n respond_to do |format|\n format.html { redirect_to caixas_url, notice: 'Caixa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @atracao = Atracao.find(params[:id])\n @atracao.destroy\n\n respond_to do |format|\n format.html { redirect_to atracaos_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.71005356",
"0.7096328",
"0.70790756",
"0.70409703",
"0.7025177",
"0.6982031",
"0.695777",
"0.6938149",
"0.6936932",
"0.69367534",
"0.69202936",
"0.6895812",
"0.68925494",
"0.68925494",
"0.6887302",
"0.68849933",
"0.6875819",
"0.68735415",
"0.68686163",
"0.6864227",
"0.68577456",
"0.685582",
"0.68498373",
"0.6838449",
"0.6834357",
"0.6831581",
"0.6813403",
"0.6798861",
"0.6798719",
"0.67982584",
"0.67873555",
"0.67853314",
"0.6781962",
"0.6781962",
"0.6781962",
"0.67788404",
"0.6778219",
"0.67729205",
"0.6772589",
"0.6766424",
"0.67650443",
"0.67637235",
"0.6759231",
"0.6751591",
"0.6747117",
"0.674265",
"0.67383295",
"0.67355657",
"0.67310303",
"0.67281",
"0.67238575",
"0.6723292",
"0.67205626",
"0.67181414",
"0.67180884",
"0.67174584",
"0.6716672",
"0.6714287",
"0.67105025",
"0.67105025",
"0.67105025",
"0.67105025",
"0.67100847",
"0.6708015",
"0.6708015",
"0.67073154",
"0.67007387",
"0.67000014",
"0.6698286",
"0.6696679",
"0.66963494",
"0.66949815",
"0.66924864",
"0.66911376",
"0.6689505",
"0.6689505",
"0.6689505",
"0.6688178",
"0.66842353",
"0.6679022",
"0.66777205",
"0.667769",
"0.66752213",
"0.66743636",
"0.6674095",
"0.66739887",
"0.66736346",
"0.66719055",
"0.6671849",
"0.6671823",
"0.66694516",
"0.66694",
"0.6669044",
"0.6668893",
"0.66676134",
"0.66666263",
"0.6666466",
"0.6665785",
"0.6662761",
"0.66627026"
] |
0.7091066
|
2
|
Use callbacks to share common setup or constraints between actions.
|
def set_informacao
@informacao = Informacao.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_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"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.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def informacao_params
params[:informacao]
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 end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"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.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
Reponds with a deflection and cycles through two responses
|
def respond(savedIndex)
@context.printName
if @context.is_a? HappyChatbot
if @happy_deflection == 0
puts "I'd love to answer that for you, but what do you think about that?"
@happy_deflection += 1
elsif @happy_deflection == 1
puts "What was that?"
@happy_deflection = 0
end
elsif @context.is_a? DepressedChatbot
if @depressed_deflection == 0
puts "It hurts me to answer a question you already know the answer to."
@depressed_deflection += 1
elsif @depressed_deflection == 1
puts "Why ask me, man? I don't know the answer, but I can bet that you do though."
@depressed_deflection = 0
end
elsif @context.is_a? AngryChatbot
if @angry_deflection == 0
puts "I don't know, why don't you tell me!"
@angry_deflection += 1
elsif @angry_deflection == 1
puts "I bet you know the answer to that yourself, don't you?"
@angry_deflection = 0
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def dispatch_responders\n self.full_response, self.responder_ids = try_responding_in_full\n end",
"def parse_response(body)\n # Handling first response\n if INITIAL_FEELINGS.include? body\n @answers.push(body)\n create_response(create_second_text_message(body))\n # Handling second response\n elsif FOLLOWUP_FEELINGS.include? body\n @answers.push(body)\n if (@answers.length >= 1)\n create_response(\"Feel #{@answers[0]} and #{@answers[1]} throughout the day!\")\n else\n create_response(\"Empower youself with these feelings throughout the day. You can do it.\")\n end\n else\n create_response(\"We're not sure how to reply, please follow up with a valid feeling.\")\n end\n end",
"def control\n @responses = build_params.map { |request_params| lookup(request_params) }\n end",
"def one_data_response(cmd, *args)\n multi_data_response(cmd, *args).transform do |untagged_responses|\n untagged_responses.last\n end\n end",
"def multi_data_response(cmd, *args)\n collect_untagged_responses(cmd, cmd, *args)\n end",
"def respond(message)\n RESPONSES.sample\n end",
"def word\n @expected.empty? ? finish_response : continue_response\n end",
"def considering(response)\n @response = response\n self\n end",
"def receive_response(response); end",
"def process_response!(response)\n\t\t\t\tfinish_request!\n\t\t\t\t\n\t\t\t\tif Exception === response\n\t\t\t\t\t@logger.warn \"[#{@message.id}] Failure while processing response #{response}!\" if @logger\n\t\t\t\t\tRubyDNS.log_exception(@logger, response) if @logger\n\t\t\t\t\t\n\t\t\t\t\ttry_next_server!\n\t\t\t\telsif response.tc != 0\n\t\t\t\t\t@logger.warn \"[#{@message.id}] Received truncated response!\" if @logger\n\t\t\t\t\t\n\t\t\t\t\ttry_next_server!\n\t\t\t\telsif response.id != @message.id\n\t\t\t\t\t@logger.warn \"[#{@message.id}] Received response with incorrect message id: #{response.id}\" if @logger\n\t\t\t\t\t\n\t\t\t\t\ttry_next_server!\n\t\t\t\telse\n\t\t\t\t\t@logger.debug \"[#{@message.id}] Received valid response #{response.inspect}\" if @logger\n\t\t\t\t\t\n\t\t\t\t\tsucceed response\n\t\t\t\tend\n\t\t\tend",
"def increment_both_no_reply_count\n return true if seen_second_both_no_reply?\n if seen_first_both_no_reply\n self.seen_second_both_no_reply = true\n else\n self.seen_first_both_no_reply = true\n end\n end",
"def next() \n\t\treturn self.response.next()\n\tend",
"def blocklisted_response; end",
"def response; end",
"def response; end",
"def response; end",
"def response; end",
"def response; end",
"def response; end",
"def response; end",
"def response; end",
"def response; end",
"def response; end",
"def response; end",
"def response; end",
"def response; end",
"def response\n parse_request\n do_something\n put_response\n end",
"def process_response(obj)\n end",
"def respond(); end",
"def finish_response; end",
"def farewell\n\t\trandom_response :farewell\n\tend",
"def sibling_responses\n ac = {answer_choice_id: self.answer_choice_id, id: self.id}\n Response.find_by_sql([<<-SQL, ac])\n SELECT\n\t\t\t\t\trespones.*\n\t\t\t\tFROM (\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tquestions.*\n\t\t\t\t\tFROM\n\t\t\t\t\t\tquestions\n\t\t\t\t\t\t\tJOIN answer_choices ON answer_choices.question_id = questions.id\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tanswer_choices.id = :answer_choice_id\n\t\t\t\t\t) AS quest\n\t\t\t\t\tJOIN\n\t\t\t\t\t\tanswer_choices ON answer_choices.question_id = questions.id\n\t\t\t\t\tJOIN\n\t\t\t\t\t\tresponses ON responses.answer_choice_id = answer_choices.id\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t(responses.id != :id)\n\t\t\t\tSQL\n end",
"def finalize_response(resp)\n resp.tap do |r|\n r.response[:limit] = r.response.items.size - 1\n r.response[:moreItems] = false\n end\n end",
"def sibling_responses\n if !Response.exists?(self) #checks if instance is stored in database\n question.responses #even if instance class = Reponse, returns false if not in database\n else\n self.question.responses\n .where(\"responses.user_id != ?\", respondent.id)\n end\n\n end",
"def response\n @response || perform and @response\n end",
"def handle_response(guessers_guess, matching_indices)\n\t\tif(matching_indices.empty?)\n\t\t\t@candidate_words.delete_if {|word| word.include?(guessers_guess)}\n\t\telse\n\t\t\t@candidate_words = @candidate_words.select do |word| \n\t\t\t\tcontain_match_at_indices(word, matching_indices, guessers_guess)\n\t\t\tend\n\t\tend\n\tend",
"def response\n @response ||= request!(true)\n end",
"def response_to(kase)\n self.responses.find(:first, :conditions => [\"responses.kase_id = ?\", kase.id])\n end",
"def set_responses\n\t\t@responses = Response.where(question_id: params[:id] ) rescue nil\n\tend",
"def responses\n @responses ||= api::BatchResponse.new(responses: responses_by_request.values.uniq)\n end",
"def test_start_auction_to_one_server_should_replicate\n reset(REP_SERVERS)\n server1, server2, server3 = REP_SERVERS\n name = \"gau2\"\n \n do_rest(server1, :start_auction, {name: name, end_time: Time.now.to_i + 3})\n do_rest(server1, :bid, {name: name, client:1, bid:100})\n res = do_rest(server1, :status, {name: name})\n assert_equal(\"1\", res.strip)\n\n res = do_rest(server2, :status, {name: name})\n assert_equal(\"1\", res.strip)\n res = do_rest(server3, :status, {name: name})\n assert_equal(\"1\", res.strip)\n end",
"def blocklisted_responder=(_arg0); end",
"def response_set\n if defined?(@response_set)\n return @response_set unless wipe_response_set?\n end\n @wipe_response_set = false\n @response_set = LimeExt::ResponseLoaders.responses_for self\n return @response_set\n end",
"def translate_response(start_locations, end_locations, response)\n final_output = {}\n o_addresses = response[\"origin_addresses\"]\n d_addresses = response[\"destination_addresses\"]\n rows = response[\"rows\"]\n\n start_locations.each_with_index do |location, o_index|\n\n dest_hash = {\"origin_address\" => o_addresses[o_index], \"destinations\" => {} }\n\n rows[o_index][\"elements\"].each_with_index do |destination_details, d_index|\n d = {}\n d[\"distance\"] = destination_details[\"distance\"][\"value\"]\n d[\"distance_text\"] = destination_details[\"distance\"][\"text\"]\n d[\"duration\"] = destination_details[\"duration\"][\"value\"]\n d[\"duration_text\"] = destination_details[\"duration\"][\"text\"]\n d[\"address\"] = d_addresses[d_index]\n\n dest_hash[\"destinations\"][end_locations[d_index]] = d\n end\n\n final_output[location] = dest_hash\n end\n\n final_output\nend",
"def get_responses(entries)\n responses = entries.map do |entry|\n entry.responses\n end\n responses.flatten.compact\n end",
"def process_response(new_response)\n responses.push(new_response)\n responses.shift if responses.size > 5\n responses\n end",
"def setup\n @response ||= {}\n end",
"def sibling_responses\n # exclude yourself\n # load questions, then load responses\n question.responses.where.not(id: id)\n end",
"def successful_response_to\n attempts = 0\n loop do\n random_response = yield\n if random_response.success?\n return random_response\n elsif attempts > 2\n raise 'Unable to get a successful response'\n else\n assert_equal 'Declined_(General).', random_response.params.fetch('error')\n attempts += 1\n end\n end\n end",
"def stub_responses\n Creditsafe::Api::DummyResponse.new\n end",
"def process_response(public_request_id) \n\n # if data was received then \n unless @active_requests[public_request_id][:arduino_responses].empty? \n public_responses = []\n http_header = \"HTTP/1.1 200 OK\\r\\nContent-Type: application/json\\r\\n\\r\\n\"\n public_response = \"#{http_header}[\\r\\n\"\n\n # create a hash key with device/response pairs\n @active_requests[public_request_id][:arduino_responses].each do | device, response |\n response.match /.*?([\\[\\{].*[\\}\\]]+)/m\n public_responses << \"{\\r\\n#{device}:#{$1}\\r\\n}\"\n end\n\n # convert device/response pairs from hash into a json formatted string\n public_responses.each_with_index do | response, index |\n public_response += response\n if index == public_responses.length - 1 \n public_response += \"\\r\\n]\" \n else \n public_response += \",\\r\\n\" \n end \n end\n\n # respond back to public request with data in json format\n puts \"[Controller:process_response] public response #{public_response}\"\n @active_requests[public_request_id][:public_response] = public_response\n @public_server.respond @active_requests[public_request_id][:public_response], public_request_id\n\n else\n http_header = \"HTTP/1.1 404 Not Found\\r\\nContent-Type: application/json\\r\\n\\r\\n\"\n public_response = \"#{http_header}Resources Not Found\"\n @public_server.respond public_response, public_request_id\n\n end\n \n @active_requests.delete(public_request_id) unless @active_requests[public_request_id][:arduino_responses].empty? \n \n end",
"def index\n \t @responses = Response.all\n end",
"def response_for_each(*items)\n response = {}\n success = true\n\n items.each do |item|\n\n begin\n data = yield(item) if block_given?\n\n response[item] = self.class.build_response true, data\n\n rescue => e\n success = false\n response[item] = self.class.build_response false, e.message\n end\n\n end\n\n [success, response]\n end",
"def read_response vos, response, related_scrapers = {}, scrapers = {}, &yielder\n \n logger.info(\"Trying to find #{vos.length} vos\") if vos.length > 0\n \n # retrieve all items and yield vos, and any related vos\n vos.each do |vo|\n response.query(vo.item_path).each do |item_scope|\n \n # TODO this is a bit awkward, there is logic around whether a VO's field should\n # be fulfilled from a query, or from some other part of program state, like the scraper\n found_vo_fields = perform_data_requests(response, vo.fields, item_scope)\n \n # for each set of VO fields found in the response\n # create a new instance of the vo, and give it a uuid\n found_vo = vo.deep_clone\n found_vo.fields = @helper.format_vo_fields(found_vo.name,found_vo_fields)\n found_vo.fields.merge!({:uuid => Scraper::UUID_GEN.generate})\n \n logger.info(\"Found a #{vo.name} Vo\")\n \n setup_relations!(found_vo, item_scope, related_scrapers, response, &yielder)\n \n # yield up that VO goodness!\n yielder.call(found_vo)\n end\n\n end\n \n # retrieve all the scrapers that are unrelated to VOs\n read_scrapers(scrapers, related_scrapers, response, &yielder)\n end",
"def got_response(response)\n end",
"def call resp\n return resp if resp.first == Goliath::Connection::AsyncResponse.first\n self.downstream_resp = resp\n check_progress(nil)\n end",
"def noop\n write_noop\n multi_response\n end",
"def build_response(options={})\n\t\t\n\t\tresponses = []\n\n\t\tone_response = ''\n\n\t\tputs \"sample ids are:\"\n\t\tputs self.sample_ids\n\n\t\treturn responses unless sample_ids\n\n\t\tself.sample_ids.each_with_index {|sid,key|\n\t\t\tputs \"doing sample id: #{sid}\"\n\t\t\t## tests are got from the requisitions hash.\n\t\t\ttests = get_tests(sid)\n\t\t\tputs \"tests are: #{tests}\"\n\t\t\t## default sequence number is 0 (THIS MAY LEAD TO PROBLEMS.)\n\t\t\tsequence_number = \"#{key.to_s}\"\n\n\t\t\t## default patient id:\n\t\t\tpatient_id = \"abcde#{Time.now.to_i.to_s}\"\n\t\t\t\n\t\t\tpatient = Patient.new({:sequence_number => sequence_number, :patient_id => patient_id})\n\t\t\t\n\t\t\torder = Order.new({:sequence_number => patient.sequence_number, :specimen_id => sid, :tests => tests, :priority => \"R\"})\n\n\t\t\tresponses << (patient.build_response(options) + order.build_response(options.merge({sequence_number: self.sequence_number, carrier_number: self.carrier_number, position_number: self.position_number, sample_type: self.sample_type, container_type: self.container_type})))\n\n\t\t}\n\n\t\tputs \"responses are:\"\n\t\tputs responses.to_s\n\n\t\treturn responses\n\t\t\n\tend",
"def match_response(req, res)\n\t\t# Instead of callbacks, i can have a url pattern check here to determine appropriate respose\n\t\turl = req.url\n\t\thtml = res.body\n\t\t#binding.pry\n\n\t\t#Match conditions here\n\t\tif url.match(/zip-codes\\/\\d+/)\n\t\t\t#binding.pry\n byebug\n\t\t\t#movers = parse(html, get_params(url, :ProMoverZip))\n\n\t\t\t#moverdatawriter.write_hashes(movers)\n \n # get pagination links here\n\n\t\t\t#bizlinkw.write_array(mlinks)\n\t\t\t#zip_writer.write_array(ziplinks)\n\t\t\t# Queue the business links\n\t\t\t#Uncomment after replacing these links by webcache links\n\t\t\t##binding.pry\n\t\t\t#queue_links(ziplinks)\n elsif url.match(/zip-codes\\/\\d+\\?page=\\d+/)\n \n\t\tend\n\t\t#Possible actions are pagination_links, parse_links\n\t\t\t\t\n\tend",
"def response; return @response end",
"def from_response(user, response)\n base_documents_data = response['documents']\n base_documents_data.map do |base_document_data|\n physical_docs = base_document_data['physical_docs'].map do |data|\n doc = PhysicalDocument.from_response(data)\n doc.base_document = self\n doc\n end\n social_docs = base_document_data['social_docs'].map do |data|\n doc = SocialDocument.from_response(data)\n doc.base_document = self\n doc\n end\n virtual_docs = base_document_data['virtual_docs'].map do |data|\n doc = VirtualDocument.from_response(data)\n doc.base_document = self\n doc\n end\n\n args = {\n \"user\"=>user,\n \"id\"=>base_documents_data.first['id'],\n \"name\"=>base_documents_data.first['name'],\n \"permission_scope\"=>base_documents_data.first['permission_scope'],\n \"address_city\"=>base_documents_data.first['address_city'],\n \"address_country_code\"=>base_documents_data.first['address_country_code'],\n \"address_postal_code\"=>base_documents_data.first['address_postal_code'],\n \"address_street\"=>base_documents_data.first['address_street'],\n \"address_subdivision\"=>base_documents_data.first['address_subdivision'],\n \"alias\"=>base_documents_data.first['alias'],\n \"birth_day\"=>base_documents_data.first['day'],\n \"email\"=>base_documents_data.first['email'],\n \"entity_scope\"=>base_documents_data.first['entity_scope'],\n \"entity_type\"=>base_documents_data.first['entity_type'],\n \"ip\"=>base_documents_data.first['ip'],\n \"birth_month\"=>base_documents_data.first['month'],\n \"phone_number\"=>base_documents_data.first['phone_number'],\n \"birth_year\"=>base_documents_data.first['year'],\n \"screening_results\"=>base_documents_data.first['screening_results'],\n \"physical_documents\"=>physical_docs,\n \"social_documents\"=>social_docs,\n \"virtual_documents\"=>virtual_docs\n }\n\n other_keys = base_document_data.keys\n\n [\"physical_docs\", \"social_docs\", \"virtual_docs\"].each do |item|\n other_keys.delete_at(other_keys.index(item))\n end\n\n for key in other_keys do\n if base_document_data.has_key?(key)\n args[key] = base_document_data[key]\n end\n end\n\n base_doc = self.new(args)\n [physical_docs, social_docs, virtual_docs].flatten.each do |doc|\n doc.base_document = base_doc\n end\n\n base_doc\n end\n end",
"def responses\n @responses\n end",
"def results_from(response)\n response.data.collect do |obj|\n case resource\n when RedboothRuby::Client\n next unless resource_form_hash(obj.merge(session: session))\n resource_form_hash(obj.merge(session: session))\n else\n resource.new(obj.merge(session: session))\n end\n end.compact\n end",
"def pending_response_requests; end",
"def process_response \n LOGGER.debug \"CROSSREF SEARCH - Response from target: #{@response_status}\"\n #LOGGER.debug \"CROSSREF SEARCH - Headers: #{@response_headers.collect{ |k,v| \"#{k} = #{v}\" }.join(', ')}\"\n #LOGGER.debug \"CROSSREF SEARCH - Body:\"\n #LOGGER.debug @response_body\n \n ret = Cedilla::Citation.new({})\n \n json = JSON.parse(@response_body)\n \n json.first.each do |key,value|\n if key == 'doi'\n ret.doi = value if @citation.doi.nil?\n \n elsif key == 'title'\n ret.article_title = value if @citation.article_title.nil?\n \n elsif key == 'coins'\n # Call back to cedilla for a translation of the COINS OpenUrl\n url = URI.parse(\"#{@config['cedilla_citation_target']}?#{CGI.unescapeHTML(value)}\")\n \n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true if url.scheme == 'https'\n \n response = http.start do |http|\n http.open_timeout = @http_timeout\n http.read_timeout = @http_timeout\n \n http.get(url.request_uri, {}) \n end\n \n # Since we just had the citation generated by the cedilla openurl service, add a stub request wrapper around the citation\n # and pass it to the Translator\n request = Cedilla::Translator.from_cedilla_json('{\"citation\":' + response.body.to_s + '}')\n \n request.citation.methods.each do |method|\n # If this is a setter (but not the equality test)\n if method.id2name[-1] == '=' and !method.id2name.include?('==')\n getter = method.id2name.sub('=', '')\n setter = method.id2name\n \n # Skip it if the value is empty!\n unless request.citation.method(getter).call.nil?\n # If the original citation responds to the setter\n if @citation.respond_to?(setter)\n # If this is the authors array check each author\n if getter == \"authors\"\n request.citation.authors.each do |author|\n ret.authors << author unless @citation.has_author?(author)\n end\n \n # Otherwise set the response value if the original did not contain the value\n else\n ret.method(setter).call(request.citation.method(getter).call) if @citation.method(getter).call.nil?\n end\n end\n end\n end\n end\n\n end\n end\n \n ret\n end",
"def auto_accept_response!\n result = false\n if self.active? && self.has_expired? && self.responses_count >= 1 && \n self.offers_reward? && !self.owner_only_offers_reward?\n top = self.responses.active.find(:all, :conditions => [\"responses.up_votes_count >= 2 && responses.votes_sum >= 0\"],\n :order => \"responses.votes_sum ASC, responses.updated_at DESC\", :limit => 2)\n result = top.first.accept! unless top.first.nil?\n self.responses.reload if result\n end\n result\n end",
"def parse_response!; end",
"def add_response(graph_original, sollutions)\n\t\t\t@responses << ResponseSolution.new(graph_original, sollutions)\t\t\n\t\tend",
"def continue_response\n parameter = @expected.shift\n name, type, *args = parameter\n\n # Some command words can be read from the buffer directly, whereas\n # the parser has its own logic for the more complex ones.\n own_type = respond_to?(type, true)\n own_type ? send(type, name, *args) : primitive(parameter)\n end",
"def responses\n question=Question.find(params[:questionId])\n render :json=> question.response\n end",
"def multi_response_start\n verify_state\n write_noop\n @multi_buffer = String.new('')\n @position = 0\n @inprogress = true\n end",
"def jsonapi_received_relationships\n\t\t\t\t\t# Relationship definitions for current model\n\t\t\t\t\trels = jsonapi_relationships\n\n\t\t\t\t\t# Consider only current relationship for relationship actions\n\t\t\t\t\t# (params[:relationship] contains the relationship name)\n\t\t\t\t\tif params[:relationship] \n\n\t\t\t\t\t\trels.select! do |rel|\n\t\t\t\t\t\t\trel[:name].to_sym == params[:relationship].to_sym\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\t# If no relationship is received, then return the definition only\n\t\t\t\t\t\tif request.method == \"GET\"\n\t\t\t\t\t\t\treturn rels.collect do |rel|\n\t\t\t\t\t\t\t\t{definition: rel}\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\n\t\t\t\t\tend\n\n\t\t\t\t\trels.collect do |relationship|\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\treceived_params = nil\n\n\t\t\t\t\t\t\t# Relationship action\n\t\t\t\t\t\t\tif params[:relationship]\n\t\t\t\t\t\t\t\treceived_params = params.permit({\n\t\t\t\t\t\t\t\t\tdata: [\n\t\t\t\t\t\t\t\t\t\t:type, :id\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t# Object action\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treceived_params = params.require( \n\t\t\t\t\t\t\t\t\t:data\n\t\t\t\t\t\t\t\t).require(\n\t\t\t\t\t\t\t\t\t:relationships\n\t\t\t\t\t\t\t\t).require(\n\t\t\t\t\t\t\t\t\trelationship[:name]\n\t\t\t\t\t\t\t\t).permit({\n\t\t\t\t\t\t\t\t\tdata: [\n\t\t\t\t\t\t\t\t\t\t:type, :id\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t# => {\"data\"=>{\"type\"=>\"users\", \"id\"=>1}} # sample value for a to-one association\n\t\t\t\t\t\t\t# => {\"data\"=>[{\"type\"=>\"properties\", \"id\"=>1}, {\"type\"=>\"properties\", \"id\"=>2}]} # sample value for a to-many association\n\n\t\t\t\t\t\t\t# is received data conformant to the database schema? \n\t\t\t\t\t\t\tconformant = true\n\t\t\t\t\t\t\tloop do\n\t\t\t\t\t\t\t\t# to-many\n\t\t\t\t\t\t\t\tif received_params[:data].kind_of? Array\n\t\t\t\t\t\t\t\t\tif relationship[:type] != :to_many\n\t\t\t\t\t\t\t\t\t\tconformant = false\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\treceived_params[:data].each do |item|\n\t\t\t\t\t\t\t\t\t\tnext if item[:type].to_sym == relationship[:receiver][:type]\n\t\t\t\t\t\t\t\t\t\tconformant = false\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t# to-one\n\t\t\t\t\t\t\t\tif relationship[:type] != :to_one\n\t\t\t\t\t\t\t\t\tconformant = false\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\tconformant = false unless received_params[:data][:type].to_sym == relationship[:receiver][:type]\n\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tnext unless conformant\n\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdefinition: relationship,\n\t\t\t\t\t\t\t\tparams: received_params\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\trescue ActionController::ParameterMissing => e\n\n\t\t\t\t\t\t\t# nil assignment to to-one relationship?\n\t\t\t\t\t\t\tif relationship[:type] == :to_one\n\t\t\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\t\t\tif params[:relationship] # relationship action\n\t\t\t\t\t\t\t\t\t\treceived_params = params.permit(\n\t\t\t\t\t\t\t\t\t\t\t:data\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\treceived_params = params.require( \n\t\t\t\t\t\t\t\t\t\t\t:data\n\t\t\t\t\t\t\t\t\t\t).require(\n\t\t\t\t\t\t\t\t\t\t\t:relationships\n\t\t\t\t\t\t\t\t\t\t).require(\n\t\t\t\t\t\t\t\t\t\t\trelationship[:name]\n\t\t\t\t\t\t\t\t\t\t).permit(\n\t\t\t\t\t\t\t\t\t\t\t:data\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\t# received nil?\n\t\t\t\t\t\t\t\t\tnext if received_params[:data] # TODO: should return error to client?\n\n\t\t\t\t\t\t\t\t\tnext {\n\t\t\t\t\t\t\t\t\t\tdefinition: relationship,\n\t\t\t\t\t\t\t\t\t\tparams: received_params\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\trescue ActionController::ParameterMissing => e\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\tnil\n\t\t\t\t\t\tend\n\t\t\t\t\tend.compact\n\t\t\t\tend",
"def test_domain_can_appear_twice_if_it_is_disputed_and_reserved\n dispute = Dispute.new(domain_name: 'reserved.test', starts_at: Time.zone.today, password: 'disputepw')\n dispute.save\n\n get repp_v1_retained_domains_path\n response_json = JSON.parse(response.body, symbolize_names: true)\n\n assert response_json[:count] == 4\n\n expected_objects = [{ name: 'blocked.test',\n status: 'blocked',\n punycode_name: 'blocked.test' },\n { name: 'blockedäöüõ.test',\n status: 'blocked',\n punycode_name: 'xn--blocked-cxa7mj0e.test' },\n { name: 'reserved.test',\n status: 'reserved',\n punycode_name: 'reserved.test' },\n { name: 'reserved.test',\n status: 'disputed',\n punycode_name: 'reserved.test' }]\n\n assert_equal response_json[:domains].to_set, expected_objects.to_set\n end",
"def process_response\n case @msg.sip_method\n when :INVITE\n if client_transaction = @msg.connection.class.invite_client_transactions[@msg.via_branch_id]\n client_transaction.receive_response(@msg)\n return\n end\n when :ACK\n when :CANCEL\n if client_transaction = @msg.connection.class.invite_client_transactions[@msg.via_branch_id]\n client_transaction.receive_response_to_cancel(@msg)\n return\n end\n else\n if client_transaction = @msg.connection.class.non_invite_client_transactions[@msg.via_branch_id]\n client_transaction.receive_response(@msg)\n return\n end\n end\n log_system_debug \"ignoring a response non matching a client transaction (#{@msg.sip_method} #{@msg.status_code})\" if $oversip_debug\n end",
"def respond(request_type='', options={})\n opts = {'apiKey' => @api_key, 'trackingId' => @tracking_id}\n options.each do |key, value|\n opts[key.to_s.camelize(:lower)] = value\n end\n\n# puts \"#{__FILE__}:#{__LINE__} [#{__method__}] #{opts.inspect}\"\n\n base_url = (@sandbox ? 'http://sandbox.api.shopping.com/publisher/3.0/rest' : 'http://publisher.usb.api.shopping.com/publisher/3.0/rest')\n target_url = \"#{base_url}/#{request_type}\"\n\n# puts \"#{__FILE__}:#{__LINE__} [#{__method__}] Target URL: #{target_url}\"\n\n response = HTTParty.get(target_url, :query=>opts)\n# puts \"#{__FILE__}:#{__LINE__} [#{__method__}] #{response.inspect}\"\n\n target_key = ''\n response.parsed_response.each_key do |key|\n# puts \"#{__FILE__}:#{__LINE__} [#{__method__}] KEY: #{key}\"\n target_key = key\n end\n\n # now we decide what kind of response object gets returned\n # invoke the correct constructor based on the value of target_key\n response_class = SDC.const_get(\"#{target_key}\")\n# puts \"#{__FILE__}:#{__LINE__} [#{__method__}] FOO: #{response_class.class.name}\"\n# puts \"#{__FILE__}:#{__LINE__} [#{__method__}] FOO: #{response_class.new(response)}\"\n\n\n response_class.new(response)\n end",
"def response=(_arg0); end",
"def response=(_arg0); end",
"def response=(_arg0); end",
"def response=(_arg0); end",
"def test_twice_fail\n enter_the_room \"zark\"\n result=enter_the_room \"zark\", {:check_response => false}\n assert last_response.ok?, \"response was:\"+last_response.body\n assert result[\"result\"]==\"duplicate\"\n end",
"def multiple_from_response(client, response)\n return [] if response.empty?\n response.map { |atm_data| from_response(client.dup, atm_data)}\n end",
"def successful_requests\n @successful_requests ||= @responses.select{|r| r[:success] }\n end",
"def multi_response_nonblock\n raise 'multi_response has completed' if @multi_buffer.nil?\n\n @multi_buffer << @sock.read_available\n buf = @multi_buffer\n pos = @position\n values = {}\n\n while buf.bytesize - pos >= 24\n header = buf.slice(pos, 24)\n (key_length, _, body_length, cas) = header.unpack(KV_HEADER)\n\n if key_length == 0\n # all done!\n @multi_buffer = nil\n @position = nil\n @inprogress = false\n break\n\n elsif buf.bytesize - pos >= 24 + body_length\n flags = buf.slice(pos + 24, 4).unpack('N')[0]\n key = buf.slice(pos + 24 + 4, key_length)\n value = buf.slice(pos + 24 + 4 + key_length, body_length - key_length - 4) if body_length - key_length - 4 > 0\n\n pos = pos + 24 + body_length\n\n begin\n values[key] = [deserialize(value, flags), cas]\n rescue DalliError\n end\n\n else\n # not enough data yet, wait for more\n break\n end\n end\n @position = pos\n\n values\n rescue SystemCallError, Timeout::Error, EOFError => e\n failure!(e)\n end",
"def respond\n DEFAULT_RESPONSE\n end",
"def batch_responses\n return [@result] unless @batch_response\n # if batch response, generate array based on the response hash.\n @result.map do |r|\n next r unless r.is_a?(Hash)\n hash = r[SUCCESS] || r[ERROR]\n Parse::Response.new hash\n end\n end",
"def responses\n participants.flat_map(&:responses)\n end",
"def last_response\n defined?(super) ? super : response\n end",
"def definitions\n @definitions ||= { responses: {} }\n end",
"def index\n @responses = Response.all\n @response = Response.new\n end",
"def blocklisted_responder; end",
"def crappy_api_call\n $count += 1\n\n # First two calls fail\n raise \"OH SNAP\" if $count < 3\n\n # Next few calls say pending\n return :pending if $count < 5\n\n # Then finally done\n return :happy\nend",
"def response_from_service\n\n end",
"def adapt_response request_context, response\n connection.adapt_response request_context, response\n end",
"def handle_response(r, session, job, request, data)\n # handle_response will get customers in groups of 100. When this is 0, we're done.\n complete = r['xml_attributes']['iteratorRemainingCount'] == '0'\n\n # if no customer updates occured we skip this.\n if r['invoice_ret']\n\n# We will then loop through each customer and create records.\n r['invoice_ret'].each do |qb_inv|\n invoice_data = {}\n invoice_data[:txn_id] = qb_inv['txn_id']\n invoice_data[:invoice_number] = qb_inv['txn_number']\n invoice_data[:c_edit] = qb_inv['edit_sequence']\n invoice_data[:c_date] = qb_inv['txn_date']\n\n if qb_inv['po_number']\n invoice_data[:c_po] = qb_inv['po_number']\n end\n\n if qb_inv['customer_ref']\n invoice_data[:customer_id] = Customer.find_by(list_id: qb_inv['customer_ref']['list_id']).id\n invoice_data[:c_name] = qb_inv['customer_ref']['full_name']\n end\n \n if qb_inv['ship_address']\n invoice_data[:c_ship1] = qb_inv['ship_address']['addr1']\n invoice_data[:c_ship2] = qb_inv['ship_address']['addr2']\n invoice_data[:c_ship3] = qb_inv['ship_address']['addr3']\n invoice_data[:c_ship4] = qb_inv['ship_address']['addr4']\n invoice_data[:c_ship5] = qb_inv['ship_address']['addr5']\n invoice_data[:c_shipcity] = qb_inv['ship_address']['city']\n invoice_data[:c_shipstate] = qb_inv['ship_address']['state']\n invoice_data[:c_shippostal] = qb_inv['ship_address']['postal_code']\n invoice_data[:c_shipcountry] = qb_inv['ship_address']['country']\n end\n \n if qb_inv['sales_rep_ref']\n invoice_data[:c_rep] = qb_inv['sales_rep_ref']['full_name']\n end\n \n invoice_ref = Order.find_by txn_id: invoice_data[:txn_id]\n if invoice_ref.blank?\n Order.create(invoice_data)\n \n elsif invoice_ref.updated_at < qb_inv['time_modified']\n invoice_ref.update(invoice_data)\n else\n Rails.logger.info(\"Invoice hasn't been changed\")\n end\n \n # This will be for the line item section\n if qb_inv['invoice_line_ret']\n # binding.pry\n \n qb_inv['invoice_line_ret'].each do |li|\n # We need to match the lineitem with order id\n li_data = {}\n\n invoice_ref2 = Order.find_by txn_id: invoice_data[:txn_id]\n li_data[:order_id] = invoice_ref2[:id]\n \n# It's still breaking in here somehwere. Nil Nilclass, \n\n if li != {\"xml_attributes\"=>{}}\n if li['item_ref']\n # binding.pry\n list_id = li['item_ref']['list_id']\n if Item.find_by(list_id: list_id).present?\n li_data[:item_id] = Item.find_by(list_id: list_id).id\n# It doesn't match, or isn't an inventory item, add it to other\n else\n # 87 represents an other item\n li_data[:item_id] = 87\n end \n\n li_data[:product_name] = li['item_ref']['full_name']\n end\n end\n \n if li['description']\n li_data[:description] = li['description']\n end\n # Does the line item have a quantity\n li_data[:qty] = li['quantity'].nil? ? nil : li['quantity'].to_i\n # Does this li have an amount?\n li_data[:amount] = li['amount'].nil? ? nil : li['amount'].to_f\n \n if li['inventory_site_ref']\n site_id = li['inventory_site_ref']['list_id']\n li_data[:site_id] = Site.find_by(list_id: site_id).id\n li_data[:site_name] = li['inventory_site_ref']['full_name']\n end\n\n \n # Now we need to record these line items\n li_ref = LineItem.find_by txn_id: li['txn_line_id']\n if li_ref.blank?\n LineItem.create(li_data)\n \n elsif li_ref.updated_at < qb_inv['time_modified']\n li_ref.update(li_data)\n else\n Rails.logger.info(\"Invoice hasn't been changed\")\n end\n \n\n end\n\n \n end\n end\nend\nend",
"def setup\r\n # create a new assignment\r\n @response = responses(:response0)\r\n @response1 = @response.id\r\n @responsemaps = response_maps(:response_maps0)\r\n end",
"def fetch_response(id)\n res = @responses[id].response\n @responses.delete(id)\n res\n end",
"def possible_responses(sentence)\n responses = []\n\n # Find all patterns to try to match against\n @data[:responses].keys.each do |pattern|\n next unless pattern.is_a?(String)\n\n # For each pattern, see if the supplied sentence contains\n # a match. Remove substitution symbols (*) before checking.\n # Push all responses to the responses array.\n if sentence.match('\\b' + pattern.gsub(/\\*/, '') + '\\b')\n # If the pattern contains substitution placeholders,\n # perform the substitutions\n if pattern.include?('*')\n responses << @data[:responses][pattern].collect do |phrase|\n # First, erase everything before the placeholder\n # leaving everything after it\n matching_section = sentence.sub(/^.*#{pattern}\\s+/, '')\n\n # Then substitute the text after the placeholder, with\n # the pronouns switched\n phrase.sub('*', WordPlay.switch_pronouns(matching_section))\n end\n else\n # No placeholders? Just add the phrases to the array\n responses << @data[:responses][pattern]\n end\n end\n end\n\n # If there were no matches, add the default ones\n responses << @data[:responses][:default] if responses.empty?\n\n # Flatten the blocks of responses to a flat array\n responses.flatten\n end",
"def setup_relations! the_vo, vo_scope, related_scrapers, response\n \n the_vo.related_to.each_pair do |name, related_setup|\n \n # two possibilities: either we have all the data we need on this page, or we'll need another scrape:\n\n # 1 in the first we relate the the_vo.to the actual the_vo.we create with that data\n relation_handler = nil # this will be called once for each time the related thing is found\n if is_scraper? name.to_s\n \n # at mo, just need the first part of the name, the Scraper which is unique\n # TODO need to allow for full paths\n related_scraper_name, related_vo_name = name.to_s.split('::')\n scraper = related_scrapers[related_scraper_name.to_sym].deep_clone\n \n relation_handler = lambda do |fields|\n logger.info(\"Yielding #{scraper.class} to scraper related vo\")\n \n scraper.requests.each {|r| r.fields.merge!(@helper.format_scraper_fields(name,fields))}\n scraper.get_vo(related_vo_name.to_sym) \\\n .related_to.merge!(the_vo.name => the_vo.fields[:uuid])\n yield scraper\n end\n \n # 2 in the second case we relate the scraper's the_vo.back to this the_vo. with this the_vo.s UUID\n else\n \n # create and setup the related vo, storing it in the_vo\n related_vo = Vo.create(related_setup.merge(:name => name))\n #p the_vo.related_to, related_vo, related_setup\n #exit\n relation_handler = lambda do |fields|\n logger.info(\"Relating #{name} Vo to #{the_vo.name}\")\n \n found_related_vo = related_vo.deep_clone\n found_related_vo.fields.merge!(@helper.format_related_vo_fields(found_related_vo.name,fields))\n the_vo.related_to[name] = found_related_vo\n end\n \n end\n \n # are we querying the whole document, or just the item's scope?\n scopes = if related_setup[:item_path]\n response.query(related_setup[:item_path])\n else\n [vo_scope]\n end\n \n scopes.each do |scope|\n relation_handler.call(perform_data_requests(response, related_setup[:fields], scope))\n end\n \n end\n \n end",
"def response\n return launch_response if @echo_request.launch_request?\n return end_session_response if @echo_request.session_ended_request?\n\n ResponseFactory.new(@echo_request, @echo_response).response\n # SessionFactory.new(@echo_request, @echo_response).response\n end",
"def absorb other\n self.about = other.about if self.about.blank?\n other.touched_pointers.each { |ref| touch ref.entity, ref.in_collection }\n other.followees.each { |followee| self.add_followee followee }\n other.followers.each { |follower| follower.add_followee self }\n other.votings.each { |voting| vote(voting.entity, voting.up) } # Transfer all the other's votes\n super\n end",
"def perform(request, response); end"
] |
[
"0.6026438",
"0.5841394",
"0.55439067",
"0.5446502",
"0.542719",
"0.5337887",
"0.5318762",
"0.5269692",
"0.52479583",
"0.52070737",
"0.51787245",
"0.5172349",
"0.5171549",
"0.5166503",
"0.5166503",
"0.5166503",
"0.5166503",
"0.5166503",
"0.5166503",
"0.5166503",
"0.5166503",
"0.5166503",
"0.5166503",
"0.5166503",
"0.5166503",
"0.5166503",
"0.5160032",
"0.51452094",
"0.513567",
"0.5120354",
"0.5112519",
"0.5110947",
"0.5093888",
"0.5069036",
"0.5067665",
"0.5065953",
"0.506145",
"0.50595504",
"0.50517094",
"0.5049176",
"0.50370604",
"0.5036",
"0.50220215",
"0.5019382",
"0.5017815",
"0.500814",
"0.5007904",
"0.49995792",
"0.49974707",
"0.49952623",
"0.49944952",
"0.4979511",
"0.49793828",
"0.49752733",
"0.49742573",
"0.4968173",
"0.4960349",
"0.49555174",
"0.49533767",
"0.49524173",
"0.49491352",
"0.49424344",
"0.49209777",
"0.49183726",
"0.49116123",
"0.49090895",
"0.49028677",
"0.489979",
"0.48951384",
"0.48890823",
"0.4883918",
"0.48822388",
"0.48814514",
"0.48788905",
"0.48776343",
"0.4877156",
"0.4877156",
"0.4877156",
"0.4877156",
"0.48715317",
"0.4865228",
"0.48599425",
"0.4856446",
"0.48558187",
"0.48509088",
"0.48422673",
"0.4842134",
"0.48376763",
"0.48369282",
"0.48282304",
"0.48267284",
"0.48132947",
"0.48123157",
"0.48119867",
"0.4811282",
"0.48096982",
"0.48054606",
"0.48011187",
"0.47997057",
"0.47985336",
"0.4797355"
] |
0.0
|
-1
|
GET /links/1 GET /links/1.json
|
def show
@link = Link.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @link }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n render json: @links\n end",
"def index\n links = all_links\n render json: { success: true, links: links }\n end",
"def index\n @links = Link.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @links }\n end\n end",
"def show\n @link = Link.find(params[:id])\n paginate_all_links\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end",
"def show\n @link = Link.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @link }\n end\n end",
"def links\n json_hyperschema[\"links\"] || []\n end",
"def handle_links(json) end",
"def index\n @links = current_user.links.desc :created_at\n @title = 'Shared By You'\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @links }\n end\n end",
"def index\n @links = Link.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @links }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end",
"def links\n response = Clever.request :get, url\n response[:links]\n end",
"def show\n @link = Link.find(params[:id])\n\t\n\t@clicks = Click.count(:all, :conditions => [\"link_id = :link_id\", :link_id => @link.id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end",
"def links\n data['links']\n end",
"def index\n @links = Link.all\n end",
"def index\n @links = Link.all\n end",
"def index\n @links = Link.all\n end",
"def index\n @links = Link.all\n end",
"def index\n @links = Link.all\n end",
"def index\n @links = Link.all\n end",
"def index\n @links = Link.all\n end",
"def index\n @links = Link.all\n end",
"def links\n @user = User.find(params[:id])\n render json: {status: 'SUCCESS', message: 'List all Links in User', data: @user.links},status: :ok\n end",
"def link(link_full_name)\n links = objects_from_response(:get, 'api/info.json', { :id => link_full_name })\n links.first\n end",
"def show\n @useful_link = UsefulLink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @useful_link }\n end\n end",
"def show\n @link = Link.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @link }\n format.json { render :json => @link }\n end\n end",
"def show\n @resources_and_link = ResourcesAndLink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resources_and_link }\n end\n end",
"def show\n @jakeslink = Jakeslink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jakeslink }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def get_links_changes(params)\n get_json(links_changes_url(params))\n end",
"def new\n # pismo_grab_meta_data\n paginate_all_links\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def index\n if request.referrer.split('/').last == \"preview\"\n @deleted_from_preview = true\n end\n \n @links = Link.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @links }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @link }\n end\n end",
"def index\n @recommended_links = RecommendedLink.all\n\n render json: @recommended_links\n end",
"def index\n @publinks = Publink.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @publinks }\n end\n end",
"def index\n @links = Link.order(\"score DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @links }\n end\n end",
"def index\n @urls = ShortenedUrl.order(\"updated_at ASC\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @urls }\n end\n end",
"def link\n object[\"link\"]\n end",
"def show\n @link = Link.find_by_slug(params[:id])\n\n respond_to do |format|\n format.html { redirect_to @link.link }\n format.json { render json: @link }\n end\n end",
"def bannerAll\n @links = Link.order(\"link asc\")\n respond_to do |format|\n format.html # bannerAll.html.erb\n format.json { render json: @link }\n end\n end",
"def show\n @publink = Publink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @publink }\n end\n end",
"def href\n link.gsub(\".json\", \"\")\n end",
"def show\n @link = Link.find(params[:id])\n @topics = @link.tags\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end",
"def index\n @references = Reference.all\n\n render json: @references\n end",
"def show\n @storylink = Storylink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @storylink }\n end\n end",
"def show\n @url = Url.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @url }\n end\n end",
"def index\n @social_media_links = SocialMediaLink.all\n\n render json: @social_media_links\n end",
"def linked\n request('linked')\n end",
"def show\n @message_link = MessageLink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @message_link }\n end\n end",
"def show\n @tasklink = Tasklink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tasklink }\n end\n end",
"def index\n @api_v1_news_links = Api::V1::NewsLink.all\n end",
"def links(id)\n id = id[:id] if id.class == Hash\n id = id.to_s\n type = \"ticket\"\n sid = id\n if id =~ /(\\w+)\\/(.+)/\n type = $~[1]\n sid = $~[2]\n end\n reply = {}\n resp = @site[\"ticket/#{sid}/links/show\"].get\n return {:error => resp, } if resp =~ /does not exist\\.$/\n reply = response_to_h(resp)\n end",
"def index\n @url_links = UrlLink.all\n end",
"def new\n @link = Link.new\n @links_a=ManRsc.all\n @links_b=@links_a\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def json_print_links(json, reset = true)\n if @json_links && @json_links.any?\n json.links do\n @json_links.each do |k, v|\n json.set! k, v\n end\n end\n @json_links = {} if reset\n end\n end",
"def index\n @links = Link.all\n @links = Link.order(\"created_at DESC\").page params[:page]\n end",
"def show\n \t\tshort_url = 'http://localhost:3000/'+params[:shortened_link]\n \t\turl = Link.find_by(shortened_link: short_url)\n \t\tif url\n \t\t\toriginal_url = url.given_link\n \t\t\tredirect_to \"#{original_url}\"\n \t\telse\n \t\t\trender json: \"Not found\"\n \t\tend\n \tend",
"def show\n @link = @question.links.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @link }\n end\n end",
"def show\n\t\t@link = Link.find(params[:id])\n\tend",
"def index\n @urls = @site.urls.paginate(:page => params[:page])\n render json: @urls\n end",
"def index\n @links = Link.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @links }\n end\n end",
"def show\n @link = @campaign.links.find(params[:id])\n end",
"def show\n\t\t@url = UrlGenerator.find_by(encoded_url:params[:id])\n\t\tif @url.nil?\n\t\t\trender json:{error:\"not found\"}\n\t\telse\n\t\t\trender json:{orginal_url:@url.url}\n\t\tend\n\tend",
"def index\n @linkers = Linker.all\n end",
"def index\n # find all links to assigned invoices\n @links = current_recipient.links.includes(:invoice, :recipient)\n\n # only respond to html and json formats\n respond_to do |format|\n format.any(:html, :json)\n end\n end",
"def links\n @data[\"_links\"]\n end",
"def show\n @url = ShortenedUrl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @url }\n end\n end",
"def index\n @link_resources = LinkResource.where(lab: @lab)\n end",
"def index\n @pending_recommended_links = PendingRecommendedLink.all\n\n render json: @pending_recommended_links\n end",
"def all\n render json: Url.all\n end",
"def link\n\t\t\t@data['link']\n\t\tend",
"def new\n @useful_link = UsefulLink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @useful_link }\n end\n end",
"def test_should_create_link_via_API_JSON\r\n get \"/logout\"\r\n post \"/links.json\", :api_key => 'testapikey',\r\n :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response :created\r\n link = JSON.parse(response.body)\r\n check_new_link(link) \r\n end",
"def uri\n @json['user']['links']['self']\n end",
"def get(options = {})\n if @client.nil?\n return nil\n else\n r = @client.get(self, options)\n if r.is_a? Hash\n AbiquoAPI::LinkCollection.new(r, self.type, @client)\n else\n r\n end\n end\n end",
"def index\n @urls = Url.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @urls }\n end\n end",
"def show\n @linked_account = LinkedAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @linked_account }\n end\n end",
"def show\n @link = Link.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @link }\n end\n end",
"def showJSON\n\n\t\trender json: UrlDataModel.find(params[:id])\n\n\tend",
"def index\n render json: {\n status: :success,\n urls: ShortUrl::top_100\n }\n end",
"def show\n @affiliate_link = AffiliateLink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @affiliate_link }\n end\n end",
"def publishing_api_has_no_linked_items\n url = \"#{PUBLISHING_API_V2_ENDPOINT}/linked/\"\n stub_request(:get, %r{#{url}}).to_return(status: 200, body: [].to_json)\n end",
"def show\n render json: @url\n end",
"def show\n render json: @social_media_link\n end",
"def show_links\r\n links = Document.new(self).get_links\r\n puts \"There are #{links.length} links\"\r\n index = 1\r\n links.each do |l|\r\n puts \"link: name: #{l.name}\"\r\n puts \" id: #{l.id}\"\r\n puts \" href: #{l.href}\"\r\n puts \" index: #{index}\"\r\n index += 1\r\n end\r\n end",
"def new\n @links = Links.new\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end",
"def show\n\t\trender json: @url, status: 200\n\tend",
"def get_link(link,args={})\n link = BASE_URL + link\n get_request(link,args)\n end",
"def links\n return nil unless @item and self.type == :query and @item['entry']['link']\n @item['entry']['link']\n end",
"def new\n @jakeslink = Jakeslink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jakeslink }\n end\n end",
"def json_print_linked(json, reset = true)\n json_print_tl_linked(json, reset)\n json_print_tl_links(json, reset)\n end",
"def get_links(service)\n\t\treturn @transport.get_path(\"links\",service)\n\tend",
"def show\n @links = Links.new\n\n redirect_to '/'\n end",
"def url_list\n urls = current_user.mini_urls\n if urls.count > 0\n render json: {urls: urls}, status: 200\n else\n raise Exceptions::EmptyObjectError.new('No URL found.')\n end\n rescue Exceptions::EmptyObjectError => e\n render json: {error: e}, status: 404\n end",
"def links\n @links ||= []\n @links\n end",
"def index\n @links = current_user.links\n .includes(:tags, :domain, :user)\n .order(created_at: :desc)\n .page(params[:page])\n .load\n end"
] |
[
"0.7350112",
"0.7120274",
"0.7025738",
"0.69635993",
"0.6938119",
"0.6838034",
"0.6833723",
"0.6815706",
"0.68135786",
"0.6781963",
"0.6781963",
"0.6624377",
"0.65752435",
"0.6487915",
"0.6386929",
"0.6386929",
"0.6386929",
"0.6386929",
"0.6386929",
"0.6386929",
"0.6386929",
"0.6386929",
"0.63760424",
"0.63753116",
"0.6370063",
"0.62892497",
"0.627122",
"0.624254",
"0.62265164",
"0.62265164",
"0.62265164",
"0.62265164",
"0.62265164",
"0.6223857",
"0.6207658",
"0.6197805",
"0.6196327",
"0.6171531",
"0.61706233",
"0.61579776",
"0.61361784",
"0.6131693",
"0.613158",
"0.6125779",
"0.61005896",
"0.60946035",
"0.60901326",
"0.60506386",
"0.60246515",
"0.60034674",
"0.6002408",
"0.5996253",
"0.5988297",
"0.59781635",
"0.5976055",
"0.5958598",
"0.59580916",
"0.5947614",
"0.5920102",
"0.5915964",
"0.59141856",
"0.590795",
"0.589409",
"0.58777034",
"0.58728975",
"0.58648777",
"0.5859259",
"0.58561444",
"0.5829381",
"0.582724",
"0.5824123",
"0.5822541",
"0.58188295",
"0.5816662",
"0.58105814",
"0.58100796",
"0.58040917",
"0.5793987",
"0.57857406",
"0.5781902",
"0.5771186",
"0.5771049",
"0.57702243",
"0.5767799",
"0.57500285",
"0.57373136",
"0.57286555",
"0.5724885",
"0.5723932",
"0.57215667",
"0.5717973",
"0.5717609",
"0.5714206",
"0.56967014",
"0.56915367",
"0.5684356",
"0.5677677",
"0.566728",
"0.56637883",
"0.5663524"
] |
0.6990482
|
3
|
GET /links/new GET /links/new.json
|
def new
@link = Link.new
@links_a=ManRsc.all
@links_b=@links_a
respond_to do |format|
format.html # new.html.erb
format.json { render json: @link }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @link }\n end\n end",
"def new\n @useful_link = UsefulLink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @useful_link }\n end\n end",
"def new\n @links = Links.new\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end",
"def new\n # pismo_grab_meta_data\n paginate_all_links\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def new\n @url = Url.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @url }\n end\n end",
"def new\n @resources_and_link = ResourcesAndLink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resources_and_link }\n end\n end",
"def new\n @publink = Publink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @publink }\n end\n end",
"def new\n \n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @link }\n end\n end",
"def new\n @link = Link.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @link }\n end\n end",
"def new\n @link = Link.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @link }\n end\n end",
"def new\n @tasklink = Tasklink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tasklink }\n end\n end",
"def new\n\t\t@link = Link.new\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @link }\n\t\tend\n\tend",
"def new\n @link = Link.new :long => 'http://'\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @link }\n end\n end",
"def new\n @message_link = MessageLink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message_link }\n end\n end",
"def new\n @page_title = 'New URL'\n @url = ShortenUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @url }\n end\n end",
"def new\n @storylink = Storylink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @storylink }\n end\n end",
"def new\n\t\t@link = Link.new\n\tend",
"def new\n @link = Link.new\n end",
"def create\n \t@url = Url.build(params[:link],request.base_url) \t\n \trender json: @url.to_json\n end",
"def new\n @jakeslink = Jakeslink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jakeslink }\n end\n end",
"def new_link\n @project = Project.new(user_id: current_user.id)\n fetch_projects\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end",
"def new\n @url = ShortenedUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @url }\n end\n end",
"def new_link\n @link = Link.new\n end",
"def new\n @get = Get.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @get }\n end\n end",
"def handle_new\n obj = model.new(request.params[model.link], request)\n model.hook(:before_new, request, obj)\n new_page(obj)\n end",
"def new\n @referer = Referer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @referer }\n end\n end",
"def new\n @reference = Reference.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reference }\n end\n end",
"def new\n @page = current_site.pages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"def new\n @resource = Resource.new \n @link = Link.new\n end",
"def new\n @content_url = ContentUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @content_url }\n end\n end",
"def new\n @publinktype = Publinktype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @publinktype }\n end\n end",
"def new\n @link = current_user.links.new\n # @link = Link.new\n end",
"def new\n @click = Click.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @click }\n end\n end",
"def create\n if @link.save\n render json: @link, status: :created, location: @link\n else\n render json: @link.errors, status: :unprocessable_entity\n end\n end",
"def new\n @affiliate_link = AffiliateLink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @affiliate_link }\n end\n end",
"def new\n @blog_url = BlogUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @blog_url }\n end\n end",
"def new\n @url_connector = UrlConnector.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @url_connector }\n end\n end",
"def create\n @link = Link.new(params[:link])\n puts @link\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render json: @link, status: :created, location: @link }\n else\n format.html { render action: \"new\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @link = current_user.links.new\n end",
"def new\n @shared_url = SharedUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shared_url }\n end\n end",
"def new\n @relation = Relation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @relation }\n end\n end",
"def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end",
"def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end",
"def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end",
"def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end",
"def new\n add_breadcrumb :new\n @visit = Visit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @visit }\n end\n end",
"def new\n @link_type = LinkType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @link_type }\n end\n end",
"def new\n @social_network = SocialNetwork.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @social_network }\n end\n end",
"def new\n @static_link = StaticLink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @static_link }\n end\n end",
"def new\n @articleurl = Articleurl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @articleurl }\n end\n end",
"def new\n @network = Network.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @network }\n end\n end",
"def new\n @thing = Thing.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @thing }\n end\n end",
"def create\n @link = Link.new(params[:link])\n\n respond_to do |format|\n if @link.save\n @response = { url: \"#{request.protocol}#{request.host_with_port}/#{Link.encode(@link.id)}\" }\n format.json { render json: @response, status: :created, location: @link }\n else\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @obj = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @obj }\n end\n end",
"def new\n\t\t@rlink = Rlink.new\n\tend",
"def new\n @published = Published.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @published }\n end\n end",
"def new\n @feed = Feed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feed }\n end\n end",
"def new\n @feed = Feed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feed }\n end\n end",
"def new\n @feed = Feed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feed }\n end\n end",
"def new\n @feed = Feed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feed }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"def new\n @site = Site.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @stuff = Stuff.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @stuff }\n end\n end",
"def new\n @thing = Thing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @thing }\n end\n end",
"def new\n @bookmark = Bookmark.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @bookmark }\n end\n end",
"def new\n @entry = Entry.new\n\n render json: @entry\n end",
"def new\n @link_category = LinkCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link_category }\n format.js\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.haml\n format.json { render :json => @news_item }\n end\n end",
"def new\n @routing = Routing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @routing }\n end\n end",
"def new\n @base_url = BaseUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @base_url }\n end\n\n end",
"def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"def new\n @anchoring = Anchoring.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @anchoring }\n end\n end",
"def new\n @feed = Feed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @feed }\n end\n end",
"def create\n @url = request.format.json? ? Url.new(original_link: params[:original_link]) : Url.new(url_params)\n\n respond_to do |format|\n if @url.save\n format.html { redirect_to @url, notice: 'URL was successfully created.' }\n format.json { render :show, status: :created, location: @url }\n else\n format.html { render :new }\n format.json { render json: @url.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n # Create new news\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news }\n end\n end"
] |
[
"0.7882237",
"0.7882237",
"0.7882237",
"0.7882237",
"0.7882237",
"0.7807135",
"0.7548326",
"0.7494255",
"0.7478307",
"0.73248",
"0.71945024",
"0.714992",
"0.7140056",
"0.7139754",
"0.7139754",
"0.70566434",
"0.7049113",
"0.70003074",
"0.6975316",
"0.6975316",
"0.6975316",
"0.6975316",
"0.6954977",
"0.69119275",
"0.68942344",
"0.68712157",
"0.6847864",
"0.6823687",
"0.67935085",
"0.6790726",
"0.6781406",
"0.6769522",
"0.67521316",
"0.6720439",
"0.6696362",
"0.6691844",
"0.6691251",
"0.6681052",
"0.6678197",
"0.6667676",
"0.66598004",
"0.665593",
"0.6655806",
"0.6647375",
"0.6628905",
"0.66232705",
"0.6605967",
"0.66010135",
"0.65957",
"0.65927595",
"0.6583906",
"0.6583906",
"0.6583906",
"0.6583906",
"0.65716827",
"0.6563761",
"0.654612",
"0.65456456",
"0.65365344",
"0.651592",
"0.6506228",
"0.65028906",
"0.6493243",
"0.6493243",
"0.6493243",
"0.6493243",
"0.6493243",
"0.64912385",
"0.6486793",
"0.6485689",
"0.6476014",
"0.6476014",
"0.6476014",
"0.6476014",
"0.647486",
"0.6466279",
"0.6466279",
"0.6466279",
"0.6466279",
"0.6466279",
"0.645972",
"0.64554447",
"0.64554447",
"0.64554447",
"0.64554447",
"0.6451286",
"0.64472365",
"0.64374655",
"0.6435305",
"0.6424718",
"0.6417289",
"0.64164793",
"0.6414277",
"0.64111704",
"0.64111704",
"0.64111704",
"0.64074713",
"0.6405197",
"0.640321",
"0.6399187"
] |
0.647648
|
70
|
POST /links POST /links.json
|
def create
@link = Link.new(params[:link])
puts "////////////////////////////"
puts params
respond_to do |format|
if @link.save
format.html { redirect_to links_url, notice: t('links.create.notice') }
format.json { render json: @link, status: :created, location: @link }
else
@links_a=ManRsc.all
@links_b=linksb(params[:link][:link_a])
format.html { render action: "new" }
format.json { render json: @link.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n if @link.save\n render json: @link, status: :created, location: @link\n else\n render json: @link.errors, status: :unprocessable_entity\n end\n end",
"def test_should_create_link_via_API_JSON\r\n get \"/logout\"\r\n post \"/links.json\", :api_key => 'testapikey',\r\n :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response :created\r\n link = JSON.parse(response.body)\r\n check_new_link(link) \r\n end",
"def create\n @link = Link.new(params[:link])\n\n respond_to do |format|\n if @link.save\n @response = { url: \"#{request.protocol}#{request.host_with_port}/#{Link.encode(@link.id)}\" }\n format.json { render json: @response, status: :created, location: @link }\n else\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = current_user.links.build(link_params) # using devise helper \"current_user\"\n logger.debug \" DEBUG :::::::: #{link_params.to_json}\"\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(params[:link])\n puts @link\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render json: @link, status: :created, location: @link }\n else\n format.html { render action: \"new\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = current_user.links.new link_params\n create_and_respond(@link)\n end",
"def create\n @link = current_user.links.build(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = @campaign.links.new(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to campaign_links_path, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: campaign_links_path }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = current_user.links.build(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def handle_links(json) end",
"def create\n @link = Link.new(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to edit_link_url(@link), notice: 'Link was successfully created.' }\n format.json { render :edit, status: :created, location: edit_link_url(@link) }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \t@url = Url.build(params[:link],request.base_url) \t\n \trender json: @url.to_json\n end",
"def create\n @link = Link.new(params[:link])\n @link.user = current_user\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render json: @link, status: :created, location: @link }\n else\n format.html { render action: \"new\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(params[:link])\n @link.user = @current_user\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to link_comments_url(@link), notice: 'Link was successfully created.' }\n format.json { render json: link_comments_url(@link), status: :created, location: link_comments_url(@link) }\n else\n format.html { render action: \"new\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(params[:link])\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, :notice => 'Ссылка была успешно создана' }\n format.mobile { redirect_to @link, :notice => 'Ссылка была успешно создана' }\n format.json { render :json => @link, :status => :created, :location => @link }\n else\n format.html { render :action => \"new\" }\n format.mobile { render :action => \"new\" }\n format.json { render :json => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to info_path(@link.slug), notice: \"Link was successfully created.\" }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { redirect_to new_link_path, alert: @link.errors.full_messages.join(\", \") }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @test_link = TestLink.new(test_link_params)\n\n if @test_link.save\n render :show, status: :created, location: @test_link\n else\n render json: @test_link.errors, status: :unprocessable_entity\n end\n end",
"def create\n @link = Link.new(params[:link])\n\n respond_to do |format|\n if (@entity.links << @link)\n flash[:notice] = 'Link was successfully created.'\n furl = link_url(@entity,@link)\n format.html { redirect_to furl}\n format.xml { head :created, :location => furl }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @link.errors.to_xml }\n end\n end\n end",
"def create\n @link = current_user.links.new( link_params )\n # @link = Link.new( link_params )\n # @link.user = current_user\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = current_user.links.build(link_params)\n \n @link.num = 2\n @link.user_name = current_user.nickname\n @link.description = current_user.description\n @link.description_permission = current_user.description_permission\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: '투표안건이 성공적으로 작성되었습니다.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(link_params)\n @link.user = current_user\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(params[:link])\n \n @link.user_id = current_user_id\n\n respond_to do |format|\n if @link.save\n @post = Post.find(@link.post_id);\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render json: @link, status: :created, location: @link }\n format.js {}\n else\n format.html { render action: \"new\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @url_link = UrlLink.new(url_link_params)\n\n respond_to do |format|\n if @url_link.save\n format.html { redirect_to @url_link, notice: 'Url link was successfully created.' }\n format.json { render :show, status: :created, location: @url_link }\n else\n format.html { render :new }\n format.json { render json: @url_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @useful_link = UsefulLink.new(params[:useful_link])\n\n respond_to do |format|\n if @useful_link.save\n format.html { redirect_to @useful_link, notice: 'Useful link was successfully created.' }\n format.json { render json: @useful_link, status: :created, location: @useful_link }\n else\n format.html { render action: \"new\" }\n format.json { render json: @useful_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_links\n return if @links.nil?\n\n if @links.empty?\n Rentlinx.client.unpost_links_for(self)\n else\n Rentlinx.client.post_links(@links)\n end\n end",
"def create\n\t\tlink = current_user.links.new(link_params)\n\n\t\trespond_to do | format |\n\t\t\tif link.save\n\t\t\t\tformat.html{\n\t\t\t\t\tredirect_to link\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tformat.html{\n\t\t\t\t\trender action: \"new\"\n\t\t\t\t}\n\t\t\tend\n\t\tend \n\t\t\n\tend",
"def create_links\n end",
"def create_links\n end",
"def create\n @linkpost = Linkpost.new(linkpost_params)\n\n respond_to do |format|\n if @linkpost.save\n format.html { redirect_to @linkpost, notice: 'Linkpost was successfully created.' }\n format.json { render action: 'show', status: :created, location: @linkpost }\n else\n format.html { render action: 'new' }\n format.json { render json: @linkpost.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(link_params)\n\n respond_to do |format|\n if @link.save\n if @link.shortened.nil? or @link.shortened.empty?\n @link.assign_unique_shortened_string\n @link.save\n end\n current_user.links << @link\n current_user.save\n\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @url = request.format.json? ? Url.new(original_link: params[:original_link]) : Url.new(url_params)\n\n respond_to do |format|\n if @url.save\n format.html { redirect_to @url, notice: 'URL was successfully created.' }\n format.json { render :show, status: :created, location: @url }\n else\n format.html { render :new }\n format.json { render json: @url.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link_request = LinkRequest.new(link_request_params)\n\n respond_to do |format|\n if @link_request.save\n @link_request.sterrenlinks.create!\n format.html { redirect_to @link_request, notice: 'Link request was successfully created.' }\n format.json { render :show, status: :created, location: @link_request }\n else\n format.html { render :new }\n format.json { render json: @link_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(params[:link].merge(:created_by => current_user)) \n respond_to do |format|\n if @link.save!\n logger.warn(\"#{@link.id}\")\n publish :links, \"#{@link.id}\\0\"\n flash[:notice] = 'Link was successfully created.'\n format.html { redirect_to(@link) }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @resources_and_link = ResourcesAndLink.new(params[:resources_and_link])\n\n respond_to do |format|\n if @resources_and_link.save\n format.html { redirect_to @resources_and_link, notice: 'Resources and link was successfully created.' }\n format.json { render json: @resources_and_link, status: :created, location: @resources_and_link }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resources_and_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link_resource = LinkResource.new(link_resource_params)\n\n respond_to do |format|\n if @link_resource.save\n format.html { redirect_to @lab, notice: 'Link resource was successfully created.' }\n format.json { render action: 'show', status: :created, location: @link_resource }\n else\n format.html { render action: 'new' }\n format.json { render json: @link_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(link_params)\n @link.active = true # make link active by default\n @link.admin_id = SecureRandom.uuid\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to link_admin_path(@link.admin_id), notice: \"Link was successfully created.\" }\n # format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new, status: :unprocessable_entity }\n # format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_account_link\n render json: Stripe::AccountLink.create(account_params.to_h), status: :created\n end",
"def link_data\n params.permit(links: [:url])\n .require(:links)\n .values\n end",
"def create\n @link = @question.links.new(params[:link])\n @link.user_id = current_user.id\n\n respond_to do |format|\n if @link.save\n flash[:notice] = 'link was successfully created.'\n format.html { redirect_to(@question) }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n else\n format.html { redirect_to @question }\n flash[:notice] = 'Link must start with \"http://\"'\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n \n\t# Cria o hash MD5 da string do link\n params[:link][:token] = Digest::MD5.hexdigest(params[:link][:link]).encode('UTF-8')\n\t\n\t# Obtem o ID do usuario\n\tparams[:link][:user_id] = session[:user_id]\n\t\n\t# Verifica se este hash ja nao existe no banco. MD5 gera conflitos, mas como sao \n\t# poucos links, isto nao sera problema.\n\t@link = Link.find_by_token params[:link][:token]\n\t\n\t# Variavel de verificacao para saber se o link foi salvo\n\tsave = 0\n\t\n\t# Se o link nao existir no banco...\n\tif @link.nil? then\n\t\n\t\t# Obtem os dados do usuario (IP e user agent)\n\t params[:link][:ip] = request.env[\"REMOTE_ADDR\"].encode('UTF-8')\n\t params[:link][:user_agent] = request.env[\"HTTP_USER_AGENT\"].encode('UTF-8')\n\t \n\t # Cria o registro\n\t @link = Link.new(params[:link]) \n\t \n\t # Salva, verifica o salvamento e atualiza a variavel para verificacao do salvamento\n\t save = @link.save ? 1 : 0\n\tend\n \t\n respond_to do |format|\n if save == 1\n format.html { redirect_to @link, notice: 'Link adicionado com sucesso!' }\n format.json { render json: @link, status: :created, location: @link }\n else\n format.html { redirect_to @link, notice: 'Link ja adicionado anteriormente!' }\n format.json { render json: @link, status: :created, location: @link }\n end\n end\n end",
"def post(href, additional_parameters = {})\n rest_connect do |base_uri, headers|\n href = \"#{base_uri}/#{href}\" unless begins_with_slash(href)\n res = Net::HTTP::Post.new(href , headers)\n unless additional_parameters.empty?\n res.set_content_type('application/json')\n res.body = additional_parameters.to_json\n end\n #res.set_form_data(additional_parameters, '&')\n res\n end\n end",
"def create\n @jakeslink = Jakeslink.new(params[:jakeslink])\n\n respond_to do |format|\n if @jakeslink.save\n format.html { redirect_to @jakeslink, notice: 'Jakeslink was successfully created.' }\n format.json { render json: @jakeslink, status: :created, location: @jakeslink }\n else\n format.html { render action: \"new\" }\n format.json { render json: @jakeslink.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link_builder = LinkBuilder.new(link_builder_params)\n\n respond_to do |format|\n if @link_builder.save\n format.html { redirect_to @link_builder, notice: \"Link builder was successfully created.\" }\n format.json { render :show, status: :created, location: @link_builder }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @link_builder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tasklink = Tasklink.new(params[:tasklink])\n\n respond_to do |format|\n if @tasklink.save\n format.html { redirect_to @tasklink, notice: 'Tasklink was successfully created.' }\n format.json { render json: @tasklink, status: :created, location: @tasklink }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tasklink.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @api_v1_news_link = Api::V1::NewsLink.new(api_v1_news_link_params)\n\n respond_to do |format|\n if @api_v1_news_link.save\n format.html { redirect_to @api_v1_news_link, notice: 'News link was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_news_link }\n else\n format.html { render :new }\n format.json { render json: @api_v1_news_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @check_link = CheckLink.new()\n\n @check_link.get_all_links(check_link_params['checked_url'])\n respond_to do |format|\n if @check_link.save\n format.html { redirect_to @check_link, notice: 'Check link was successfully created.' }\n format.json { render :show, status: :created, location: @check_link }\n else\n format.html { render :new }\n format.json { render json: @check_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @recommended_link = RecommendedLink.new(recommended_link_params)\n\n if @recommended_link.save\n render json: @recommended_link, status: :created, location: @recommended_link\n else\n render json: @recommended_link.errors, status: :unprocessable_entity\n end\n end",
"def links\n json_hyperschema[\"links\"] || []\n end",
"def create\n @blog_link = BlogLink.new(blog_link_params)\n\n respond_to do |format|\n if @blog_link.save\n format.html { redirect_to @blog_link, notice: 'Blog link was successfully created.' }\n format.json { render action: 'show', status: :created, location: @blog_link }\n else\n format.html { render action: 'new' }\n format.json { render json: @blog_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(params[:link])\n \n respond_to do |format|\n if @link.save\n flash[:notice] = 'Link was successfully created.'\n format.html { redirect_to(@link) }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n normalized_url = Link.normalize_url(params[:url])\n if normalized_url.nil?\n render json: LinkResponse.new(ERROR_INVALID_URL, params[:code]), status: 422\n else\n begin\n link = Link.find_or_create(normalized_url, params[:type])\n render json: LinkResponse.new(SUCCESS, link.code), status: 200\n rescue => error\n render json: LinkResponse.new(ERROR_INVALID_URL, params[:code]), status: 500\n end\n end\n end",
"def ajax_add_link\n\n # Create a new Link Instance\n link = Link.new\n\n # Update the fields of Link Instance\n link.funnel_id = params[:funnel_id]\n link.to_node_id = params[:to_operator_id].to_i\n\n if params[:from_operator_id].to_i === 0\n # If the link starts at the start node, set slink to 1\n link.start_link = 1\n else\n # Otherwise, set slink to 0 (false) and set from_operator_id\n link.start_link = 0\n link.from_node_id = params[:from_operator_id].to_i\n end\n\n # Save and verify Link and return correct JSON response\n if link.save!\n final_json = JSON.pretty_generate(result = {\n :success => true\n })\n else\n final_json = JSON.pretty_generate(result = {\n :success => false\n })\n end\n\n # Return JSON response\n render json: final_json\n\n end",
"def create\n @demo_link = DemoLink.new(demo_link_params)\n\n respond_to do |format|\n if @demo_link.save\n format.html { redirect_to @demo_link, notice: 'Demo link was successfully created.' }\n format.json { render :show, status: :created, location: @demo_link }\n else\n format.html { render :new }\n format.json { render json: @demo_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @users_interests_link = UsersInterestsLink.new(users_interests_link_params)\n\n respond_to do |format|\n if @users_interests_link.save\n format.html { redirect_to @users_interests_link, notice: 'Users interests link was successfully created.' }\n format.json { render :show, status: :created, location: @users_interests_link }\n else\n format.html { render :new }\n format.json { render json: @users_interests_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(params[:link])\n doc = Pismo::Document.new(@link.url) \n #grab metadata from doc\n if doc.title.nil?\n @link.name = doc.description\n else\n @link.name = doc.title\n end\n @link.favicon = doc.favicon\n\n #FOR OFFLINE USE\n #@link.name = \"Offline Description\"\n\n\n\n\n paginate_all_links\n respond_to do |format|\n if @link.save\n #if using bookmarklet foward back to link you came from\n if request.referer =~ /autosave/\n format.html { redirect_to @link.url }\n else\n #if using frontpage redirect to show all links \n format.html { redirect_to root_url+\"#show-links\", notice: 'Link was successfully created.' }\n end\n format.html { redirect_to @link.url, notice: 'Link was successfully created.' }\n format.json { render json: @link, status: :created, location: @link }\n else\n format.html { render action: \"new\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @storylink = Storylink.new(params[:storylink])\n\n respond_to do |format|\n if @storylink.save\n format.html { redirect_to @storylink, notice: 'Storylink was successfully created.' }\n format.json { render json: @storylink, status: :created, location: @storylink }\n else\n format.html { render action: \"new\" }\n format.json { render json: @storylink.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @social_media_link = SocialMediaLink.new(social_media_link_params)\n\n if @social_media_link.save\n render json: @social_media_link, status: :created\n else\n render json: @social_media_link.errors, status: :unprocessable_entity\n end\n end",
"def create\n @link = Link.new(params[:link])\n\n respond_to do |format|\n if @link.save\n flash[:notice] = 'Link was successfully created.'\n format.html { redirect_to(@link) }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(params[:link])\n\n respond_to do |format|\n if @link.save\n flash[:notice] = 'Link was successfully created.'\n format.html { redirect_to(@link) }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n render json: @links\n end",
"def test_should_create_link_via_API_XML\r\n get \"/logout\"\r\n post \"/links.xml\", :api_key=>'testapikey',\r\n :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response :created\r\n end",
"def create\n linked_account_ids = post_params.delete(:linked_account_ids)\n linked_accounts = current_user.linked_accounts.where(id: linked_account_ids)\n save_successful = create_multiple_from_linked_accounts(linked_accounts)\n\n # @post = Post.new(post_params)\n\n respond_to do |format|\n if save_successful\n format.html { redirect_to posts_path, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(params[:link])\n\n respond_to do |format|\n if @link.save\n flash[:notice] = 'Link was successfully created.'\n format.html { redirect_to :controller => 'admin/links' }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @ordering_link = OrderingLink.new(ordering_link_params)\n\n respond_to do |format|\n if @ordering_link.save\n format.html { redirect_to @ordering_link, notice: 'Ordering link was successfully created.' }\n format.json { render :show, status: :created, location: @ordering_link }\n else\n format.html { render :new }\n format.json { render json: @ordering_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @account_link = AccountLink.new(account_link_params)\n @account_link.user = @user;\n respond_to do |format|\n if @account_link.save\n format.html { redirect_to @account_link.user, notice: 'Account link was successfully created.' }\n format.json { render :show, status: :created, location: @account_link }\n else\n format.html { render :new }\n format.json { render json: @account_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n # pismo_grab_meta_data\n paginate_all_links\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def create\n \t@link = @category.links.new(link_params)\n\n \tif @link.save\n \t\tflash[:success] = \"Your link has been added\"\n \t\tredirect_to category_path(@category)\n\n \telse\n \t\trender :new\n \tend\n\n end",
"def link_params\n params.require(:link).permit(:link, :name)\n end",
"def create\n @link = Link.new(params[:link])\n\t\t@link.user = current_user\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to(@link, :notice => 'Link was successfully created.') }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end",
"def create\n @link = Link.new(link_params)\n @link.user_id = session[:user_id]\n respond_to do |format|\n if @link.save\n format.html do\n redirect_to root_path,\n notice: \"Short Url is '#{@link.display_slug}'\"\n end\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def link_params\n params.require(:link).permit(:name, :target, :owners)\n end",
"def create\n @shortlink = Shortlink.new(shortlink_params)\n\n respond_to do |format|\n if @shortlink.save\n format.html { redirect_to shortlinks_path, notice: 'Shortlink was successfully created.' }\n format.json { render :show, status: :created, location: @shortlink }\n else\n format.html { render :new }\n format.json { render json: @shortlink.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @linkctr = Linkctr.new(linkctr_params)\n\n respond_to do |format|\n if @linkctr.save\n format.html { redirect_to @linkctr, notice: 'Linkctr was successfully created.' }\n format.json { render action: 'show', status: :created, location: @linkctr }\n else\n format.html { render action: 'new' }\n format.json { render json: @linkctr.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_payment_link(body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::POST,\n '/v2/online-checkout/payment-links',\n 'default')\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end",
"def create\n \n #user = current_user\n if params[:user].nil?\n user = current_user\n else\n user = User.find(params[:user])\n end\n \n email = params[:email].to_s\n\n unless params[:source].nil? || params[:source].empty?\n params[:link] = Hash.new\n\n params[:link][:source] = Hash.new\n params[:link][:source] = params[:source]\n end\n\n \t\tlink = Mechanize.new { |agent| agent.user_agent_alias = 'Mac Safari'}\n\t\tlink.get \"http://img.bitpixels.com/getthumbnail?code=27543&size=200&url=\" + Link.makeAbsolute(params[:link][:source])\n\t\tlink.get(Link.makeAbsolute(params[:link][:source]))\n title = link.page.title \n\n if User.where(:email => /#{email}/).any?\n reciever_id = User.where(:email => /#{email}/i).first.id\n else\n u = User.create!(\n :name => \"Temp User\", \n :email => email, \n :password => \"temppass\", \n :password_confirmation => \"temppass\",\n :isTemp => true \n )\n reciever_id = u.id\n end\n \n @link = user.links.new(params[:link].merge({\n :reciever_id => reciever_id, \n :title => title, \n :source => Link.makeAbsolute(params[:link][:source]),\n }))\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to :back, notice: 'Link was successfully created.' }\n format.json { render json: @link, status: :created, location: @link }\n else\n format.html { render action: \"new\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pending_recommended_link = PendingRecommendedLink.new(pending_recommended_link_params)\n\n if @pending_recommended_link.save\n render json: @pending_recommended_link, status: :created\n else\n render json: @pending_recommended_link.errors, status: :unprocessable_entity\n end\n end",
"def create\n @message_link = MessageLink.new(params[:message_link])\n\n respond_to do |format|\n if @message_link.save\n format.html { redirect_to @message_link, notice: 'Message link was successfully created.' }\n format.json { render json: @message_link, status: :created, location: @message_link }\n else\n format.html { render action: \"new\" }\n format.json { render json: @message_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_link\n if request.post?\n @link = @semester.links.build(params[:link])\n @link.user_id = @current_user.id\n if @link.save\n flash[:notice] = \"#{@link.title} created\"\n redirect_to :action => :index\n else\n render :action => :new\n end\n end\n end",
"def create\n # decide if link url already exists in db\n @potentialLink = Link.find_by(url: links_params[:url])\n @link = current_user.links.new(title: links_params[:title], url: links_params[:url])\n # cleans up link so that it always has http://\n if @link.url.include?('http://')\n @link.save\n else\n @link.url.insert(0, 'http://')\n @link.save\n end\n # @keyword = self.keywords\n\n # captures string of tags\n @inputtedtags = (links_params[:link_tags_attributes]['0'][:tag_attributes][:name]).gsub(/,/, '').downcase.split(' ').flatten\n\n # Decide if tag is already in the database\n @inputtedtags.each do |tag|\n potentialTag = Tag.find_by(name: tag)\n # if tag is already in db, create a new association between new link and old tag\n if potentialTag\n @link_tag = @link.link_tags.build(link_id: @link.id, tag_id: potentialTag.id)\n @link_tag.save\n # otherwise, save new tag\n else\n @link.tags.build(name: tag)\n @link.save\n end\n end\n # render tags dynamically without reloading page\n respond_to do |format|\n if @link.save\n format.json { render json: @link, include: :tags, status: :created }\n else\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @publink = Publink.new(params[:publink])\n\n respond_to do |format|\n if @publink.save\n format.html { redirect_to @publink, notice: 'Publink was successfully created.' }\n format.json { render json: @publink, status: :created, location: @publink }\n else\n format.html { render action: \"new\" }\n format.json { render json: @publink.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tnew_rlink = params.require(:rlink).permit(:link, :random_string)\n\t\trlink = Rlink.create(new_rlink)\n \tredirect_to rlink\n\tend",
"def create\n\t\trandom_str = SecureRandom.urlsafe_base64(10)\n\t\tlink = Link.create(url: params[\"link\"][\"url\"], random_string: random_str)\n\t\tredirect_to link_path(link.random_string)\n\tend",
"def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @link }\n end\n end",
"def create\n @recomendacion_link = RecomendacionLink.new(recomendacion_link_params)\n\n respond_to do |format|\n if @recomendacion_link.save\n format.html { redirect_to @recomendacion_link, notice: 'Recomendacion link was successfully created.' }\n format.json { render :show, status: :created, location: @recomendacion_link }\n else\n format.html { render :new }\n format.json { render json: @recomendacion_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def link_params\n params.require(:link).permit(:title, :url)\n end",
"def link_params\n params.require(:link).permit(:title, :url)\n end",
"def link_params\n params.require(:link).permit(:title, :url)\n end",
"def create\n @link = Link.new(link_params)\n if @link.save\n flash[:success] = \"Link to Doc Created\"\n redirect_to current_user\n else\n flash[:warning] = \"Something went wrong try again.\"\n redirect_to 'new'\n end\n end",
"def add_link(links)\n links = [links] if links.is_a?(String)\n self.class.get(\"/action/add/links/grabber0/start1/\"+links.join(\" \"))\n end",
"def create\n @link = LinkCreator.new(link_params)\n Rails.logger.debug(link_params)\n\n @link.user = current_user\n \n respond_to do |format|\n if @link.save\n\n format.html do\n if params[:return_to].present?\n redirect_to params[:return_to]\n else\n redirect_to root_url, notice: 'Link wurde hinzugefügt.'\n end\n end\n format.json { render action: 'show', status: :created, location: @link }\n else\n format.html { render action: 'pots/new' }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @link = Link.new(link_params)\n add_http\n if Link.find_by address: @link.address.downcase\n new_link = Link.find_by address: @link.address\n redirect_to root_path\n else\n @link.vote_score = 0\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def create_raw\n\n @link = Link.new(link_params)\n\n # print params\n puts link_params\n\n # get HTML from saved source\n @link.html_from_url(link_params['html'])\n \n # retrieve thumbnail from URL\n @link.picture_from_url(link_params['screenshot'])\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"def link_params\n params.require(:link).permit(:url)\n end"
] |
[
"0.7279239",
"0.7042173",
"0.6892667",
"0.6849184",
"0.67824477",
"0.67146206",
"0.6708206",
"0.66861737",
"0.66628766",
"0.66427463",
"0.66249496",
"0.65540344",
"0.6506658",
"0.64941686",
"0.6478123",
"0.6459337",
"0.64366543",
"0.64365256",
"0.6423571",
"0.64210635",
"0.6417331",
"0.63962567",
"0.63950574",
"0.638552",
"0.63540053",
"0.6343384",
"0.6323472",
"0.6312651",
"0.6302025",
"0.6302025",
"0.6284618",
"0.6224202",
"0.6199774",
"0.6177444",
"0.61766493",
"0.6166064",
"0.61637634",
"0.61494696",
"0.6113309",
"0.6087209",
"0.6083712",
"0.6077344",
"0.6069627",
"0.6055122",
"0.60378844",
"0.601245",
"0.60058814",
"0.60024536",
"0.5999441",
"0.59973055",
"0.59962356",
"0.5979099",
"0.59674335",
"0.596644",
"0.5935938",
"0.5935588",
"0.59317213",
"0.5924761",
"0.5916282",
"0.5901174",
"0.5901174",
"0.5900975",
"0.58828115",
"0.5872234",
"0.58703166",
"0.5864439",
"0.58606833",
"0.5859109",
"0.585192",
"0.58426857",
"0.5820819",
"0.58192325",
"0.58192325",
"0.58192325",
"0.58192325",
"0.58192325",
"0.5811679",
"0.5806083",
"0.580496",
"0.58028126",
"0.57958513",
"0.5792504",
"0.5792268",
"0.5791326",
"0.57786936",
"0.57714516",
"0.5765401",
"0.57544696",
"0.5748576",
"0.57480645",
"0.57448316",
"0.57428783",
"0.57428783",
"0.57428783",
"0.5726716",
"0.5726461",
"0.5720168",
"0.5707216",
"0.5705085",
"0.5691303"
] |
0.6231388
|
31
|
DELETE /links/1 DELETE /links/1.json
|
def destroy
@link = Link.find(params[:id])
@link.destroy
respond_to do |format|
format.html { redirect_to links_url }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url }\n format.json { head :ok }\n end\n end",
"def delete; rest_delete(link('self')); end",
"def delete; rest_delete(link('self')); end",
"def destroy \n Link.connection.execute(\"delete from links where id in (#{params[:id].join(',')})\") unless params[:id].blank?\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url, notice: \"Link was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: '투표안건이 성공적으로 삭제되었습니다.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link = @entity.links.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @link = Link.find(params[:id])\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: \"Link was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n destroy_and_respond(@link)\n end",
"def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url+\"#show-links\", notice: 'Link was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html do\n redirect_to root_path,\n notice: \"Link was successfully deleted\"\n end\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to campaign_links_path, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to new_link_url, notice: \"Link was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @link = Links.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to('/') }\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def delete\n client.delete(\"/#{id}\")\n end",
"def delete\n delete_from_server single_url\n end",
"def destroy\n @jakeslink = Jakeslink.find(params[:id])\n @jakeslink.destroy\n\n respond_to do |format|\n format.html { redirect_to jakeslinks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link_resource.destroy\n respond_to do |format|\n format.html { redirect_to @lab }\n format.json { head :no_content }\n end\n end",
"def destroy\n @url_link.destroy\n respond_to do |format|\n format.html { redirect_to url_links_url, notice: 'Url link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @useful_link = UsefulLink.find(params[:id])\n @useful_link.destroy\n\n respond_to do |format|\n format.html { redirect_to useful_links_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Review was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link = Link.find_by_slug(params[:id])\n @link.comments.each do |c|\n c.destroy\n end\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'BLAM! Link was thoroughly destroyed!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @file_link.destroy\n respond_to do |format|\n format.html { redirect_to file_links_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_news_link.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_news_links_url, notice: 'News link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n CONNECTION.execute(\"DELETE FROM links WHERE id = #{self.id};\")\n end",
"def destroy\n @linkctr.destroy\n respond_to do |format|\n format.html { redirect_to linkctrs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @resources_and_link = ResourcesAndLink.find(params[:id])\n @resources_and_link.destroy\n\n respond_to do |format|\n format.html { redirect_to resources_and_links_url }\n format.json { head :no_content }\n end\n end",
"def delete(href, additional_parameters = {})\n rest_connect do |base_uri, headers|\n href = \"#{base_uri}/#{href}\" unless begins_with_slash(href)\n new_path = URI.escape(href)\n req = Net::HTTP::Delete.new(href, headers)\n req.set_content_type('application/json')\n req.body = additional_parameters.to_json\n req\n end\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.xml { head :ok }\n format.js { head :ok }\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\n end",
"def destroy\n @link.destroy\n flash[:success] = \"Link gelöscht!\"\n respond_to do |format|\n format.html { redirect_to pot_path(@link.pot) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link_request.destroy\n respond_to do |format|\n format.html { redirect_to link_requests_url, notice: 'Link request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @linkpost.destroy\n respond_to do |format|\n format.html { redirect_to linkposts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @storylink = Storylink.find(params[:id])\n @storylink.destroy\n\n respond_to do |format|\n format.html { redirect_to storylinks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tasklink = Tasklink.find(params[:id])\n @tasklink.destroy\n\n respond_to do |format|\n format.html { redirect_to tasklinks_url }\n format.json { head :no_content }\n end\n end",
"def delete\n api_client.delete(url)\n end",
"def delete\n request(:delete)\n end",
"def destroy\n @blog_link.destroy\n respond_to do |format|\n format.html { redirect_to blog_links_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shortlink.destroy\n respond_to do |format|\n format.html { redirect_to shortlinks_url, notice: 'Shortlink was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete!\n Recliner.delete(uri)\n end",
"def destroy\n @affiliate_link = AffiliateLink.find(params[:id])\n @affiliate_link.destroy\n\n respond_to do |format|\n format.html { redirect_to affiliate_links_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @xlink = Xlink.find(params[:id])\n @xlink.destroy\n\n respond_to do |format|\n format.html { redirect_to xlinks_url }\n format.json { head :no_content }\n end\n end",
"def delete(url)\n do_request(\"delete\", url)\n end",
"def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end",
"def do_delete(uri = \"\")\n @connection.delete do |req|\n req.url uri\n req.headers['Content-Type'] = 'application/json'\n end\n end",
"def destroy\n @demo_link.destroy\n respond_to do |format|\n format.html { redirect_to demo_links_url, notice: 'Demo link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link_attachment.destroy\n respond_to do |format|\n format.html { redirect_to link_attachments_url }\n format.json { head :no_content }\n end\n end",
"def delete(url, headers={})\n RestClient.delete url, headers\n end",
"def delete\n start { |connection| connection.request http :Delete }\n end",
"def delete(url)\n call(url: url, action: :delete)\n end",
"def link_delete\n @linkalation = Linkalation.find_by_link_id_and_user_id(params[:link], current_user.id)\n\n @linkalation[0].destroy\n\n render :nothing => true\n end",
"def destroy\n @check_link.destroy\n respond_to do |format|\n format.html { redirect_to check_links_url, notice: 'Check link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def delete(options={})\n connection.delete(\"/\", @name)\n end",
"def destroy\n @static_link = StaticLink.find(params[:id])\n @static_link.destroy\n\n respond_to do |format|\n format.html { redirect_to(static_links_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def destroy\n @url = ShortenedUrl.find(params[:id])\n @url.destroy\n\n respond_to do |format|\n format.html { redirect_to shortened_url_index_url }\n format.json { head :no_content }\n end\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def destroy\n if @short_url.destroy\n render json: { status: \"Deleted\" }\n else\n render json: { head: \"no content\" }\n end \n end",
"def destroy\n @publink = Publink.find(params[:id])\n @publink.destroy\n\n respond_to do |format|\n format.html { redirect_to publinks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @url = Url.find(params[:id])\n @url.destroy\n\n respond_to do |format|\n format.html { redirect_to urls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @externalformlink.destroy\n respond_to do |format|\n format.html { redirect_to externalformlinks_url }\n format.json { head :no_content }\n end\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def destroy\n @message_link = MessageLink.find(params[:id])\n @message_link.destroy\n\n respond_to do |format|\n format.html { redirect_to message_links_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @url.destroy\n respond_to do |format|\n format.html { redirect_to urls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @url.destroy\n respond_to do |format|\n format.html { redirect_to urls_url }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def destroy\n @urlshortner.destroy\n respond_to do |format|\n format.html { redirect_to urlshortners_url }\n format.json { head :no_content }\n end\n end",
"def delete endpoint\n do_request :delete, endpoint\n end",
"def destroy\n unless is_owner? @link\n render :file => \"public/401.html\", :status => :unauthorized\n return\n end\n \n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n request(:delete, path)\n end",
"def destroy\n @link = @panel.links.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to(@panel) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @task_link.destroy\n respond_to do |format|\n format.html { redirect_to task_links_url, notice: 'Task link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bundlelink.destroy\n respond_to do |format|\n format.html { redirect_to bundlelinks_url, notice: 'Bundlelink was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.75310004",
"0.74690264",
"0.73705393",
"0.73705393",
"0.73637277",
"0.7292658",
"0.7263792",
"0.7260787",
"0.72489226",
"0.72376317",
"0.72376317",
"0.72376317",
"0.72376317",
"0.72376317",
"0.72376317",
"0.72376317",
"0.72376317",
"0.723125",
"0.72103757",
"0.72103304",
"0.7180949",
"0.7112963",
"0.71000606",
"0.7092443",
"0.7090295",
"0.7090295",
"0.7090295",
"0.7090295",
"0.7090295",
"0.7090295",
"0.70630145",
"0.7049379",
"0.7039482",
"0.701906",
"0.6997958",
"0.69880915",
"0.6979797",
"0.6966121",
"0.6955287",
"0.6936534",
"0.6911227",
"0.69068116",
"0.6901572",
"0.68707734",
"0.6865718",
"0.68600863",
"0.68437374",
"0.68148464",
"0.68098915",
"0.68054575",
"0.6791931",
"0.678693",
"0.6785256",
"0.67544127",
"0.67527187",
"0.6739079",
"0.67362416",
"0.673514",
"0.6724956",
"0.67183644",
"0.67130226",
"0.67128134",
"0.67076576",
"0.668645",
"0.66695124",
"0.66680413",
"0.66647124",
"0.66629034",
"0.66623986",
"0.6661316",
"0.6648605",
"0.6630459",
"0.6626261",
"0.6625483",
"0.6620084",
"0.6620084",
"0.6617302",
"0.66153616",
"0.6606678",
"0.6606581",
"0.6602999",
"0.6600191",
"0.6597662",
"0.65959316",
"0.65959316",
"0.65959316",
"0.65959316",
"0.6593915",
"0.65890306",
"0.65890306",
"0.6583165",
"0.65763664",
"0.6568149",
"0.6541464",
"0.65401596",
"0.6536008",
"0.6534352",
"0.6532865"
] |
0.74529105
|
2
|
GET /categories GET /categories.json
|
def index
parametersarray = Array.new
params[:pubIds].nil? ? parametersarray : params[:pubIds].each {|p| parametersarray << p}
parametersarray.empty? ? @categories = Category.all : @categories= self.getPublicationCategories(parametersarray)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\trender json: @categories\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend",
"def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"def GetCategories params = {}\n\n params = params.merge(path: 'categories.json')\n APICall(params)\n\n end",
"def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend",
"def categories\n get('venues/categories').categories\n end",
"def index\n categories = Category.all\n render json:categories\n end",
"def get_categories()\n\t\tzomoato_categories_url = @base_uri + \"categories\"\n\t\tresponse = HTTParty.get(zomoato_categories_url, headers: @headers)\n\t\tif response.success?\n\t\t\t@categories = response.parsed_response\n\t\telse\n\t\t\traise response.response\n\t\tend\n\t\treturn @categories\n\tend",
"def getCategoryAll()\n params = Hash.new\n return doCurl(\"get\",\"/category/all\",params)\n end",
"def get_categories_list\n args = receive_should_validate?\n get('redtube.Categories.getCategoriesList', {}, [], args[:should_validate])\n end",
"def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def GetCategory id\n\n APICall(path: \"categories/#{id}.json\")\n\n end",
"def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def index\n\t @categories = Category.all\n\n\t respond_to do |format|\n\t\tformat.html # index.html.erb\n\t\tformat.json { render json: @categories }\n\t end\n\tend",
"def index\n\n\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def get_categories\n @categories = Category.all\n end",
"def index\n @categories = Category.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def categories options = {}\n perform_get_with_object(\"/categories\", options, Vimeo::Entities::Category)\n end",
"def index\n @categories = Category.all\n @categories= @categories.sort_by(&:name)\n render json: @categories\n end",
"def categories(query_object)\n\t\tdata = do_get_json(CATEGORIES_ENDPOINT, query_object)\n\tend",
"def categories\n parsed_json['data']\n end",
"def index\n @categories = Category.all\n @categories.each do |category|\n authorize! :read, category\n end\n render json: @categories\n end",
"def categories(params={})\n return @categories if (@categories && !params[:force])\n @categories = get_categories\n end",
"def index\n categories = @vertical.catgories.order('created_at DESC');\n render json: {status: 'SUCCESS', message:'Loaded categories', data:categories},status: :ok\n end",
"def index\n respond_to do |format|\n format.html { @categories = Category.all }\n format.json { @categories = Category.order(:name) }\n end\n end",
"def get_categories(query_obj=nil)\n uri = URI.parse(@uri + \"/Categories\")\n results = get(uri,query_obj)\n end",
"def getCategories(_, _, _)\n @db.categories\n end",
"def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"def all(params = {})\n handle_all_request(\"/categories\", :categories, params)\n end",
"def get_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CategoriesApi.get_categories ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_search'] = opts[:'filter_search'] if !opts[:'filter_search'].nil?\n query_params[:'filter_active'] = opts[:'filter_active'] if !opts[:'filter_active'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceCategoryResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#get_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_categories(add_params = nil)\n params = {\n }\n api_call('/global/categories(.:format)',:get,params,add_params)\n end",
"def categories(args={})\n res = api_request('private.request.getCategories', 'GET')\n res = JSON.parse(res)['category'] rescue []\n\n unless args[:include_deleted] and args[:include_deleted] == true\n res.reject!{|k, v| v['fDeleted'] == '1'} rescue []\n end\n \n return res\n end",
"def show\n render json: category\n end",
"def index\n @incidentcategories = Incidentcategory.all\n json_response(@incidentcategories)\n end",
"def get_category\n json_response({ message: 'NOT IMPLEMENTED' })\n end",
"def index\n respond_with Category.all\n end",
"def index\n @categories = Category.all\n render :json => @categories, :except => [:created_at, :updated_at]\n end",
"def index\n @categories = CategoryService.index\n end",
"def show\n render json: @category\n end",
"def get_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CategoriesApi.get_categories ...'\n end\n # resource path\n local_var_path = '/categories'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Category>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#get_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def categories(make, year)\n make_id = get_object_id make\n response = get_url \"Categories/#{make_id}/#{year}\"\n response_obj = JSON.parse response\n response_obj[\"GetCategoriesResult\"].map{|r| Models::Category.from_response_hash(r)}\n end",
"def getCategories\n @categories = []\n @categories << Category.new(name: \"All\", id: -1)\n @categories += Category.all\n end",
"def get_categories\n body = build_request(2935, 1501, \"ACTIVEHEADINGS\")\n response = send_to_localeze(body)\n xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text)\n end",
"def categories\n add_to_query restrict_kind: 'category'\n end",
"def categories\n @categories = response[\"categories\"] || []\n @categories.map!{|category| Foursquared::Response::Category.new(client, category)}\n end",
"def categories\n response[\"categories\"].map!{|category| Foursquared::Response::Category.new(client, category)} if response[\"categories\"]\n end",
"def index\n @categories = Category.all\n respond_with(@categories)\n end",
"def get_category_list\n ret_hash = Rails.cache.fetch(\"zaim_api/category\", expired_in: 1.day) do\n json_categories = self.zaim_api.category\n tmp_ret_hash = {}\n json_categories['categories'].each do |value|\n tmp_ret_hash[value['id']] = value['name']\n end\n tmp_ret_hash\n end\n ret_hash\n end",
"def index\n @categories = Category.roots\n end",
"def get_categories(opts = {})\n data, _status_code, _headers = get_categories_with_http_info(opts)\n data\n end",
"def index\n @categories = Category.all\n end",
"def index\n\t\t@categories = Category.all\n\tend",
"def index\n @categories=Category.root\n respond_with @categories\n end",
"def getcategories\n category_size = RequirementCategory.all.length\n current_offset = (params[:payload][:pagenumber] - 1)*10\n direction = params[:payload][:direction]\n\n respond_to do |format|\n format.json {\n\n \tif current_offset + direction < category_size && current_offset + direction >= 0\n offset = current_offset + direction\n \t@categories = RequirementCategory.all.offset(offset).take(10) \n \trender :json => @categories\n else\n \trender :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n\n\tend",
"def category\n client.categories.find(data[\"categoryId\"])\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def get_categories(opts = {})\n data, _status_code, _headers = get_categories_with_http_info(opts)\n return data\n end",
"def categories\n category\n end",
"def categories\n []\n end",
"def index\n\t@categories = Category.all\n\tend",
"def category\n # Whats the last category we are asking for? (the rest don't matter I don't think..)\n requested_category = params[:category].split(\"/\").last\n category = Taxonomy.find_by_seo_url requested_category\n\n if category.present?\n @category = category\n @posts = get_posts category.posts\n\n\n respond_to do |format|\n format.html { render :template => 'default/index' }\n format.json { render json: @posts }\n end\n else\n # No such category found, redirect to root index\n redirect_to root_path\n end\n end",
"def index\n render json: Category.order('name ASC').all\n end",
"def index\n @section_categories = SectionCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @section_categories }\n end\n end",
"def show\n render json: @categoria\n end",
"def index\n categories = Category.all\n\n if params[:limit]\n categories = categories.limit(params[:limit])\n end\n\n render json: CategorySerializer.new(categories).serializable_hash\n end",
"def get_categories\n cats = []\n params.each do |k,v|\n if k.starts_with? \"category\"\n name = v\n num = cat_number(k) \n cats << [name,num]\n end\n end\n return cats\n end",
"def index\n @categories = Category.all\n end",
"def get_categories(project_id_or_key)\n get(\"projects/#{project_id_or_key}/categories\")\n end",
"def categories(options = {})\n fetch_categories.at('categories').children_of_type('category').inject([]){ |r, i| r << parse_single_category_xml(i) }\n\tend",
"def index\n @categories = Category.paginate(:page => params[:page])\n @title = \"Категории\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def categories\n\t\t\t@cat_cache ||= @db.js('musicthoughts.all_categories()').map {|c| c.merge(category: c[@lang]) }\n\t\t\t@cat_cache\n\t\tend",
"def categories\n raw_categories.to_hashugar\n end",
"def event_categories(options = {})\n response = connection.get do |req|\n req.url \"events/categories\", options\n end\n return_error_or_body(response, response.body.response.categories)\n end",
"def index\n @service_categories = ServiceCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @service_categories }\n end\n end",
"def categories_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OtherApi.categories_list ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Category>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OtherApi#categories_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def categories\n # @categories = Category.get_categories(@user.id)\n #@categories =Category.all.select(:id).select(:name).select(:description).select(:logo_url)\n @categories =Category.all\n user_cat= @user.categories.collect(&:id)\n categories = []\n @categories.each do |cat|\n cat_attr = cat.attributes\n user_cat.include?(cat.id) ? cat_attr.merge!('user_category' => true) : cat_attr.merge!('user_category' => false)\n categories << cat_attr\n end\n @categories = categories\n\n respond_to do |format|\n if @categories.blank?\n format.json {render json:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.xml {render xml:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.html {render json: {:success => false, :status_code => 404, :message => \"No category found\"}}\n else\n format.html {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.json {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.xml {render xml: {:success => true, :status_code => 200, :categories => @categories}}\n end\n end\n end",
"def all\n render json: Cat.all\n end",
"def index\n @categories = Category.all\n \n respond_with do |format|\n format.html { render :index, :layout => false}\n end\n end"
] |
[
"0.83888507",
"0.8327856",
"0.83211476",
"0.78072983",
"0.7742051",
"0.75669324",
"0.75111455",
"0.74151826",
"0.7386452",
"0.7369945",
"0.7369187",
"0.73691803",
"0.73691803",
"0.73457074",
"0.73304063",
"0.7316772",
"0.72851175",
"0.72663945",
"0.72275496",
"0.7220998",
"0.721489",
"0.7214744",
"0.7191486",
"0.7170767",
"0.71196395",
"0.7099406",
"0.70744735",
"0.7046364",
"0.70421106",
"0.7034058",
"0.7032228",
"0.7031601",
"0.70285517",
"0.701469",
"0.6996653",
"0.69954544",
"0.6993141",
"0.6981535",
"0.6970529",
"0.6965789",
"0.69562495",
"0.68973124",
"0.6896462",
"0.6888122",
"0.6884991",
"0.68843496",
"0.68729085",
"0.68694204",
"0.684738",
"0.68159676",
"0.6808432",
"0.68015593",
"0.6799326",
"0.6773361",
"0.6770789",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67645466",
"0.67614204",
"0.67590016",
"0.67560863",
"0.6751845",
"0.6734348",
"0.6726548",
"0.67246544",
"0.6723478",
"0.67053044",
"0.67034256",
"0.66973054",
"0.6697162",
"0.6685197",
"0.66803694",
"0.66784716",
"0.66742986",
"0.6672338",
"0.6635933",
"0.6635794",
"0.6623354",
"0.6619753",
"0.6616208"
] |
0.0
|
-1
|
GET /categories/1 GET /categories/1.json
|
def show; end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def GetCategories params = {}\n\n params = params.merge(path: 'categories.json')\n APICall(params)\n\n end",
"def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"def GetCategory id\n\n APICall(path: \"categories/#{id}.json\")\n\n end",
"def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\trender json: @categories\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend",
"def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend",
"def index\n categories = Category.all\n render json:categories\n end",
"def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def index\n\n\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def index\n @categories = Category.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def show\n render json: category\n end",
"def show\n render json: @category\n end",
"def index\n\t @categories = Category.all\n\n\t respond_to do |format|\n\t\tformat.html # index.html.erb\n\t\tformat.json { render json: @categories }\n\t end\n\tend",
"def getCategoryAll()\n params = Hash.new\n return doCurl(\"get\",\"/category/all\",params)\n end",
"def get_category id\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.get CATEGORIES, id )\n\t\t\t\tend",
"def index\n categories = @vertical.catgories.order('created_at DESC');\n render json: {status: 'SUCCESS', message:'Loaded categories', data:categories},status: :ok\n end",
"def getCategories(_, _, _)\n @db.categories\n end",
"def category\n client.categories.find(data[\"categoryId\"])\n end",
"def categories\n get('venues/categories').categories\n end",
"def get_category\n json_response({ message: 'NOT IMPLEMENTED' })\n end",
"def get_categories\n @categories = Category.all\n end",
"def index\n respond_to do |format|\n format.html { @categories = Category.all }\n format.json { @categories = Category.order(:name) }\n end\n end",
"def getCategory( category_id)\n params = Hash.new\n params['category_id'] = category_id\n return doCurl(\"get\",\"/category\",params)\n end",
"def index\n @categories = Category.all\n @categories= @categories.sort_by(&:name)\n render json: @categories\n end",
"def category\n # Whats the last category we are asking for? (the rest don't matter I don't think..)\n requested_category = params[:category].split(\"/\").last\n category = Taxonomy.find_by_seo_url requested_category\n\n if category.present?\n @category = category\n @posts = get_posts category.posts\n\n\n respond_to do |format|\n format.html { render :template => 'default/index' }\n format.json { render json: @posts }\n end\n else\n # No such category found, redirect to root index\n redirect_to root_path\n end\n end",
"def index\n @categories = CategoryService.index\n end",
"def index\n @categories = Category.all\n @categories.each do |category|\n authorize! :read, category\n end\n render json: @categories\n end",
"def category(id = nil)\n res = Connection.get('categories', id)\n id.nil? ? Category.all(res) : Category.new(res)\n end",
"def index\n @incidentcategories = Incidentcategory.all\n json_response(@incidentcategories)\n end",
"def index\n @categories = Category.all\n render :json => @categories, :except => [:created_at, :updated_at]\n end",
"def get_categories()\n\t\tzomoato_categories_url = @base_uri + \"categories\"\n\t\tresponse = HTTParty.get(zomoato_categories_url, headers: @headers)\n\t\tif response.success?\n\t\t\t@categories = response.parsed_response\n\t\telse\n\t\t\traise response.response\n\t\tend\n\t\treturn @categories\n\tend",
"def index\n respond_with Category.all\n end",
"def show\n render json: @categoria\n end",
"def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end",
"def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end",
"def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end",
"def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end",
"def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end",
"def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end",
"def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end",
"def index\n @categories = Category.roots\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"def index\n\t\t@categories = Category.all\n\tend",
"def index\n\t@categories = Category.all\n\tend",
"def index\n @categories = Category.all\n end",
"def index\n @categories = Category.all\n end",
"def index\n render json: Category.order('name ASC').all\n end",
"def categories(params={})\n return @categories if (@categories && !params[:force])\n @categories = get_categories\n end",
"def index\n @categories = Category.all\n respond_with(@categories)\n end",
"def get_categories(add_params = nil)\n params = {\n }\n api_call('/global/categories(.:format)',:get,params,add_params)\n end",
"def category\n Category.find(params[:id])\n end",
"def index\n @categories=Category.root\n respond_with @categories\n end",
"def show\n @category = current_mall.categories.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end",
"def index\n @categories = Category.paginate(:page => params[:page])\n @title = \"Категории\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def get_categories_list\n args = receive_should_validate?\n get('redtube.Categories.getCategoriesList', {}, [], args[:should_validate])\n end",
"def index\n categories = Category.all\n\n if params[:limit]\n categories = categories.limit(params[:limit])\n end\n\n render json: CategorySerializer.new(categories).serializable_hash\n end",
"def show\n\t @category = Category.find(params[:id])\n\n\t respond_to do |format|\n\t\tformat.html # show.html.erb\n\t\tformat.json { render json: @category }\n\t end\n\tend",
"def categories(query_object)\n\t\tdata = do_get_json(CATEGORIES_ENDPOINT, query_object)\n\tend",
"def categories\n parsed_json['data']\n end",
"def index\n #expires_in 24.hours\n #fresh_when last_modified: @max, public: true\n @roots = @categories.roots\n @keyword = String.new\n\n @roots.each do |r|\n @keyword << r.name << \" \"\n end\n\n if params[:id]\n if c = Category.find(params[:id])\n redirect_to c\n return\n else\n flash.now[:error] = \"Category not found.\"\n end\n end\n\n respond_to do |format|\n format.html\n format.json {render json:@categories}\n end\n\n end",
"def index\n @categories = Category.order(\"name ASC\")\n @latest_reviews = Review.limit(3).order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end",
"def get_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CategoriesApi.get_categories ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_search'] = opts[:'filter_search'] if !opts[:'filter_search'].nil?\n query_params[:'filter_active'] = opts[:'filter_active'] if !opts[:'filter_active'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceCategoryResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#get_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_category_list\n ret_hash = Rails.cache.fetch(\"zaim_api/category\", expired_in: 1.day) do\n json_categories = self.zaim_api.category\n tmp_ret_hash = {}\n json_categories['categories'].each do |value|\n tmp_ret_hash[value['id']] = value['name']\n end\n tmp_ret_hash\n end\n ret_hash\n end",
"def categories options = {}\n perform_get_with_object(\"/categories\", options, Vimeo::Entities::Category)\n end",
"def getCategories\n @categories = []\n @categories << Category.new(name: \"All\", id: -1)\n @categories += Category.all\n end",
"def show\n @post_category = Post::Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post_category }\n end\n end",
"def index\n @categories = Category.paginate(:page => params[:page], per_page:30)\n @number = Category.count\n\n respond_to do |format|\n format.html\n format.json { render json: Category.all }\n end\n end",
"def index\n @categorias = Categoria.where(ativo: true)\n \t\n render json: @categorias\n end",
"def index\n @categories = Category.all\n \n respond_with do |format|\n format.html { render :index, :layout => false}\n end\n end",
"def index\n @cover_cats = CoverCat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cover_cats }\n end\n end",
"def index\n @section_categories = SectionCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @section_categories }\n end\n end",
"def show\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cat }\n end\n end",
"def show\n @recipe_category = RecipeCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_category }\n end\n end",
"def index\n @categories = collections_config.values\n end",
"def index\n @taxonomy_categories = TaxonomyCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @taxonomy_categories }\n end\n end",
"def fetch_categories(count = ENV['DEFAULT_CATEGORY_COUNT'].to_i)\n max_category = 18418\n uri = \"http://jservice.io/api/categories?count=#{count}&offset=#{1+rand(max_category/count.to_f)}\"\n request = HTTParty.get(uri)\n data = JSON.parse(request.body)\nend"
] |
[
"0.7877691",
"0.7865133",
"0.78486437",
"0.78422695",
"0.7414923",
"0.74083245",
"0.73075056",
"0.7306919",
"0.7306919",
"0.7282217",
"0.7235693",
"0.7186931",
"0.7158298",
"0.7133119",
"0.7122198",
"0.70659566",
"0.70442134",
"0.7036961",
"0.70349413",
"0.70324004",
"0.7012643",
"0.7009862",
"0.6999405",
"0.6993045",
"0.6990838",
"0.69787407",
"0.6956943",
"0.69493926",
"0.693385",
"0.68740106",
"0.6857372",
"0.6855677",
"0.6852057",
"0.68460214",
"0.6835847",
"0.6835847",
"0.6835847",
"0.6835847",
"0.6835847",
"0.6835847",
"0.6835847",
"0.68196505",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.68190384",
"0.6811142",
"0.6795076",
"0.6769383",
"0.6751968",
"0.6730927",
"0.67296433",
"0.6723893",
"0.6720277",
"0.6718597",
"0.6718178",
"0.67129713",
"0.6708545",
"0.6707729",
"0.67047274",
"0.6698742",
"0.6698137",
"0.66946316",
"0.66537845",
"0.66530246",
"0.6641249",
"0.66375494",
"0.6636564",
"0.66132104",
"0.66113704",
"0.6608408",
"0.6590371",
"0.6587897",
"0.65741247",
"0.65741235",
"0.65732604",
"0.6570182",
"0.6569654",
"0.6567145",
"0.6562422",
"0.6556036"
] |
0.0
|
-1
|
POST /categories POST /categories.json
|
def create
@category = Category.new(category_params)
respond_to do |format|
if @category.save
format.html { redirect_to '/publications/new', notice: 'Category was successfully created.' }
format.json { render :show, status: :created, location: @category }
else
format.html { render :new }
format.json { render json: @category.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def CreateCategory params = {}\n \n APICall(path: 'categories.json',method: 'POST',payload: params.to_json)\n \n end",
"def create\n json_create(category_params, Category)\n end",
"def create_category payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post CATEGORIES, payload )\n\t\t\t\tend",
"def create\n category = @current_user.categories.create!(category_params)\n render json: { category: category }\n end",
"def create\n if @category.save\n render json: @category, status: :created, location: @category\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"def create\n @category = Category.new(category_params)\n @category.save\n render json: { params: params, notice: 'Categoria registrada exitosamente' }\n end",
"def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"def create\n @categoria = Categoria.new(categoria_params)\n if @categoria.save\n render json: @categoria\n else\n render json: @categoria.errors, status: :unprocessable_entity\n end\n end",
"def create\n @category = current_user.categories.new(name: params[:name])\n if @category.save\n render \"create.json.jbuilder\", status: :created\n else\n render json: { errors: @category.errors.full_messages }, status: :unprocessable_entity\n end\n end",
"def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\trender json: @categories\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend",
"def create\n @category = Category.new(category_params)\n authorize! :create, @category\n if @category.save\n render json: @category, status: :created\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"def create\n @category = current_mall.categories.new(params[:category])\n\n if @category.save\n render json: @category, status: :created\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"def post_category(category_name, options={ })\n self.post('/categories.json',\n options.merge(\n :body => { :category => {\n :name => category_name\n } }.to_json\n )\n )['category']\n end",
"def create\n category = Category.create(category_params)\n\n \n if category\n render json:{\n status: :created,\n category: category}\n else\n render json: { status: 500 }\n end\n end",
"def user_category\n # byebug\n @user = User.where(contact: params[:contact]).first\n params[:category_ids].each do |category|\n @user.user_categories.create!(category_id: category, user_id: @user.id)\n end\n render json: {status: \"SUCCESS\", message: \"user-data\", data: \"category saved\"}, status: :ok\n end",
"def addCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.new(name: params[:name])\n status = c.save\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: status, reason: error, data: \"\"}\n end",
"def create\n @category = Category.create(params[:category])\n respond_with(@category, location: categories_url)\n end",
"def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend",
"def create\n category = Category.create!(category_params)\n render json: {\n :html => render_to_string(\n :partial => \"setups/category\",\n :layout => false,\n :locals => {:category => category})\n }\n end",
"def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html {\n redirect_to @category, notice: 'Category was successfully created.'\n }\n format.json {\n render json: @category, status: :created, location: @category\n }\n else\n format.html { render action: \"new\" }\n format.json {\n render json: @category.errors, status: :unprocessable_entity\n }\n end\n end\n end",
"def create\n @category = Category.new(params[:category]) \n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: t(:created_category_success)}\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to management_categories_path }\n format.json { render json: @category, status: :created }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categories_post = CategoriesPost.new(categories_post_params)\n\n respond_to do |format|\n if @categories_post.save\n format.html { redirect_to @categories_post, notice: 'Categories post was successfully created.' }\n format.json { render :show, status: :created, location: @categories_post }\n else\n format.html { render :new }\n format.json { render json: @categories_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n category = params[:category]\n category_name = category['name']\n \n write_log(\"category.to_s: #{category.to_s}\",\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n \n cats = []\n if category_name != nil\n cats = category_name.split(\" \")\n end\n \n write_log(\"cats.size: #{cats.size}\",\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n\n if cats.size > 1\n \n flag = true\n counter = 0\n \n cats.each do |cat|\n # @category = Category.new(params[:category])\n # @category = Category.new(name=cat)\n @category = Category.new({\"name\"=> cat, \"genre_id\"=> category['genre_id']})\n \n if @category.save\n else\n counter += 1\n end\n end#cats.each do |cat|\n \n respond_to do |format|\n format.html { redirect_to @category, \n notice: \"New categories: Created => #{cats.size - counter}, Failed => #{counter}\" }\n format.json { render json: @category, status: :created, location: @category }\n end\n \n else#if cats.size > 1\n @category = Category.new(params[:category])\n \n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end#if cats.size > 1\n \n \n # @category = Category.new(params[:category])\n# \n # respond_to do |format|\n # if @category.save\n # format.html { redirect_to @category, notice: 'Category was successfully created.' }\n # format.json { render json: @category, status: :created, location: @category }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @category.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def create\n @category = @collection.categories.new(category_params)\n\n if @category.save\n ActionCable.server.broadcast 'categories',\n title: @category.title,\n collection_id: @category.collection_id\n head :ok\n else\n\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Category was successfully created.' }\n format.json { render action: 'show', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to admin_dashboard_categories_path, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(params[:category])\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created!!' }\n format.json { render json: @category, status: :created, location: @category }\n\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categ = Categ.new(categ_params)\n\n respond_to do |format|\n if @categ.save\n format.html { redirect_to @categ, notice: 'Categ was successfully created.' }\n format.json { render :show, status: :created, location: @categ }\n else\n format.html { render :new }\n format.json { render json: @categ.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post_category = Post::Category.new(params[:post_category])\n\n respond_to do |format|\n if @post_category.save\n format.html { redirect_to @post_category, notice: 'Category was successfully created.' }\n format.json { render json: @post_category, status: :created, location: @post_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categoria = Categoria.new(params[:categoria])\n\n respond_to do |format|\n if @categoria.save\n format.html { redirect_to action: 'index', notice: 'Categoria was successfully created.' }\n format.json { render json: @categoria, status: :created, location: @categoria }\n else\n format.html { render action: \"new\" }\n format.json { render json: @categoria.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to Category.find(@category.category_id), notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = CategoryService.create\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Категория добавлена.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render action: 'show', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n # @category = Category.new(params[:category])\n @category = current_user.categories.build(params[:category])\n\n respond_to do |format|\n if @category.save\n # format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.html { redirect_to categories_path, notice: 'Pomyślnie utworzono kategorię.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n # format.html { render action: \"new\" }\n format.html { redirect_to categories_path, :flash => { :error => 'Nie udało się utworzyć kategorii' } }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_category\n @category = TestCategory.new(params[:category])\n @category.save\n @categories = TestCategory.find(:all)\n redraw 'categories'\n end",
"def index\n categories = Category.all\n render json:categories\n end",
"def GetCategories params = {}\n\n params = params.merge(path: 'categories.json')\n APICall(params)\n\n end",
"def create\n @categories = Category.all\n\n @category = Category.create(category_params)\n flash[:notice]=\"Catégorie créer avec succès!!!\"\n end",
"def create\n @categories = Category.where(validity: true)\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: t(:category_created) }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categor = Categor.new(categor_params)\n\n respond_to do |format|\n if @categor.save\n format.html { redirect_to @categor, notice: 'Categor was successfully created.' }\n format.json { render :show, status: :created, location: @categor }\n else\n format.html { render :new }\n format.json { render json: @categor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @incidentcategory = Incidentcategory.new(incidentcategory_params)\n\n if @incidentcategory.save\n json_response(@incidentcategory)\n else\n render json: @incidentcategory.errors, status: :unprocessable_entity\n end\n end",
"def create\r\n @category = Category.new(categories_params)\r\n\r\n respond_to do |format|\r\n if @category.save\r\n format.html { redirect_to articles_path, notice: 'Profile was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'new' }\r\n format.json { render json: @category.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n\t\t@cat = Cat.new(cat_params)\n\n\t\tif @cat.save\n\t\t\t# cat_url(@cat) == /cat/{@cat.id}\n\t\t\tredirect_to cat_url(@cat)\n\t\telse\n\t\t\trender :new\n\t\t\t# render json: @cat.errors.full_messages, status: :unprocessable_entity\n\t\tend \n\tend",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @categorization = Categorization.new(params[:categorization])\n @categories = category_list\n respond_to do |format|\n if @categorization.save\n format.html { redirect_to(admin_categorization_path(@categorization), :notice => 'Categorization was successfully created.') }\n format.xml { render :xml => @categorization, :status => :created, :location => @categorization }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @categorization.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Категория была успешно создана'}\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to root_path, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n flash.alert = @category.errors.full_messages\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.create(params[:category])\n \n if @category.save\n redirect_to categories_path\n else\n render 'new'\n end\n \n end",
"def create\n @category = PostCategory.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to cm_post_categories_url, notice: 'PostCategory was successfully created.' }\n format.json { render action: 'show', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n categories = @vertical.catgories.order('created_at DESC');\n render json: {status: 'SUCCESS', message:'Loaded categories', data:categories},status: :ok\n end",
"def create\n admins_only do\n @category = Category.new(category_params)\n @category.name = params[:category][:name].to_s.camelcase\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to category_index_path, notice: 'Category was successfully created.' }\n format.json { render action: 'index', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def create\n if params[:categoria_producto]\n p = Producto.find(params[:producto_id])\n c = Categoria.find(params[:categoria_id])\n\n if p.categorias << c\n render json: c, status: :created\n else\n render json: {:errors => {categoria: [\"No se ha podido agregar categoria\"]}}, status: :unprocessable_entity\n end\n\n else\n @categoria = Categoria.new(parametros_categoria)\n\n if @categoria.save\n render json: @categoria, status: :created\n else\n render json: @categoria.errors, status: :unprocessable_entity\n end\n end\n end",
"def modify_category(categories)\n begin\n puts Rainbow(\"Current categories: #{categories.join(', ')}\").whitesmoke\n yield\n\n write_json(categories, \"Categories/cat\", \"Available categories are: #{categories.join(', ')}\")\n rescue StandardError\n puts \"There are no categories to delete\"\n end\nend",
"def create\n @cat = Cat.new(params[:cat])\n\n respond_to do |format|\n if @cat.save\n format.html { redirect_to @cat, notice: 'Cat was successfully created.' }\n format.json { render json: @cat, status: :created, location: @cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to adminpanel_categories_path, notice: \"Категория #{@category.name} успешно создана\" }\n format.json { render :show, status: :created, location: adminpanel_categories_path }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to edit_dashboard_category_path(@category), notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to admin_category_path(@category), notice: 'Category was successfully created.' }\n format.json { render action: 'show', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create \n\n user = User.find(@user_id)\n post = user.posts.build(params_post)\n \n category = Category.find_by_id(params[:category])\n return render json: { error: \"Category not found\"}, status: 404 if category.nil?\n \n post.category = category\n \n \n if post.save\n render json: post, status: :created\n else \n render json: post.errors, status: :unprocessable_entity\n end\n end",
"def create\n @category = Category.new(category_params)\n @category.user_id = current_user.id\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: t('create.notice', name: t('activerecord.models.category')) }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = current_user\n @category = Category.new(params[:category])\n @user.categories << @category\n #TODO: error handling\n #TODO: AJAX this\n if @user.save\n redirect_to user_path(@user)\n else\n render \"new\"\n end\n end",
"def create\n @post_category = current_user.post_categories.build(params[:post_category])\n\n respond_to do |format|\n if @post_category.save\n format.html { redirect_to [:client,:post_categories], notice: 'Post category was successfully created.' }\n format.json { render json: @post_category, status: :created, location: @post_category }\n else\n format.html { render action: \"index\" }\n format.json { render json: @post_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @recipe_category = RecipeCategory.new(params[:recipe_category])\n\n respond_to do |format|\n if @recipe_category.save\n format.html { redirect_to @recipe_category, notice: 'Recipe category was successfully created.' }\n format.json { render json: @recipe_category, status: :created, location: @recipe_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @recipe_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_url, notice: 'Category was successfully created.' }\n end\n end\n end",
"def create\n @category_form_url = forum_categories_path\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render action: 'show', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n @categorias_tipo = CatTipo.new(params[:cat_tipo])\n\n\t\trespond_to do |format|\n\t\t\tif @categorias_tipo.save\n \t\t\tcategories = @categorias_tipo.update_attributes(:tipo_acc_ids =>params[:tipo_accs])\n\t\t\t\t@categorias_tipo.update_attributes(:estado_ids =>params[:estados])\n\t\t\t\t\n\t\t\t\n\n format.html { redirect_to cat_tipos_path, notice: 'OK' }\n format.json { render json: @categorias_tipo, status: :created, location: @categorias_tipo }\n\t\t\telse\n format.html { render action: \"new\" }\n format.json { render json: @categorias_tipo.errors, status: :unprocessable_entity }\n \tend\t\n\t\tend\n\tend",
"def create\n @category = Category.new(params[:category])\n @category.category_group_id ||= params[:category_group_id]\n\n respond_to do |format|\n if @category.save\n save_curated_items(@category)\n format.html { redirect_to(categories_path, notice: 'Category was successfully created.') }\n format.json { render json: @category, status: :created, location: @category }\n else\n set_flash_messages_from_errors(@category)\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @taxonomy_category = TaxonomyCategory.new(params[:taxonomy_category])\n\n respond_to do |format|\n if @taxonomy_category.save\n format.html { redirect_to @taxonomy_category, notice: 'Taxonomy category was successfully created.' }\n format.json { render json: @taxonomy_category, status: :created, location: @taxonomy_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @taxonomy_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(params[:category])\n\n if @category.save\n flash[:notice] = 'Categoria criada com sucesso.'\n else\n flash[:notice] = 'Erro ao salvar a categoria.'\n end\n\n # respond_to do |format|\n # if @category.save\n # format.html { redirect_to categories_path}\n # format.json { render json: @category, status: :created, location: @category }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @category.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def create\n @category = Category.new(category_params)\n\n\n begin\n Category.transaction do # un ActiveRecord\n #@full_category.each do |f|\n #Category.create(f)\n #f.save!\n #end\n @category.save!\n end\n #Código de éxito\n rescue => e\n raise ActiveRecord::Rollback #Lanzamos el rollback de nuevo a saco\n #Seguimos con las acciones que queramos, como notificar, etc.\n end\n\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to api_v1_category_path(@category), notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n category = Documents::Category.create(category_params)\n if category.save\n redirect_to categories_path\n else\n redirect_to categories_path, alert: I18n.t('admin.categories.validation_error')\n end\n end",
"def categories\n # @categories = Category.get_categories(@user.id)\n #@categories =Category.all.select(:id).select(:name).select(:description).select(:logo_url)\n @categories =Category.all\n user_cat= @user.categories.collect(&:id)\n categories = []\n @categories.each do |cat|\n cat_attr = cat.attributes\n user_cat.include?(cat.id) ? cat_attr.merge!('user_category' => true) : cat_attr.merge!('user_category' => false)\n categories << cat_attr\n end\n @categories = categories\n\n respond_to do |format|\n if @categories.blank?\n format.json {render json:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.xml {render xml:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.html {render json: {:success => false, :status_code => 404, :message => \"No category found\"}}\n else\n format.html {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.json {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.xml {render xml: {:success => true, :status_code => 200, :categories => @categories}}\n end\n end\n end",
"def create_category_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CategoriesApi.create_category ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'category'])\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CategoryResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#create_category\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @category = Category.new(params[:category])\n @title = \"Neue Kategorie erstellen\"\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = CategoryService.create(category_params)\n\n respond_to do |format|\n unless @category.errors.any?\n format.html { redirect_to backoffice_categories_path,\n notice: notification_alert('success', 'Created!', \"Category [#{@category.description}] was successfully created.\") \n }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mk_categoria = MkCategoria.new(mk_categoria_params)\n\n respond_to do |format|\n if @mk_categoria.save\n format.html { redirect_to @mk_categoria, notice: 'Mk categoria was successfully created.' }\n format.json { render :show, status: :created, location: @mk_categoria }\n else\n format.html { render :new }\n format.json { render json: @mk_categoria.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to [:admin, @category], notice: t('messages.created', model:Category.model_name.human) }\n format.json { render action: 'show', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_category = Admin::Category.new(admin_category_params)\n\n respond_to do |format|\n if @admin_category.save\n format.html { redirect_to admin_categories_url }\n format.json { render :show, status: :created, location: @admin_category }\n else\n format.html { render :new }\n format.json { render json: @admin_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def categories=(value)\n @categories = value\n end",
"def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end"
] |
[
"0.7738549",
"0.74339235",
"0.72349083",
"0.71634054",
"0.7124031",
"0.70645165",
"0.705568",
"0.695861",
"0.6956783",
"0.6903891",
"0.6838659",
"0.6821712",
"0.68190134",
"0.6807838",
"0.678525",
"0.66138625",
"0.6566919",
"0.65661913",
"0.65567696",
"0.6523676",
"0.65186286",
"0.65124106",
"0.6507293",
"0.64973867",
"0.64973867",
"0.64973867",
"0.64973867",
"0.64973867",
"0.6491015",
"0.64895564",
"0.6476546",
"0.64730144",
"0.6470093",
"0.6455681",
"0.6438828",
"0.6436862",
"0.64220095",
"0.6418686",
"0.6418686",
"0.6418686",
"0.6418686",
"0.6418686",
"0.6418686",
"0.6418686",
"0.6418686",
"0.6418686",
"0.6418686",
"0.6418686",
"0.63991785",
"0.63877624",
"0.6384297",
"0.6379078",
"0.63786995",
"0.6376995",
"0.63656723",
"0.63593614",
"0.6358317",
"0.6356693",
"0.6355196",
"0.6354375",
"0.6352758",
"0.6345056",
"0.63400453",
"0.63052505",
"0.63035464",
"0.62976784",
"0.6287918",
"0.6284682",
"0.6269106",
"0.62629235",
"0.626244",
"0.6258697",
"0.6254516",
"0.62478405",
"0.62459856",
"0.62374765",
"0.62301993",
"0.62244",
"0.6220316",
"0.6219008",
"0.6210804",
"0.6199586",
"0.61989397",
"0.6196965",
"0.6195727",
"0.61901325",
"0.6185757",
"0.61840874",
"0.6181882",
"0.61759615",
"0.61596483",
"0.6154083",
"0.6150745",
"0.6144707",
"0.6140831",
"0.6128935",
"0.6128884",
"0.61209923",
"0.6117174",
"0.6109629",
"0.610358"
] |
0.0
|
-1
|
PATCH/PUT /categories/1 PATCH/PUT /categories/1.json
|
def update
respond_to do |format|
if @category.update(category_params)
format.html { redirect_to @category, notice: 'Category was successfully updated.' }
format.json { render :show, status: :ok, location: @category }
else
format.html { render :edit }
format.json { render json: @category.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def UpdateCategory params = {}\n \n APICall(path: 'categories.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n json_update(category,category_params, Category)\n end",
"def update_categories(categories, options = {} )\n options.merge!(:docid => self.docid, :categories => categories)\n resp = @conn.put do |req|\n req.url \"categories\"\n req.body = options.to_json\n end\n\n resp.status \n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @category.update(category_params)\n render json: @category, status: :ok\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"def update\n @headline = t(:update_category)\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: t(:updated_category_success) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @category.update(params[:category])\n head :no_content\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.json { render :show, status: :ok, location: @category }\n else\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to api_v1_category_path(@category), notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n update! {admin_categories_path}\n end",
"def update\n unless @category.name == \"ROOT\"\n if @category.update(category_params)\n render 'show', :status => 200, :layout => false, notice: 'Category was successfully created.'\n else\n render :json => {:message => \"Error in updating category\"}, notice: @category.errors, :layout => false, :status => 400\n end\n else\n render :json => {:message => \"Root can't be edited.\"}, :layout => false, :status => 400\n end\n end",
"def update\n if @categoria.update(categoria_params)\n render json: @categoria\n else\n render json: @categoria.errors, status: :unprocessable_entity \n end\n end",
"def update\n @category = Category.find(params[:id])\n @category.update_attributes(params[:category])\n respond_with(@category, location: categories_url)\n end",
"def update\n @recipe = Recipe.find(params[:id])\n\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n @categories=RecipeCategory.all\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category.update_attributes(params[:category])\n respond_with(@category)\n end",
"def editCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.find(params[:id])\n status = c.update(name: params[:name])\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: status, reason: error, data: \"\"}\n end",
"def update!(**args)\n @categories = args[:categories] if args.key?(:categories)\n end",
"def update!(**args)\n @categories = args[:categories] if args.key?(:categories)\n end",
"def update\n #locates the category to be updated\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: t(:category_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: t('update.notice', name: t('activerecord.models.category')) }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to :back, notice: 'category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html {\n redirect_to @category, notice: 'Category was successfully updated.'\n }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json {\n render json: @category.errors, status: :unprocessable_entity\n }\n end\n end\n end",
"def update\n # recipe_params[:ingredient_lists_attributes].each do |list|\n # list.each do |item|\n # item[:ingredient_attributes] = Ingredient.where(name: item[:ingredient_attributes].name).first_or_create\n # end\n # end\n \n # category_ids = params[:recipe][:categories_attributes].map { |k,v| v[:id] }\n # #pry.debugger\n \n # recipe_params.merge({ category_ids: category_ids })\n \n\n respond_to do |format|\n \n if @recipe.update(recipe_params)\n format.html { redirect_to recipes_url, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = current_mall.categories.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def user_category_edit\n @user = User.where(contact: params[:contact]).first\n @user.categories.destroy_all\n params[:category_ids].each do |category|\n @user.user_categories.create!(category_id: category, user_id: @user.id)\n end\n render json: {status: \"SUCCESS\", message: \"user-categories\", data: \"categories updated\"}, status: :ok\n end",
"def update\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n if @cat.update_attributes(params[:cat])\n format.html { redirect_to @cat, notice: 'Cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n if @cat.update_attributes(params[:cat])\n _update_topics \n format.html { redirect_to action: \"edit\", notice: 'Cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to categories_path, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post_category = Post::Category.find(params[:id])\n\n respond_to do |format|\n if @post_category.update_attributes(params[:post_category])\n format.html { redirect_to @post_category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n category= Category.find(params[:id])\n category.update(category_params)\n \n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to management_categories_path }\n format.json { render json: @category, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update category_params\n format.html { redirect_to admin_categories_url, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to cm_post_categories_url, notice: 'PostCategory was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update_attributes(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @recipe_category = RecipeCategory.find(params[:id])\n\n respond_to do |format|\n if @recipe_category.update_attributes(params[:recipe_category])\n format.html { redirect_to @recipe_category, notice: 'Recipe category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Sucesso - update'\n else\n flash[:notice] = 'Falha ao atualizar a categoria'\n end\n\n # respond_to do |format|\n # if @category.update_attributes(params[:category])\n # format.html { redirect_to categories_path}\n # format.json { head :no_content }\n # else\n # format.html { render action: \"edit\" }\n # format.json { render json: @category.errors, status: :unprocessable_entity }\n \n # end\n # end\n end",
"def update\n authorize! :update, @category\n \n @category.modifier = current_user\n \n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to categories_url + '#' + @category.slug, notice: t('.success') }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to categories_path, notice: \"Category was successfully updated.\" }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category.update(category_params)\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Категория изменена.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to admin_dashboard_categories_path, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def putCategory( category_id, language, name)\n params = Hash.new\n params['category_id'] = category_id\n params['language'] = language\n params['name'] = name\n return doCurl(\"put\",\"/category\",params)\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to [:admin, @category], notice: t('messages.updated', model:Category.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to backend_shop_branch_category_path(@current_shop.slug, @current_branch, @category), notice: t('Category was successfully updated.') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to category_index_path, notice: 'Categorie was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @incidentcategory.update(incidentcategory_params)\n json_response(@incidentcategory)\n else\n render json: @incidentcategory.errors, status: :unprocessable_entity\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n # format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.html { redirect_to categories_path, notice: 'Pomyślnie zaktualizowano kategorię.' }\n format.json { head :no_content }\n else\n # format.html { render action: \"edit\" }\n format.html { redirect_to units_path, :flash => { :error => 'Nie udało się zaktualizować kategorii' } }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @catalog_category.update(catalog_category_params)\n format.html { redirect_to catalog_categories_url }\n format.json { render :show, status: :ok, location: @catalog_category }\n else\n format.html { render :edit }\n format.json { render json: @catalog_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @categ.update(categ_params)\n format.html { redirect_to @categ, notice: 'Categ was successfully updated.' }\n format.json { render :show, status: :ok, location: @categ }\n else\n format.html { render :edit }\n format.json { render json: @categ.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n return unless admin?\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post_category = current_user.post_categories.find(params[:id])\n\n respond_to do |format|\n if @post_category.update_attributes(params[:post_category])\n format.html { redirect_to [:client,@post_category], notice: 'Post category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # update attribute\n if @category.update_attributes(category_params)\n # flash message\n flash.now[:success] = \"更新完了しました。\"\n # get category data\n all_categories\n else\n render 'edit'\n end\n end",
"def update\n params[:book][:category_ids] = nil if params[:book][:category_ids].nil?\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to books_url, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n @categories = Category.all.order('name asc')\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n @title = 'Kategorie ' + @category.title + ' bearbeiten'\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to categories_path, notice: 'Category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n\n intent_request = @api_ai_client.create_intents_request\n response = intent_request.update(@category.intent_id, param_options)\n\n if response.is_a?(Hash) && response[:status][:code].eql?(200)\n\n contexts_templates = { contexts: category_params[:contexts].split(\",\"), templates: category_params[:templates].split(\",\") }\n\n if @category.update(category_params.merge(contexts_templates))\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n else\n @notice = response.message\n\n format.html { render :new }\n format.json { render json: { error: response.message }, status: response.code}\n end\n end\n end",
"def update\n @categorization = Categorization.find(params[:id])\n @categories = category_list\n respond_to do |format|\n if @categorization.update_attributes(params[:categorization])\n format.html { redirect_to(admin_categorization_path(@categorization), :notice => 'Categorization was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @categorization.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to :back, notice: 'Kategori diperbarui.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n #My product belongs_to category relationship won't work so I made this so when I update it reflects changes\n category_name = set_category.name\n Product.all.each do |product|\n product.category = category_params[:name] if product.category == category_name\n product.save\n end\n \n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n category = Documents::Category.find(params[:id])\n category.update!(category_params)\n redirect_to categories_path\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to backoffice_categories_path,\n notice: notification_alert('success', 'Updated!', \"Category [#{@category.description}] was successfully updated.\") \n }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_group_category.update(api_v1_group_category_params)\n format.html { redirect_to @api_v1_group_category, notice: 'Group category was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_group_category }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_group_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to edit_dashboard_category_path(@category), notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to adminpanel_categories_path, notice: \"Категория #{@category.name} успешно обновлена\" }\n format.json { render :show, status: :ok, location: adminpanel_categories_path }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @categories = Category.all.map{|c| [ c.name, c.id ] }\n respond_to do |format|\n if @listing.update(listing_params)\n format.html { redirect_to @listing, notice: 'Listing was successfully updated.' }\n format.json { render :show, status: :ok, location: @listing }\n else\n format.html { render :edit }\n format.json { render json: @listing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Категория была успешно изменена' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to categories_url, notice: 'Category was successfully updated.' }\n end\n end\n end",
"def update\n @kategory = Kategory.find(params[:id])\n\n respond_to do |format|\n if @kategory.update_attributes(params[:kategory])\n format.html { redirect_to @kategory, notice: 'Kategory was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @schema_category.update(schema_category_params)\n format.html { redirect_to schema_categories_path, notice: 'Schema category was successfully updated.' }\n format.json { render :show, status: :ok, location: @schema_category }\n else\n format.html { render :edit }\n format.json { render json: @schema_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category , notice: 'Información actualizada correctamente.' }\n format.json { head :no_content }\n else\n format.html { render 'edit' }\n format.json { render json: @category.errors , status: :unprocessable_entity }\n end\n end\n end",
"def update\n if current_category.category==\"noone\"\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n else\n render :file => \"/public/404.html\",:status => \"404\"\n end\n \n end",
"def update_categories(cats=[])\n rescue_extra_data\n cats = cats.to_i\n old_categories = categories.pluck(\"#{CamaleonCms::TermTaxonomy.table_name}.id\")\n delete_categories = old_categories - cats\n news_categories = cats - old_categories\n term_relationships.where(\"term_taxonomy_id in (?)\", delete_categories ).destroy_all if delete_categories.present?\n news_categories.each do |key|\n term_relationships.create(:term_taxonomy_id => key)\n end\n update_counters(\"categories\")\n end",
"def update\n respond_to do |format|\n if @category.update(category_params)\n flash[:success] = 'Category was successfully updated.'\n format.html { redirect_to admin_category_url(@category) }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def modify_category(categories)\n begin\n puts Rainbow(\"Current categories: #{categories.join(', ')}\").whitesmoke\n yield\n\n write_json(categories, \"Categories/cat\", \"Available categories are: #{categories.join(', ')}\")\n rescue StandardError\n puts \"There are no categories to delete\"\n end\nend"
] |
[
"0.7692541",
"0.76002717",
"0.72122926",
"0.69430083",
"0.69147646",
"0.68174535",
"0.6781423",
"0.6712822",
"0.66981524",
"0.66931385",
"0.66563374",
"0.66518235",
"0.6651313",
"0.66455007",
"0.6606881",
"0.65994096",
"0.6570957",
"0.6570957",
"0.6554447",
"0.65348464",
"0.6499948",
"0.64760303",
"0.6465012",
"0.6463636",
"0.6447567",
"0.6447567",
"0.6447567",
"0.6447567",
"0.6447567",
"0.6447567",
"0.6447567",
"0.6446885",
"0.6445108",
"0.64354676",
"0.6425877",
"0.6404802",
"0.6398117",
"0.6397342",
"0.63867646",
"0.63712156",
"0.63689286",
"0.63614106",
"0.63614106",
"0.63602877",
"0.635827",
"0.63504726",
"0.635001",
"0.63498646",
"0.63454443",
"0.6333137",
"0.6325338",
"0.6323661",
"0.63140064",
"0.6313047",
"0.6304492",
"0.625837",
"0.6256286",
"0.6252758",
"0.6248299",
"0.62477565",
"0.6242413",
"0.62419957",
"0.6231747",
"0.6229775",
"0.6213711",
"0.6213574",
"0.6213316",
"0.6211167",
"0.62064534",
"0.6203476",
"0.62033504",
"0.62024665",
"0.6198553",
"0.6189735",
"0.6188076",
"0.61843246",
"0.61827266",
"0.6171157",
"0.6169644",
"0.61685896",
"0.6166008",
"0.6152873",
"0.61479074",
"0.6136016",
"0.61348724",
"0.6131454"
] |
0.6298676
|
68
|
DELETE /categories/1 DELETE /categories/1.json
|
def destroy
@category.destroy
respond_to do |format|
format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def DeleteCategory id\n \n APICall(path: \"categories/#{id}.json\",method: 'DELETE')\n \n end",
"def destroy\n @category.destroy\n render json: @category, status: :ok\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to api_v1_categories_path }\n format.json { head :no_content }\n end\n end",
"def deleteCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.find(params[:id])\n status = c.destroy\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: true, reason: error, data: \"\"}\n end",
"def destroy\n @category.destroy\n render json: { notice: 'Categoria eliminada exitosamente' }\n end",
"def destroy\n category = set_category\n if category.destroy\n head :no_content\n else\n render json: { status: 500 }\n end\n \n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = @collection.category.find(params[:id])\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @alien_category.destroy\n respond_to do |format|\n format.html { redirect_to alien_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cat = Cat.find(params[:id])\n @cat.destroy\n\n respond_to do |format|\n format.html { redirect_to cats_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cat = Cat.find(params[:id])\n @cat.destroy\n\n respond_to do |format|\n format.html { redirect_to cats_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: t('destroy.notice', name: t('activerecord.models.category')) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to admin_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to cm_post_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categoria = Categoria.find(params[:id])\n @categoria.destroy\n\n respond_to do |format|\n format.html { redirect_to categoria_index_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = current_mall.categories.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to api_wmall_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n head :no_content\n end",
"def destroy\n #@incidentcategory.destroy\n render json: {}, status: 200\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to admin_good_categories_url }\n format.json { head :no_content }\n end\n end",
"def delete_category id\n\t\t\t\t\tFreshdesk::Api::Client.delete_status_wrapper do\n\t\t\t\t\t\t( @connection.delete CATEGORIES, id ).code\n\t\t\t\t\tend\n\t\t\t\tend",
"def destroy\n IndicatorCategory.delete_hack(params[:id])\n\n respond_to do |format|\n format.html { redirect_to indicator_categories_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @post_category = Post::Category.find(params[:id])\n @post_category.destroy\n\n respond_to do |format|\n format.html { redirect_to post_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categ.destroy\n respond_to do |format|\n format.html { redirect_to categs_url, notice: 'Categ was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category_db.destroy\n respond_to do |format|\n format.html { redirect_to category_dbs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categoria.destroy\n respond_to do |format|\n format.html { redirect_to categorias_path, notice: @@titulo + t('msg.remove') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categorie = Categorie.find(params[:id])\n @categorie.destroy\n\n respond_to do |format|\n format.html { redirect_to(categories_url) }\n format.xml { head :ok }\n format.json {render :json => {\"success\"=>true,\"data\"=>[]}}\n end\n end",
"def destroy\n @category.delete\n end",
"def destroy\n @admin_category.destroy\n respond_to do |format|\n format.html { redirect_to admin_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @recipe_category = RecipeCategory.find(params[:id])\n @recipe_category.destroy\n\n respond_to do |format|\n format.html { redirect_to recipe_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @taxonomy_category = TaxonomyCategory.find(params[:id])\n @taxonomy_category.destroy\n\n respond_to do |format|\n format.html { redirect_to taxonomy_categories_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: \"Journal was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_scenic_spots_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @desserts_category.destroy\n respond_to do |format|\n format.html { redirect_to desserts_categories_url}\n format.json { head :no_content }\n end\n end",
"def destroy\n @level_category = LevelCategory.find(params[:id])\n @level_category.destroy\n\n respond_to do |format|\n format.html { redirect_to level_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cat.destroy\n respond_to do |format|\n format.html { redirect_to cats_url, notice: 'Cat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n begin\n @category.destroy\n rescue ActiveRecord::DeleteRestrictionError\n error = 'Эта категория не может быть удалена, пока с ней связан хоть один файл.'\n ensure\n respond_to do |format|\n format.html { redirect_to categories_url, notice: error }\n format.json { head :ok }\n end\n end\n end",
"def destroy\n @kategory = Kategory.find(params[:id])\n @kategory.destroy\n\n respond_to do |format|\n format.html { redirect_to kategories_url }\n format.json { head :ok }\n end\n end",
"def destroy\n return unless admin?\n\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_path, notice: \"Category was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categor.destroy\n respond_to do |format|\n format.html { redirect_to categors_url, notice: 'Categor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to \"index\", notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = current_user.user_categories.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categorias_tipo = CatTipo.find(params[:id])\n @categorias_tipo.destroy\n\n respond_to do |format|\n format.html { redirect_to cat_tipos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cathegory.destroy\n respond_to do |format|\n format.html { redirect_to cathegories_url, notice: 'Cathegory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #locates the category to be destroyed\n @category = Category.find(params[:id])\n #Creates an array of all categories\n @all_categories = Category.all\n #creates an empty hash\n @all_categories_hash = {}\n #calls function to populate & sort @all_categories_hash\n sort_categories()\n #calls function to destroy the category\n destroy_category(@category)\n\n respond_to do |format|\n format.html { redirect_to '/admin' }\n format.json { head :ok }\n end\n end",
"def destroy\n authorize! :destroy, @category\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: t('.success') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to backend_shop_branch_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cat = Cat.find(params[:id])\n @cat.destroy\n\n respond_to do |format|\n format.html { redirect_to(cats_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @mk_categoria.destroy\n respond_to do |format|\n format.html { redirect_to mk_categories_url, notice: 'Mk categoria was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category_type = CategoryType.find(params[:id])\n @category_type.destroy\n\n respond_to do |format|\n format.html { redirect_to category_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categorie_droit.destroy\n respond_to do |format|\n format.html { redirect_to categorie_droits_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.delete_context #there you go, this little fatty kills em all!\n #fred and post have equal methods, makes it slim and easy\n\n respond_to do |format|\n format.html { redirect_to categories_url, :method => :get, :notice => t(:deleted_category_success) }\n format.json { head :ok }\n end\n end",
"def destroy\n @activity_category.destroy\n respond_to do |format|\n format.html { redirect_to activity_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dish_category.destroy\n respond_to do |format|\n format.html { redirect_to dish_categories_url, notice: 'Категория блюда удалена.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n CategoryService.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n #######\n format.html { redirect_to category_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n \tauthorize! :destroy, @category\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @status_category.destroy\n respond_to do |format|\n format.html { redirect_to status_categories_url, notice: 'Status category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post_category = current_user.post_categories.find(params[:id])\n @post_category.destroy\n\n respond_to do |format|\n format.html { redirect_to [:client, :post_categories] }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course_category = CourseCategory.find(params[:id])\n @course_category.destroy\n\n respond_to do |format|\n format.html { redirect_to course_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: '分类删除成功~' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gt_category.destroy\n respond_to do |format|\n format.html { redirect_to gt_categories_url, notice: 'Gt category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cover_cat = CoverCat.find(params[:id])\n @cover_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to cover_cats_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to(categories_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n end",
"def destroy\n @category = DishCategory.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Категория удалена.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to(categories_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to(categories_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to(categories_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to management_categories_url, notice: 'Category was successfully removed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.78272814",
"0.77353686",
"0.76392984",
"0.7488916",
"0.74731207",
"0.74233276",
"0.7399541",
"0.7385346",
"0.7385346",
"0.7385346",
"0.7385346",
"0.7385346",
"0.7385346",
"0.7385346",
"0.7385346",
"0.7385346",
"0.7385346",
"0.7385346",
"0.7385346",
"0.7378597",
"0.7378597",
"0.7378597",
"0.7372517",
"0.7366761",
"0.7362291",
"0.7334964",
"0.7334964",
"0.7333799",
"0.73254865",
"0.7318471",
"0.7294363",
"0.728636",
"0.7283016",
"0.72823733",
"0.7245488",
"0.7242075",
"0.72370917",
"0.71940225",
"0.7186593",
"0.7184272",
"0.71675783",
"0.7166838",
"0.7147197",
"0.71468467",
"0.7146009",
"0.71421075",
"0.712865",
"0.71269435",
"0.7125966",
"0.7122311",
"0.71151847",
"0.7114038",
"0.711263",
"0.71069294",
"0.7101981",
"0.71015203",
"0.7098744",
"0.70979154",
"0.70844114",
"0.7077371",
"0.70768744",
"0.7076328",
"0.7075828",
"0.70738447",
"0.7071764",
"0.7064413",
"0.70556885",
"0.70518345",
"0.7051709",
"0.7048051",
"0.7047651",
"0.70454115",
"0.7042982",
"0.70411265",
"0.7030913",
"0.7013192",
"0.70061165",
"0.69993097",
"0.6998523",
"0.6996587",
"0.69943523",
"0.6993104",
"0.69879425",
"0.69879425",
"0.69879425",
"0.6978936",
"0.69772786"
] |
0.708277
|
70
|
Use callbacks to share common setup or constraints between actions.
|
def set_category
@category = Category.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_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"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.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def category_params
params.require(:category).permit(:name, :layer_id, :description, :infolink)
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 end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"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.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
Returns annual rate of return given an initial value, and final value and number of years (may be fractional) NB answer is expressed as percentage Reference Wikipedia: ERV == P (1 + T) ^ n where P == a hypothetical initial payment of $1,000 T == average annual total return n == number of years Solving for T gives T == ( (ERV / P) ^ (1 / n) ) 1
|
def annual_ror(initial_value, final_value, years)
if years <= 0
0
elsif initial_value == 0
# BigDecimal::INFINITY
Float::INFINITY
else
100.to_d * if final_value < 0 # fudge if final value is less than zero
(((initial_value.to_d - final_value.to_d) / initial_value.to_d) ** (1 / years.to_d)) * -1
else
((final_value.to_d / initial_value.to_d) ** (1 / years.to_d)) - 1
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def mortgage_calc principle, annual_interest, years\n n = years * 12\n r = (annual_interest / 100)/ 12 #since this is usually expressed as a percentage\n return (principle * r * (1 + r)**n / ((1 + r)**n - 1)).round(2)\nend",
"def total_amount_owed(principal, interest_rate_percentage, number_of_years)\n annual_percentage_rate = interest_rate_percentage / 100\n principal * (1 + annual_percentage_rate * number_of_years)\nend",
"def required_annual_savings\n needed_amount_less_savings / years_to_retirement\n end",
"def annualized_return(start_date, end_date)\n difference_in_days = (end_date - start_date).to_i\n average_daily_profit = profit(start_date, end_date) / difference_in_days.to_f\n average_daily_profit * 365.25\n end",
"def calculate_years(principal, interest, tax, desired)\n# principal amount\n year = 0\n while principal < desired\n year += 1\n income = principal * interest\n principal += income - income * tax\n end\n year\nend",
"def future_given_annuity(annuity, interest, term)\n (annuity * (((1 + interest.to_f) ** term) -1) / interest.to_f ).round(4)\n end",
"def annuity_given_future(future_value, interest, term)\n (future_value.to_f * (interest.to_f / ((1 + interest) ** term)-1)).round(4)\n end",
"def calculate_years(principal, interest, tax, desired)\n total = principal\n years = 0\n loop do\n break if total >= desired\n total_interest = total*interest\n total += total_interest\n total -= total_interest*tax\n years += 1\n end\n years\nend",
"def annual_salary\n hourly_rate * 1950\n end",
"def calculate_years(principal, interest, tax, desired)\n i = 0\n return i if principal == desired\n \n while principal < desired\n principal += (principal * interest) - (principal * interest * tax)\n i += 1\n end\n \n i\nend",
"def pmt(interest_rate,payments,principal)\n numerator =interest_rate*principal*(1 + interest_rate)**payments\n denominator= (1+ interest_rate)**payments - 1\n return numerator/denominator.to_f\nend",
"def us_treas_10_year_rate\n # In real life call a web service to get it, but I will return a constant here\n 0.02124\n end",
"def nb_year(p0, percent, aug, p)\n years = 0\n while p >= p0 do\n p0 += (percent/100.0 * p0) + aug\n years += 1\n end\n p years\nend",
"def present_given_annuity(annuity, interest, term)\n (annuity.to_f * (((1 + interest.to_f) ** term) -1) / (interest.to_f * (1 + interest.to_f) ** term )).round(4)\n end",
"def annuity_given_present(present_value, interest, term)\n interest = interest.to_f\n (present_value.to_f * ((interest * (1+interest) ** term) / (((1 + interest) ** term) -1))).round(4)\n end",
"def get_monthly_rate(apr)\n (apr / 100) / 12\nend",
"def interest\n return (@capital / 100) * @rate\n end",
"def grow_one_year(starting_balance, growth_rate)\n starting_balance * (1.0 + growth_rate)\nend",
"def compound_return(periods,present_value,future_value)\n pv = present_value.to_d\n fv = future_value.to_d\n n = periods.to_d\n rate = ((fv / pv)**(1/n))-1\n end",
"def annual_cost\n (number_of_positions * hourly_rate * hours_per_week * number_of_weeks)\n end",
"def annual_cost\n (number_of_positions * hourly_rate * hours_per_week * number_of_weeks)\n end",
"def annualized_portfolio_amount_needed\n savings_portion_needed * 12.0\n end",
"def debt_rate\n ten_year_treasury + bps(200)\n end",
"def efective_given_nominal_anticipated(nominal_rate, term)\n (((1/((1-((nominal_rate.to_f/100)/term))**term))-1)*100).round(4)\n end",
"def nb_year(p0, percent, aug, p)\n count = 0\n while p0 < p\n p0 = p0 + (p0 * percent * 0.01).to_i + aug\n count += 1\n end\n \n return count\nend",
"def annualy_insurance\n return @capital * @insurance * -1\n end",
"def calculate_interest principle, days_since\n (principle * APR / 365 * days_since).round(2)\n end",
"def calculate_annual_cost_in_cents\n (number_of_positions * hourly_rate_cents * hours_per_week.to_f * number_of_weeks)\n end",
"def calculate_loan(rate, n_periods, total_loan_amount)\n fixed_payment = (rate /\n (1 - ((1 + rate)**(n_periods * - 1)))) * total_loan_amount\n\n fixed_payment.to_f\nend",
"def yearly_rate(*args)\n if paid?\n if yearly?\n rate(*args) / duration_parts[0] #number of years\n else\n rate(*args) / duration_in_months * 12\n end\n else\n nil\n end\n end",
"def annual_trade\n (1.25 * trade_node.trade_value * trade_power / trade_node.total_trade_power).round(6)\n end",
"def compound_interest\n\tp \"What is the principal amount?\"#\n\tprincipal = gets.chomp.to_i\n\tp \"What is the rate?\"\n\trate = gets.chomp.to_f\n\tp \"What is the number of years?\"\n\tterm = gets.chomp.to_i\n\tp \"What is the number of time the interest in compounded per year?\"\n\tcompounded = gets.chomp.to_i\n\t\n\tnew_rate = ((rate / compounded)/100) + 1\n\ttotal = principal\n\t(term * compounded).times do\n\t\ttotal = total * new_rate\n\tend\n\t\n\tp \"$#{principal} invested at #{rate}% for #{term} years compounded #{compounded} times per year is #{total.round(2)}\"\n\t\nend",
"def calculate_interest(principal, roi, time)\n rate = roi.to_f / 100\n amount = principal.to_f * (1 + rate * time.to_f)\n\n amount\nend",
"def effective_tax_rate income\r\n income = fix_income income\r\n\r\n return marginal_tax_rate income if income == 0 #avoid our later divide by zero\r\n\r\n (tax income) / income \r\n end",
"def rate\n Rate.new(self.interest/100, :apr, duration: self.tenure * 12)\n end",
"def value\n (\n 0.7 * (annual_income / average_income) +\n 0.3 * (base_manpower / avearge_manpower)\n ).round(6)\n end",
"def frm(r, n, po)\n\t## \n\t# interest rate is converted to fraction and made a monthly\n\tr = r.to_f/100/12\n\t##\n\t#number of years is converted to number of months\n\tn = n * 12\n\t##\n\t#monthly payment is calculated\n\tc = (r / (1 - (1+r) ** -n) ) * po\n\treturn c\nend",
"def nb_year(p0, percent, aug, p)\n year_count = 0\n until p0 >= p do\n p0 += (p0 * (percent/100.to_f)) + aug\n year_count += 1\n # binding.pry\n end\n year_count\n # binding.pry\nend",
"def calculate_apr\n payment_ratio = pmt / principal_calculation\n duration = @duration\n f = lambda {|k| (k**(duration + 1) - (k**duration * (payment_ratio + 1)) + payment_ratio)}\n f_deriv = lambda { |k| ((duration + 1) * k**duration) - (duration * (payment_ratio + 1) * k**(duration - 1))}\n\n root = newton_raphson(f, f_deriv, monthly_rate + 1)\n 100 * 12 * (root -1).to_f\n end",
"def total_retirement_saving(your_age)\n child_age = your_age / 2\n saving_per_year = child_age * child_age\n years_to_retire = 65 - child_age\n saving_per_year * years_to_retire\nend",
"def yearly_discount(int_disc)\n\t 12.0 * (1.0 - (int_disc ** (1.0/12.0)))\n end",
"def yearly_rate\n yearly? ? rate : rate * 12\n end",
"def calculate_apr\n payment_ratio = monthly_payment_with_fees / loan_amount\n f = lambda {|k| (k**(self.period + 1) - (k**self.period * (payment_ratio + 1)) + payment_ratio)}\n f_deriv = lambda { |k| ((self.period + 1) * k**self.period) - (self.period * (payment_ratio + 1) * k**(self.period - 1))}\n\n root = newton_raphson(f, f_deriv, monthly_interest_rate + 1)\n 100 * 12 * (root - 1).to_f\n end",
"def year_to_month_rate_convert(apr_in_decimals, loan_duration)\n ((1 + (apr_in_decimals / loan_duration))**loan_duration) - 1\nend",
"def calculate_yearly_rents_years\n convert_lease_transaction_date\n years = @lbtt_return.lease_end_date.year - @lbtt_return.lease_start_date.year\n years += 1 if @lbtt_return.lease_end_date >= @lbtt_return.lease_start_date.next_year(years)\n years\n end",
"def yearly_rate\n\t\t yearly? ? rate : rate * 12\n\t\t end",
"def annual_cost_or_base_pay\n case request_model_type\n when 'staff', 'contractor'\n (annual_base_pay_cents / 100.0)\n when 'labor'\n (calculate_annual_cost_in_cents / 100.0)\n else\n logger.error(\"Unknown request model type: #{request_model_type}\")\n 0.00\n end\n end",
"def calculateInterest\n\t\tinterest = 0\n\t\t@transactions.each do |trans|\n\t\t\tinterest += -1 * ((31 - trans[0]) * trans[-1] * @APR / 365)\n\t\tend\n\t\tinterest < 0 ? 0 : interest.round(2)\n\tend",
"def efective_given_nominal_due(nominal_rate, term)\n ((((1+((nominal_rate.to_f/100)/term))**term)-1).round(6))*100\n end",
"def anticipated_interest(rate, periods)\n\t\t (1 - (( 1 / ( rate.to_f + 1 )) ** (1.0 / periods)))\n\t\tend",
"def daily_interest\n @apr / 100.0 / 365\n end",
"def calc_pa_iers2003(t)\n return (0.024381750 + 0.00000538691 * t) * t\n rescue => e\n raise\n end",
"def pmt(rate,n,amount)\n\n\ttop = 0.0\n\ttop = rate*(1+rate)**n\n\tbot = 0.0\n\tbot = (1+rate)**n-1\n\tresult = 0.0\n\tresult =amount*top/bot\n\treturn result \n\nend",
"def return\n earning/(@amount*@term)\n end",
"def future_given_present(present_value, interest, term)\n (present_value.to_f * (1 + interest.to_f) ** term).round(4)\n end",
"def calculate_payment\n x = @periodic_rate * @principal * ((1 + @periodic_rate)**@periods)\n y = ((1 + @periodic_rate)**@periods) - 1\n (x / y).round(2)\n end",
"def adjusted_target_income\n (self.target_income * (years_to_retirement * self.avg_inflation_rate)) + self.target_income\n end",
"def present_given_future(future_value, interest, term)\n (future_value.to_f / (1 +interest.to_f) ** term).round(4)\n end",
"def adjusted_capital\n return 0.0 if @capital <= 0.0\n return 0.0 if @interest_rate <= 0.0 || @duration <= 0.0\n (@income/ @duration) * ADJ_FACTOR\nend",
"def pmt rate, nper, pv\n\n\tpay = 0.0\n\tnumerator = 0.0\n\tdenominator = 0.0\n\n\tnumerator = pv * rate * (1 + rate) ** nper\n\n\tdenominator = ((1 + rate) ** nper) - 1\n\n\tpay = numerator / denominator\n\n\treturn pay.round(2)\n\nend",
"def calculate_monthly_pay(loan_amount, interest_rate, loan_duration)\n loan_amount * (interest_rate * ( 1 + interest_rate) * loan_duration) /\n (interest_rate * ( 1 + interest_rate) * (loan_duration - 1))\nend",
"def withdrawal_rate\n (youngest_person_retirement_age - 15.0) / 1000.0\n end",
"def rate_average_price_earnings_ratio(per)\n sum = per.value_three_years_ago + per.value_two_years_ago + per.value_last_year + per.value_this_year + per.value_next_year\n avg = sum / 5\n case \n when avg < 12\n score = 1\n when avg > 16\n score = -1\n else\n score = 0\n end\n per.average = avg\n per.score = score\n return score\n end",
"def new_sale_price \n noi(num_years_to_hold + 1) / cap_rate(num_years_to_hold + 1)\n end",
"def effective_annual_rate(rate,compound_frequency)\n compound_frequency = resolve_compound_frequency!(compound_frequency)\n if compound_frequency == :continuous\n return continuous_effective_annual_rate(rate)\n end\n m= compound_frequency\n e_rate = (1 + rate/m)**m -1\n end",
"def anticipated_fixed_payment(present_value, rate, term)\n\t\t((present_value.to_f) / ((1 - (1 - rate.to_f ) ** term ) / rate.to_f )).round(4)\n end",
"def benchsubyearstotal\n @benchsubyearstotal = @subsequent_length_years * (@benchyear1totalcharges - (((@benchmobilisation + (@benchmobilisation * @framework_rates['M140']) + (@benchmobilisation * @framework_rates['M141'])) * (@framework_rates['M142'] + 1))))\n end",
"def calculate_monthly_mortgage(rate, principal, years)\n\tnew_rate = rate.to_f / 12\n\tnum_payments = 12 * years\n\tmonthly_payment = principal * ((new_rate * (1 + new_rate) ** num_payments)/((1 + new_rate) ** num_payments - 1))\n\treturn monthly_payment.round(2)\nend",
"def to_years; Rational === @val ? @val/12 : @val/12.0 end",
"def monthly_payment(salary_per_annum)\n return salary_per_annum / 12\nend",
"def subyearstotal\n @subyearstotal =\n if @supplier_name\n @subsequent_length_years *\n (@year1totalcharges -\n (((@mobilisation + (@mobilisation * @rate_card.data['Variances'][@supplier_name]['Management Overhead %']) +\n (@mobilisation * @rate_card.data['Variances'][@supplier_name]['Corporate Overhead %'])) *\n (@rate_card.data['Variances'][@supplier_name]['Profit %'] + 1))))\n else\n @subsequent_length_years * (@year1totalcharges - (((@mobilisation + (@mobilisation * @framework_rates['M140']) + (@mobilisation * @framework_rates['M141'])) * (@framework_rates['M142'] + 1))))\n end\n end",
"def interest_part(balance, interest_rate)\n balance*(interest_rate/100)\n end",
"def nper\n z = payment * (1.0 + monthly_rate * ptype) / monthly_rate\n\n Math.log(-future_value + z / (amount + z)) / Math.log(1.0 + monthly_rate)\n end",
"def final_rate_adjustment rate\n (rate/100.0).ceil - 0.01\n end",
"def interest(amount)\n if amount <= 1000\n 0.04 * amount\n elsif amount <= 5000\n 0.045 * amount\n else\n 0.05 * amount\n end\nend",
"def monthly_interest\n\t\tinterest_rate / (100 * 12)\n\tend",
"def calculate_payment_amount(params, insurance_cost, interest_rate)\n mortgage_principle = params['asking_price'] - params['down_payment'] + insurance_cost\n number_of_payments = SCHEDULE_MAP[params['payment_schedule']] * params['amortization_period']\n nominal_interest_rate = (interest_rate / SCHEDULE_MAP[params['payment_schedule']]) / 100\n\n numerator = (mortgage_principle * nominal_interest_rate * (1 + nominal_interest_rate)**number_of_payments)\n denominator = (1 + nominal_interest_rate)**number_of_payments - 1\n\n (numerator / denominator).round(2)\n end",
"def pmt (interest_rate, nper, pv)\n\t#monthly_payment = 1.00\n\tmonthly_payment = (pv*interest_rate*((1+interest_rate)**nper))/(((1+interest_rate)**nper)-1)\n\treturn monthly_payment\nend",
"def apr\n payment_ratio = self.monthly_payment_with_fees / self.loan_amount\n f = lambda { |k| (k**(self.period + 1) - (k**self.period * (payment_ratio + 1)) + payment_ratio) }\n f_deriv = lambda { |k| ((self.period + 1) * k**self.period) - (self.period * (payment_ratio + 1) * k**(self.period - 1)) }\n\n root = newton_raphson(f, f_deriv, self.monthly_interest_rate + 1)\n 100 * 12 * (root - 1).to_f\n end",
"def calc_pv()\n i = @i / 100.0\n #Initial contribution\n pvf = @fv / ((1 + i) ** @n)\n #Present value of annuity\n pva = (@pmt/i) * (1-(1/((1+i)**@n)))\n @pv = (pvf + pva) * (-1)\n #Round\n @pv = (@pv*100).round / 100.0\n end",
"def daily_rate\n\t\t yearly_rate / 365\n\t\t end",
"def daily_rate\n yearly_rate / 365\n end",
"def calculate_interest(amount, number_of_days)\n (amount * (0.03 / 365) * (number_of_days - 1)).round(10)\n end",
"def ir_sal \n\t\t@ir_sal = (@sal/6.to_f)*100\n\t\t@ir_sal.round(1)\n\tend",
"def pmt(rate, nper, pv)\n\n # =========================================================\n #the required output already accounts for monthly nature by dividing the 0.0404 by 12. it also already puts the percentage in decimal form so no need to adjust for rate on the back end\n part1 = (pv * rate)\n part2 = 1 - (1 + rate)**-nper\n\n monthly_payment = part1 / part2\n\n # Your code to implement the method goes here.\n # You shouldn't have to write or change code anywhere else.\n # =========================================================\nend",
"def call(year)\n previous_year = Population.previous_known(year)\n\n return previous_year.population if previous_year.year == year # year entered is known\n\n next_year = Population.next_known(year)\n\n # there is no next year - unable to calculate\n return nil if next_year.nil? \n\n # calculate the percentage that year is between next and previous years\n mod_percentage = (year - previous_year.year).to_f / (next_year.year - previous_year.year).to_f\n delta_population = next_year.population - previous_year.population\n\n (delta_population * mod_percentage).to_i + previous_year.population\n end",
"def avg_rate\n if @total > 0\n if @interval == 0.0 then 0.0 else 1.0 / @interval end\n end\n end",
"def pv_of_1_dollar_payments\n member = 1.0\n factor = 1.0/(1 + debt_rate/PAYMENTS_PER_YEAR)\n res = 0\n\n TOTAL_PAYMENTS.times do\n member *= factor\n res += member\n end\n\n res\n end",
"def average_rent\n @units.sum(&:monthly_rent) / 2.0\n end",
"def rate\n first_at, first_value = @samples.first\n last_at, last_value = @samples.last\n if first_at == last_at\n 0\n else\n (last_value - first_value) / (last_at - first_at)\n end\n end",
"def annualized_30_day_return_volatility(params = {})\n timeseries = params.is_a?(Timeseries) ? params : Timeseries.new(params)\n timeseries.tick = \"1 day\"\n timeseries.from = timeseries.from - 30.days < Timeseries::OLDEST ? Timeseries::OLDEST : timeseries.from - 30.days\n dataset = global_ppi(timeseries).order(:tick)\n .from_self\n .select(:tick, :global_ppi)\n .select_append{ count(global_ppi).over(frame: \"rows 29 preceding\").as(:preceding_rows) }\n .select_append{ ln(global_ppi / lag(global_ppi).over(order: :tick)).as(:daily_return) }\n .from_self\n .select(:tick, :global_ppi, :preceding_rows)\n .select_append{\n round(\n (stddev(daily_return).over(order: :tick, frame: \"rows 29 preceding\") * sqrt(365) * 100).cast(:numeric),\n 2\n ).as(:vol_30d)\n }\n .from_self\n .select(:tick, :global_ppi, :vol_30d)\n .where(preceding_rows: 30)\n .exclude(vol_30d: nil)\n end",
"def monthly_rate\n yearly? ? rate / 12 : rate\n end",
"def gain_interest\n # Assuming 2% interest rate would be entered as 2,\n # Divide rate by 100, to create 0.02 -- then\n # Add 1, to create 1.02 -- then\n # Multiply @balance by 1.02\n\n interest_div = @interest_rate / 100.0 # changes 2 to 0.02\n\n interest_add = interest_div + 1 # changes 0.02 to 1.02\n\n @balance = @balance * interest_add\n\n puts \"Your money accumulated interest. Now your balance is $#{ @balance }.\"\n end",
"def ask_for_annual_rate\n puts prompt(:annual_rate)\n loop do\n annual_rate = gets.chomp\n if valid?(annual_rate)\n return annual_rate.to_f\n else\n space_prompts\n puts prompt(:rate_error)\n end\n end\nend",
"def average_income; end",
"def present_value(rate,periods,future_value)\n present_value = future_value / (1+rate)**periods\n end",
"def interest(rate)\n raise ArgumentError.new \"The rate must be a positive number\" if rate < 0\n interest = @balance * rate/100\n @balance += interest\n return interest\n end",
"def monthly_rate\n\t\t yearly? ? rate / 12 : rate\n\t\t end",
"def rates_prediction\r\n final_array = []\r\n today = today_rate\r\n weekly_change = weekly_percentage_change_array\r\n\r\n first = ((weekly_change[0] / 100) * today) + today\r\n final_array << first\r\n\r\n if @time > 1\r\n i = 0\r\n while i < weekly_change[1].length\r\n rate = ((weekly_change[1][i] / 100) * final_array[i]) + final_array[i]\r\n final_array << rate\r\n i += 1\r\n end\r\n end\r\n final_array\r\n end",
"def calcula_preco(base)\n if @ano_lancamento <2006\n if @possui_reimpressao\n base * 0.9\n else\n base * 0.5\n end\n elsif @ano_lancamento <= 2010\n if @possui_reimpressao\n base * 0.96\n else\n base\n end\n end\n end"
] |
[
"0.71803",
"0.7060131",
"0.7031164",
"0.69293207",
"0.69113183",
"0.6909753",
"0.67350924",
"0.6611021",
"0.6590617",
"0.6555558",
"0.6550064",
"0.65337557",
"0.6530538",
"0.64723784",
"0.6447123",
"0.64417917",
"0.6412424",
"0.6351784",
"0.63419807",
"0.6322064",
"0.6322064",
"0.63168967",
"0.6293696",
"0.62444836",
"0.6244076",
"0.6234626",
"0.6200003",
"0.61900747",
"0.6152566",
"0.6138257",
"0.61208826",
"0.6080831",
"0.60636604",
"0.6053035",
"0.6033274",
"0.601963",
"0.6016781",
"0.60007846",
"0.6000495",
"0.59731776",
"0.5971049",
"0.5962704",
"0.59548795",
"0.5950657",
"0.5907832",
"0.590598",
"0.5901192",
"0.5871496",
"0.5862587",
"0.58598566",
"0.58559394",
"0.5850419",
"0.5849697",
"0.58335274",
"0.58334786",
"0.58265257",
"0.5817396",
"0.57966375",
"0.57944787",
"0.5792395",
"0.5788307",
"0.5778991",
"0.5772687",
"0.57639325",
"0.5743497",
"0.5732686",
"0.57240397",
"0.57229114",
"0.5711782",
"0.56990963",
"0.5685601",
"0.5682575",
"0.56661314",
"0.56650585",
"0.5653099",
"0.5651928",
"0.56448174",
"0.5643262",
"0.5642389",
"0.56378883",
"0.56353587",
"0.5634991",
"0.5622993",
"0.5610099",
"0.5609527",
"0.56003165",
"0.5589733",
"0.55788714",
"0.55686647",
"0.55677474",
"0.556715",
"0.5559896",
"0.5557766",
"0.555715",
"0.5554604",
"0.5554009",
"0.55486524",
"0.55261487",
"0.55207926",
"0.55111706"
] |
0.7825729
|
0
|
GET /consultants GET /consultants.json
|
def index
@query_params = {}
build_query_params(params)
build_query_consultant_params
@conditions = []
@conditions << Consultant.arel_table[:name].matches("%#{@query_params[:name]}%") if @query_params[:name]
if @conditions.length > 0
conditions = @conditions[0]
@conditions.each_with_index do |item, index|
conditions = conditions.or(item) if index > 0
end
@conditions = conditions
end
respond_to do |format|
format.html { set_consultants_grid(@conditions) }
format.json { render json: Consultant.where(@conditions) }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @consultant = Consultant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consultant }\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n\n render json: @consulta\n end",
"def show\n @consultum = Consultum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consultum }\n end\n end",
"def show\n @consultant_role = ConsultantRole.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consultant_role }\n end\n end",
"def index\n @consultors = Consultor.all\n end",
"def index\n @consultors = Consultor.all\n end",
"def index\n @personnels = Personnel.all\n @departments = Department.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html { render :index }\n\t\t\tformat.json { render json: Oj.dump(@personnels.select([:id, :first_name, :last_name, :email, :gender])) }\n\t\tend\n end",
"def get_consulta\n @consulta = Consulta.find(params[:consulta_id])\n end",
"def show\n @demanda = Demanda.find(params[:id])\n\n respond_to do |format|\n format.html { render \"demandas/show_consulta\" }\n format.json { render :json => @demandas }\n end\n end",
"def new\n @consultum = Consultum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @consultum }\n end\n end",
"def index\n @consulta = Consultum.all\n end",
"def show\n @consultation = Consultation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @consultation }\n end\n end",
"def show\n render json: @department, status: :found\n end",
"def index\n @todas_consultas = @paciente.consultas\n end",
"def search\n render json: Consultation.first(10)\n end",
"def index\n @departments = Department.all\n respond_to do |format|\n format.json{ render json: @departments}\n end\n end",
"def index\n @tenants = keystone.tenants\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @tenants }\n end\n end",
"def show\n @aspirant = Aspirant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @aspirant }\n end\n end",
"def index\n @expertises = Expertise.all\n\n render json: @expertises\n end",
"def index\n @applicants = Applicant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @applicants }\n end\n end",
"def show\n @analyst = Analyst.find(params[:id])\n\n render json: @analyst\n end",
"def show\n @dental = Dental.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dental }\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n end",
"def show\n @dept_supervisor = DeptSupervisor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dept_supervisor }\n end\n end",
"def index\n \n @plants = Plant.all\n @personal_plants = PersonalPlant.where(:user_id => session[:user][:id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plants }\n end\n end",
"def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"def show\n @visitante_credenciado = VisitanteCredenciado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @visitante_credenciado }\n end\n end",
"def index\n @plants = Plant.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @plants }\n end\n end",
"def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estudiante }\n end\n end",
"def show\n render json: @department\n end",
"def show\n @etudiant = Etudiant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etudiant }\n end\n end",
"def show\n render json: @expertise\n end",
"def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end",
"def index\n @tenants = Tenant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tenants }\n end\n end",
"def show\n @antecedente = Antecedente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @antecedente }\n end\n end",
"def show\r\n @design_dissertation = DesignDissertation.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @design_dissertation }\r\n end\r\n end",
"def index\n @admin_agencies = Admin::Agency.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_agencies }\n end\n end",
"def index\n @employers = Employer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employers }\n end\n end",
"def show\n @agente = Agente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @agente } \n end\n end",
"def show\n respond_to do |format|\n \tformat.html # show.html.erb\n \tformat.json { render json: @agency }\n end\n end",
"def show\n @contestant = Contestant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contestant }\n end\n end",
"def show\n @department = Department.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @department }\n end\n end",
"def show\n @talent = Talent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @talent }\n end\n end",
"def show\n @employee_department = EmployeeDepartment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee_department }\n end\n end",
"def show\n render json: @dept\n end",
"def show\n @employer = Employer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employer }\n end\n end",
"def index\n @users = @department.users\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @consulta }\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @consulta }\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @consulta }\n end\n end",
"def index\n @attendees = Attendee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @attendees }\n end\n end",
"def index\n @diaries = current_user.diaries.all\n respond_to do |format|\n format.html {render :index}\n format.json { render json: @diaries }\n end\n end",
"def index\n @occupants = Occupant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @occupants }\n end\n end",
"def show\n @admin_agency = Admin::Agency.where(:id => params[:id]).includes(:pages)[0]\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_agency }\n end\n end",
"def get_consultation_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SupportApi.get_consultation_all_using_get ...'\n end\n # resource path\n local_var_path = '/consultation'\n\n # query parameters\n query_params = {}\n query_params[:'ascending'] = opts[:'ascending'] if !opts[:'ascending'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageConsultation')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SupportApi#get_consultation_all_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n render json: @diet, status: 200, root: true\n end",
"def create\n @consultation = current_user.consultations.new(consultation_params)\n\n respond_to do |format|\n if @consultation.save\n format.html { redirect_to @consultation, notice: 'Consulta criada com sucesso.' }\n format.json { render :show, status: :created, location: @consultation }\n else\n format.html { render :new }\n format.json { render json: @consultation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @diabetes_consultation = DiabetesConsultation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @diabetes_consultation }\n end\n end",
"def show\n @palestrante = Palestrante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @palestrante }\n end\n end",
"def index\n @departamentos = Departamento.all\n\n render json: @departamentos\n end",
"def create\n @consulta = Consulta.new(params[:consulta])\n\n if @consulta.save\n render json: @consulta, status: :created, location: @consulta\n else\n render json: @consulta.errors, status: :unprocessable_entity\n end\n end",
"def show\n @expediente = Expediente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expediente }\n end\n end",
"def index\n @expedientes = Expediente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expedientes }\n end\n end",
"def department\n @departments = @company.departments\n respond_to do |format|\n format.json { render json: @departments}\n end\n end",
"def show\n @agents = Agent.employees.order('created_at ASC')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lead }\n end\n end",
"def index\n @consents = Consent.all\n render json: @consents\n end",
"def index\n@complain = find_complain\n @consults = @complain.consults\n end",
"def index\n @diciplinas = Diciplina.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @diciplinas }\n end\n end",
"def index\n puts session[:_csrf_token]\n @departments = Department.all\n render json: @departments, status: :ok\n end",
"def index\n @ef_mentals = EfMental.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ef_mentals }\n end\n end",
"def set_consultant\r\n @consultant = Consultant.find(params[:id])\r\n end",
"def show\n @designation = Designation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @designation }\n end\n end",
"def index\n @employes = Employe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employes }\n end\n end",
"def show\n # @retailer = Retailer.find(params[:id], :include => [:deals, :advertisements, :account] )\n respond_to do |format|\n format.html # show.html.erb\n format.json # show.json.rabl\n end\n end",
"def show\n @projeto = Projeto.find(params[:id])\n @enrollments = Enroll.find_all_by_projeto_id params[:id]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @projeto }\n end\n end",
"def index\n @designations = Designation.order(\"id desc\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @designations }\n end\n end",
"def index\n @attendees = Attendees.all\n render json: @attendees\n end",
"def index\n @careers = Career.all\n json_response(@careers)\n end",
"def index\n @servants = Servant.all\n end",
"def show\n @soldier = Soldier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @soldier }\n end\n end",
"def show\n @soldier = Soldier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @soldier }\n end\n end",
"def show\n @exprience = Exprience.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exprience }\n end\n end",
"def show\n @apprentice = Apprentice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apprentice }\n end\n end",
"def set_consultant\n @consultant = Consultant.find(params[:consultant_id])\n end",
"def index\n @tipo_consultas = TipoConsulta.all\n end",
"def show\n @dress = Dress.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dress }\n end\n end",
"def index\n @dairy_plans = DairyPlan.where(:student_id => @student.id)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dairy_plans }\n end\n end",
"def show\n render json: @person_expense_record\n end",
"def index\n @depts = Dept.roots.includes(:children)\n render json: @depts, each_serializer: V1::DeptSerializer, root: false\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @departments }\n format.json { render :text => get_json }\n end\n end",
"def show\n @employe = Employe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employe }\n end\n end",
"def show\n @electoral_district = ElectoralDistrict.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @electoral_district }\n end\n end",
"def index\n @administradors = Administrador.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @administradors }\n end\n end",
"def show\r\n @antenne = Antenne.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @antenne }\r\n end\r\n end",
"def show\n @assist = Assist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assist }\n end\n end",
"def index\n find_dependencias\n respond_to do |format|\n format.html\n format.json { render :json => @dependencias.to_json(:methods => :alias_or_fullname, :only => [:id, :codigo, :nombre])}\n\n end\n end",
"def show\n @exalt = Exalt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exalt }\n end\n end",
"def index\n respond_with (@depts = Dept.all)\n end",
"def show\n @employ = Employ.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employ }\n end\n end",
"def index\n @adversaires = Adversaire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @adversaires }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense }\n end\n end"
] |
[
"0.75846744",
"0.7204897",
"0.70457065",
"0.6866017",
"0.67175376",
"0.67175376",
"0.6444148",
"0.6442286",
"0.6309417",
"0.6304749",
"0.6271234",
"0.6249053",
"0.62414575",
"0.6240441",
"0.62339216",
"0.6203447",
"0.6193156",
"0.6191092",
"0.61681986",
"0.61602193",
"0.61529523",
"0.6146447",
"0.6123798",
"0.6106017",
"0.61044943",
"0.61027515",
"0.60919064",
"0.609056",
"0.6074965",
"0.6071613",
"0.60470843",
"0.60446",
"0.6022286",
"0.60104436",
"0.60013384",
"0.5991139",
"0.59902334",
"0.59840655",
"0.59838766",
"0.5983858",
"0.5974719",
"0.5967095",
"0.5952173",
"0.5945886",
"0.5942318",
"0.5941573",
"0.59381926",
"0.59306234",
"0.59306234",
"0.59306234",
"0.59279275",
"0.5925798",
"0.59245527",
"0.592442",
"0.59242225",
"0.5911946",
"0.5907351",
"0.5906134",
"0.5905454",
"0.5899174",
"0.5897923",
"0.5892133",
"0.5885514",
"0.5863731",
"0.5857631",
"0.58539665",
"0.5847581",
"0.5842203",
"0.5841254",
"0.5839692",
"0.58380896",
"0.5836672",
"0.5833483",
"0.5828945",
"0.5817229",
"0.58162254",
"0.58089364",
"0.57971007",
"0.57963896",
"0.579185",
"0.579185",
"0.57782596",
"0.57720065",
"0.5767484",
"0.5765947",
"0.5759887",
"0.57590926",
"0.57588357",
"0.57583785",
"0.5757988",
"0.5754667",
"0.5750596",
"0.574895",
"0.5744952",
"0.5744701",
"0.57431096",
"0.5740594",
"0.572927",
"0.5724014",
"0.5722268",
"0.5720386"
] |
0.0
|
-1
|
GET /consultants/1 GET /consultants/1.json
|
def show
@tabs = TABS
@current_tab = params[:tab]
@current_tab ||= TABS.first.to_s
@current_tab = @current_tab.to_sym
if @current_tab == :products
@products_grid = initialize_grid(Product.where(consultant_id: @consultant.id))
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @consultant = Consultant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consultant }\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n\n render json: @consulta\n end",
"def show\n @consultum = Consultum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consultum }\n end\n end",
"def show\n @consultant_role = ConsultantRole.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consultant_role }\n end\n end",
"def get_consulta\n @consulta = Consulta.find(params[:consulta_id])\n end",
"def index\n @consultors = Consultor.all\n end",
"def index\n @consultors = Consultor.all\n end",
"def show\n @demanda = Demanda.find(params[:id])\n\n respond_to do |format|\n format.html { render \"demandas/show_consulta\" }\n format.json { render :json => @demandas }\n end\n end",
"def new\n @consultum = Consultum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @consultum }\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n end",
"def show\n @consultation = Consultation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @consultation }\n end\n end",
"def search\n render json: Consultation.first(10)\n end",
"def show\n @dept_supervisor = DeptSupervisor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dept_supervisor }\n end\n end",
"def show\n @analyst = Analyst.find(params[:id])\n\n render json: @analyst\n end",
"def index\n @consulta = Consultum.all\n end",
"def show\n @aspirant = Aspirant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @aspirant }\n end\n end",
"def set_consultant\r\n @consultant = Consultant.find(params[:id])\r\n end",
"def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estudiante }\n end\n end",
"def show\n @visitante_credenciado = VisitanteCredenciado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @visitante_credenciado }\n end\n end",
"def show\n @dental = Dental.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dental }\n end\n end",
"def show\n @etudiant = Etudiant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etudiant }\n end\n end",
"def show\r\n @design_dissertation = DesignDissertation.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @design_dissertation }\r\n end\r\n end",
"def index\n @todas_consultas = @paciente.consultas\n end",
"def show\n render json: @department, status: :found\n end",
"def show\n @contestant = Contestant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contestant }\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @consulta }\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @consulta }\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @consulta }\n end\n end",
"def show\n @diabetes_consultation = DiabetesConsultation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @diabetes_consultation }\n end\n end",
"def show\n @apprentice = Apprentice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apprentice }\n end\n end",
"def show\n @agente = Agente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @agente } \n end\n end",
"def set_consultant\n @consultant = Consultant.find(params[:consultant_id])\n end",
"def show\n @antecedente = Antecedente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @antecedente }\n end\n end",
"def show\n @dependencia = Dependencia.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dependencia }\n end\n end",
"def index\n @applicants = Applicant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @applicants }\n end\n end",
"def index\n @expertises = Expertise.all\n\n render json: @expertises\n end",
"def show\n @department = Department.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @department }\n end\n end",
"def show\n @palestrante = Palestrante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @palestrante }\n end\n end",
"def show\n @designation = Designation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @designation }\n end\n end",
"def show\n @talent = Talent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @talent }\n end\n end",
"def show\n @employer = Employer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employer }\n end\n end",
"def show\n @residence = Residence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @residence }\n end\n end",
"def show\n @distraction = Distraction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distraction }\n end\n end",
"def index\n @personnels = Personnel.all\n @departments = Department.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html { render :index }\n\t\t\tformat.json { render json: Oj.dump(@personnels.select([:id, :first_name, :last_name, :email, :gender])) }\n\t\tend\n end",
"def show\n @admin_agency = Admin::Agency.where(:id => params[:id]).includes(:pages)[0]\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_agency }\n end\n end",
"def show\n @expediente = Expediente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expediente }\n end\n end",
"def set_consult\n @consult = Consult.find(params[:id])\n end",
"def index\n \n @plants = Plant.all\n @personal_plants = PersonalPlant.where(:user_id => session[:user][:id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plants }\n end\n end",
"def show\n @reprogramacion = Reprogramacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reprogramacion }\n end\n end",
"def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"def show\n @repairer = Repairer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repairer }\n end\n end",
"def show\n @exprience = Exprience.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exprience }\n end\n end",
"def show\n @compromise = Compromise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @compromise }\n end\n end",
"def show\n @dress = Dress.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dress }\n end\n end",
"def show\n @soldier = Soldier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @soldier }\n end\n end",
"def show\n @soldier = Soldier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @soldier }\n end\n end",
"def show\n render json: @department\n end",
"def show\n @hospital = Hospital.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hospital }\n end\n end",
"def show\n @personaje = Personaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @personaje }\n end\n end",
"def show\n render json: @expertise\n end",
"def index\n @plants = Plant.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @plants }\n end\n end",
"def show\n @compromise = Compromise.find(params[:id])\n\n render json: @compromise\n end",
"def show\n @employee_department = EmployeeDepartment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee_department }\n end\n end",
"def set_consultation\n @consultation = Business::Consultation.find(params[:id])\n end",
"def show\n @claimant = Claimant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @claimant }\n end\n end",
"def show\n render json: @person_expense_record\n end",
"def show\n @supervisor_estagio = SupervisorEstagio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @supervisor_estagio }\n format.json {render :json => @supervisor_estagio }\n end\n end",
"def show\n @early_pregnancy = EarlyPregnancy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @early_pregnancy }\n end\n end",
"def show\n @formulary = Formulary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @formulary }\n end\n end",
"def set_consult\n @consult = Consult.find(params[:id])\n end",
"def set_consult\n @consult = Consult.find(params[:id])\n end",
"def index\n @tenants = keystone.tenants\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @tenants }\n end\n end",
"def set_consultation\n @consultation = Consultation.find(params[:id])\n end",
"def set_consultation\n @consultation = Consultation.find(params[:id])\n end",
"def set_consultation\n @consultation = Consultation.find(params[:id])\n end",
"def index\n @designations = Designation.order(\"id desc\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @designations }\n end\n end",
"def create\n@complain = find_complain\n @consult = @complain.consults.new(consult_params)\n\n respond_to do |format|\n if @consult.save\n format.html { redirect_to :id => nil, notice: 'Consult was successfully created.' }\n format.json { render :show, status: :created, location: @consult }\n else\n format.html { render :index }\n format.json { render json: @consult.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @departments = Department.all\n respond_to do |format|\n format.json{ render json: @departments}\n end\n end",
"def show\n respond_to do |format|\n \tformat.html # show.html.erb\n \tformat.json { render json: @agency }\n end\n end",
"def show\n @persona = Persona.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @persona }\n end\n end",
"def show\n @electoral_district = ElectoralDistrict.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @electoral_district }\n end\n end",
"def show\n @idiom = Idiom.find(params[:id])\n @essays = Essay.where(idiom_id: params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @idiom }\n end\n end",
"def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.json { render :json => @person }\n end\n end",
"def show\n @assist = Assist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assist }\n end\n end",
"def create\n @consulta = Consulta.new(params[:consulta])\n\n if @consulta.save\n render json: @consulta, status: :created, location: @consulta\n else\n render json: @consulta.errors, status: :unprocessable_entity\n end\n end",
"def show\n @commtent1 = Commtent1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commtent1 }\n end\n end",
"def show\n @client_sex = ClientSex.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client_sex }\n end\n end",
"def show\n @immigrant = Immigrant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @immigrant }\n end\n end",
"def show\n @occupant = Occupant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @occupant }\n end\n end",
"def show\n # @retailer = Retailer.find(params[:id], :include => [:deals, :advertisements, :account] )\n respond_to do |format|\n format.html # show.html.erb\n format.json # show.json.rabl\n end\n end",
"def show\r\n @antenne = Antenne.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @antenne }\r\n end\r\n end",
"def show\n @employe = Employe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employe }\n end\n end",
"def show\n @fortune = Fortune.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fortune }\n end\n end",
"def show\n @economia4 = Economia4.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @economia4 }\n end\n end",
"def show\n @exalt = Exalt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exalt }\n end\n end",
"def show\n @respuesta = Respuesta.find(params[:id])\n\n render json: @respuesta\n end",
"def create\n @consultation = current_user.consultations.new(consultation_params)\n\n respond_to do |format|\n if @consultation.save\n format.html { redirect_to @consultation, notice: 'Consulta criada com sucesso.' }\n format.json { render :show, status: :created, location: @consultation }\n else\n format.html { render :new }\n format.json { render json: @consultation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n render json: @dept\n end",
"def show\n @tenant = keystone.get_tenant(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tenant }\n end\n end",
"def show\n @employ = Employ.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employ }\n end\n end",
"def show\n @projeto = Projeto.find(params[:id])\n @enrollments = Enroll.find_all_by_projeto_id params[:id]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @projeto }\n end\n end"
] |
[
"0.77284175",
"0.73945004",
"0.73266983",
"0.697947",
"0.68124306",
"0.6610418",
"0.6610418",
"0.6554576",
"0.6535854",
"0.64771265",
"0.6434937",
"0.636616",
"0.63231885",
"0.6313312",
"0.62996775",
"0.62882704",
"0.6246237",
"0.6245923",
"0.6240435",
"0.62399286",
"0.6197412",
"0.6189107",
"0.6183187",
"0.6180412",
"0.61772984",
"0.6135257",
"0.6135257",
"0.6135257",
"0.6118487",
"0.61023384",
"0.6098908",
"0.60863036",
"0.60741913",
"0.6069846",
"0.60652256",
"0.6061066",
"0.6057011",
"0.60481906",
"0.60452384",
"0.6036986",
"0.6030585",
"0.60239756",
"0.6023354",
"0.60124403",
"0.6007053",
"0.60046655",
"0.6003301",
"0.60016656",
"0.5999909",
"0.5995443",
"0.5994117",
"0.5978316",
"0.59748495",
"0.5971214",
"0.5970485",
"0.5970485",
"0.5967626",
"0.596526",
"0.59611356",
"0.5959348",
"0.5956505",
"0.5951269",
"0.59369946",
"0.59314454",
"0.59273446",
"0.59233123",
"0.5921812",
"0.5921556",
"0.5921006",
"0.5916506",
"0.5916506",
"0.5914858",
"0.5910431",
"0.5910431",
"0.5910431",
"0.5905134",
"0.5898555",
"0.58951867",
"0.58922803",
"0.5892279",
"0.588745",
"0.5886993",
"0.58839864",
"0.5881612",
"0.588084",
"0.5878221",
"0.58760965",
"0.58734024",
"0.58686894",
"0.58659506",
"0.58641016",
"0.58606523",
"0.5856999",
"0.58566904",
"0.5855415",
"0.5847658",
"0.58436567",
"0.58430034",
"0.5842734",
"0.58383715",
"0.58359915"
] |
0.0
|
-1
|
POST /consultants POST /consultants.json
|
def create
@consultant = Consultant.new(consultant_params.except(:department_attributes))
@consultant.department_id = consultant_params[:department_attributes][:id]
respond_to do |format|
if @consultant.save
set_consultants_grid
format.html { redirect_to @consultant, notice: t('activerecord.success.messages.created', model: Consultant.model_name.human) }
format.js
else
format.html { render :new }
format.js { render :new }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @consulta = Consulta.new(params[:consulta])\n\n if @consulta.save\n render json: @consulta, status: :created, location: @consulta\n else\n render json: @consulta.errors, status: :unprocessable_entity\n end\n end",
"def create\n @consultation = current_user.consultations.new(consultation_params)\n\n respond_to do |format|\n if @consultation.save\n format.html { redirect_to @consultation, notice: 'Consulta criada com sucesso.' }\n format.json { render :show, status: :created, location: @consultation }\n else\n format.html { render :new }\n format.json { render json: @consultation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consultum = Consultum.new(params[:consultum])\n\n respond_to do |format|\n if @consultum.save\n format.html { redirect_to @consultum, notice: 'Consultum was successfully created.' }\n format.json { render json: @consultum, status: :created, location: @consultum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @consultum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consultor = Consultor.new(consultor_params)\n\n respond_to do |format|\n if @consultor.save\n format.html { redirect_to @consultor, notice: 'Consultor was successfully created.' }\n format.json { render :show, status: :created, location: @consultor }\n else\n format.html { render :new }\n format.json { render json: @consultor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n p \"*\" * 50\n p params\n p \"*\" * 50\n @consulta = @paciente.consultas.new(consulta_params)\n\n respond_to do |format|\n if @consulta.save\n format.html { redirect_to pacientes_path, notice: 'Consulta foi criado com sucesso.' }\n format.json { render :show, status: :created, location: @paciente_consultas }\n else\n format.html { render :new }\n format.json { render json: @paciente_consultas.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consultor = Consultor.new(consultor_params)\n\n respond_to do |format|\n if @consultor.save\n format.html { redirect_to @consultor, notice: 'Consultor was successfully created.' }\n format.json { render action: 'show', status: :created, location: @consultor }\n else\n format.html { render action: 'new' }\n format.json { render json: @consultor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consultum = Consultum.new(consultum_params)\n\n respond_to do |format|\n if @consultum.save\n format.html { redirect_to @consultum, notice: 'Sua solicitação foi realizada com sucesso. Entraremos em coontato por email.' }\n # format.json { render :show, status: :created, location: @consultum }\n else\n format.html { render :new }\n format.json { render json: @consultum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n@complain = find_complain\n @consult = @complain.consults.new(consult_params)\n\n respond_to do |format|\n if @consult.save\n format.html { redirect_to :id => nil, notice: 'Consult was successfully created.' }\n format.json { render :show, status: :created, location: @consult }\n else\n format.html { render :index }\n format.json { render json: @consult.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consultorio_n = ConsultorioN.new(consultorio_n_params)\n\n respond_to do |format|\n if @consultorio_n.save\n format.html { redirect_to @consultorio_n, notice: 'Consultorio n was successfully created.' }\n format.json { render :show, status: :created, location: @consultorio_n }\n else\n format.html { render :new }\n format.json { render json: @consultorio_n.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consulta_viaje = ConsultaViaje.new(consulta_viaje_params)\n\n respond_to do |format|\n if @consulta_viaje.save\n format.html { redirect_to @consulta_viaje, notice: 'Consulta viaje was successfully created.' }\n format.json { render :show, status: :created, location: @consulta_viaje }\n else\n format.html { render :new }\n format.json { render json: @consulta_viaje.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consultation = Consultation.new(params[:consultation])\n\n respond_to do |format|\n if @consultation.save\n format.html { redirect_to(@consultation, :notice => t(\"flash.notices.model.consultation.created\")) }\n format.xml { render :xml => @consultation, :status => :created, :location => @consultation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @consultation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n \n\n respond_to do |format|\n if @consultorio.save\n format.html { redirect_to @consultorio, notice: 'Consultorio creado exitosamente.' }\n format.json { render :show, status: :created, location: @consultorio }\n else\n format.html { render :new }\n format.json { render json: @consultorio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @consultum = Consultum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @consultum }\n end\n end",
"def create\n @consulta = Consulta.new(params[:consulta])\n\n respond_to do |format|\n if @consulta.save\n format.html { redirect_to(@consulta, :notice => 'Consulta was successfully created.') }\n format.xml { render :xml => @consulta, :status => :created, :location => @consulta }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @consulta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @consulta = Consulta.new(params[:consulta])\n \n if @consulta.save\n flash[:notice] = 'Consulta cadastrada com sucesso.'\n redirect_to(@consulta)\n else\n @terapeutas = Terapeuta.all\n @pacientes = Paciente.all\n render :action => \"new\"\n end\n end",
"def create\n @tipo_consulta = TipoConsulta.new(tipo_consulta_params)\n\n respond_to do |format|\n if @tipo_consulta.save\n format.html { redirect_to @tipo_consulta, notice: 'Tipo consulta was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_consulta }\n else\n format.html { render :new }\n format.json { render json: @tipo_consulta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consultation = Business::Consultation.new(consultation_params)\n @lead = @consultation.lead\n respond_to do |format|\n if @consultation.save\n @consultation.lead.update_attribute(:stage, 'booked_consult')\n @consultation.lead.save\n format.js { render :file => \"app/views/business/consultations/consult.js.erb\" }\n else\n @consult_errors = @consultation.errors.full_messages.map(&:inspect).join(', ').gsub!('\"', '').humanize if @consultation.errors.any?\n format.js { render :file => \"app/views/business/consultations/consult_error.js.erb\" }\n end\n end\n end",
"def consultation_params\n params.require(:consultation).permit(:user_id, :legislation_id)\n end",
"def create\n @expertise = Expertise.new(expertise_params)\n\n if @expertise.save\n render json: @expertise, status: :created, location: @expertise\n else\n render json: @expertise.errors, status: :unprocessable_entity\n end\n end",
"def create\n @diet = Diet.new(diet_params)\n @diet.user = @current_user\n\n if @diet.save\n render json: @diet, status: 201, location: @diet, root: true\n else\n render json: @diet.errors, status: 422\n end\n end",
"def create\n @aspirant = Aspirant.new(params[:aspirant])\n\n respond_to do |format|\n if @aspirant.save\n format.html { redirect_to @aspirant, :notice => 'Аспирант успешно создан.' }\n format.json { render :json => @aspirant, :status => :created, :location => @aspirant }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @aspirant.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def consultant_params\r\n params.require(:consultant).permit(\r\n :name,\r\n :department_id,\r\n :department,\r\n :short_name,\r\n :institution_type,\r\n :capital,\r\n :person_in_charge_name,\r\n :is_qualified_3rd_party_institution,\r\n :company_address,\r\n :department_attributes => [\r\n :name,\r\n :id\r\n ]\r\n )\r\n end",
"def create\n @diabetes_consultation = DiabetesConsultation.new(params[:diabetes_consultation])\n\n respond_to do |format|\n if @diabetes_consultation.save\n format.html { redirect_to(@diabetes_consultation, :notice => 'Diabetes consultation was successfully created.') }\n format.xml { render :xml => @diabetes_consultation, :status => :created, :location => @diabetes_consultation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @diabetes_consultation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @servant = Servant.new(servant_params)\n\n respond_to do |format|\n if @servant.save\n format.html { redirect_to @servant, notice: 'Servant was successfully created.' }\n format.json { render :show, status: :created, location: @servant }\n else\n format.html { render :new }\n format.json { render json: @servant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @contestant = Contestant.new(contestant_params)\n\n \n if @contestant.save\n render json: @contestant\n else\n render json: @contestant.errors\n end\n \n end",
"def create_consultation_using_post_with_http_info(cio_consultation_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SupportApi.create_consultation_using_post ...'\n end\n # verify the required parameter 'cio_consultation_request' is set\n if @api_client.config.client_side_validation && cio_consultation_request.nil?\n fail ArgumentError, \"Missing the required parameter 'cio_consultation_request' when calling SupportApi.create_consultation_using_post\"\n end\n # resource path\n local_var_path = '/consultation'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(cio_consultation_request)\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Consultation')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SupportApi#create_consultation_using_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @consultant = Consultant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consultant }\n end\n end",
"def create\n @intervenant = Intervenant.new(intervenant_params)\n\n respond_to do |format|\n if @intervenant.save\n format.html { redirect_to @intervenant, notice: 'Intervenant was successfully created.' }\n format.json { render :show, status: :created, location: @intervenant }\n else\n format.html { render :new }\n format.json { render json: @intervenant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_consultant\n @consultant = Consultant.find(params[:consultant_id])\n end",
"def create\n plant = Plant.create(plant_params)\n render json: plant, status: :created\n end",
"def create\n @etudiant = Etudiant.new(params[:etudiant])\n\n respond_to do |format|\n if @etudiant.save\n format.html { redirect_to @etudiant, notice: 'Etudiant was successfully created.' }\n format.json { render json: @etudiant, status: :created, location: @etudiant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etudiant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consult = Consult.new(consult_params)\n\n\n respond_to do |format|\n if @consult.save\n if consult_params[:parent_id].present?\n Consult.find(consult_params[:parent_id]).update_attributes(status: 1)\n end\n format.html { redirect_to \"/admin/consults/#{@consult.id}?ud=#{@consult.user_id}\", notice: '回复成功!' }\n format.json { render action: 'show', status: :created, location: @consult }\n else\n format.html { redirect_to \"/admin/consults/new?pd=#{consult_params[:parent_id]}&ud=#{consult_params[:user_id]}&content=#{consult_params[:content]}\", notice: '内容至少6个字符' }\n format.json { render json: @consult.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consultant_role = ConsultantRole.new(params[:consultant_role])\n\n respond_to do |format|\n if @consultant_role.save\n format.html { redirect_to consultant_roles_path(:search_id => params[:consultant_role][:search_id]), notice: \"#{@consultant_role.employee.full_name} was successfully added to this search.\" }\n format.json { render json: @consultant_role, status: :created, location: @consultant_role }\n else\n format.html { render action: \"new\" }\n format.json { render json: @consultant_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consultant_master = ConsultantMaster.new(params[:consultant_master])\n\n respond_to do |format|\n \t format.js { render :content_type => 'text/javascript', :layout => false}\n \t end\n end",
"def create\n @resturant = Resturant.new(resturant_params)\n\n respond_to do |format|\n if @resturant.save\n format.html { redirect_to root_url, notice: 'Resturant was successfully created.' }\n format.json { render :show, status: :created, location: @resturant }\n else\n format.html { render :new }\n format.json { render json: @resturant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @antecedente = @patient.create_antecedente(params[:antecedente])\n\n respond_to do |format|\n if @antecedente.save\n format.html { redirect_to [@patient, @antecedente], notice: 'Antecedente creado satisfactoriamente.' }\n format.json { render json: @antecedente, status: :created, location: @antecedente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @antecedente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @accountant = Accountant.new(accountant_params)\n\n respond_to do |format|\n if @accountant.save\n format.html { redirect_to @accountant, notice: 'Accountant was successfully created.' }\n format.json { render :show, status: :created, location: @accountant }\n else\n format.html { render :new }\n format.json { render json: @accountant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n params.permit(:intitule, :estObligatoire, :nombreDeCaractere, :ordre, :sondage_id)\n ajout = QuestionOuverteService.instance.creerQuestionOuverte(params[:intitule], params[:estObligatoire], params[:nombreDeCaractere], params[:ordre], params[:sondage_id])\n (ajout != nil) ? (render json: ajout, status: :ok) : (render json: nil, status: :not_found)\n end",
"def consult_params\n params.require(:consult).permit!\n end",
"def create\n @agency = Agency.new(agency_params)\n\n if @agency.save\n render json: @agency, status: :created, location: @agency\n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end",
"def create\n @respuesta = Respuesta.new(params[:respuesta])\n\n if @respuesta.save\n render json: @respuesta, status: :created, location: @respuesta\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end",
"def set_consultant\r\n @consultant = Consultant.find(params[:id])\r\n end",
"def consultation_params\n params.require(:consultation).permit(:description, :dates, :consultants, :minutes, :consultation_category_id, :ccrc_id)\n end",
"def create\n passenger = Passenger.new(:name => params[:name], :contact_number => params[:contact_number], :nationality => params[:nationality], :meal_pref => params[:meal_pref])\n passenger.save\n render :json => passenger\n end",
"def create\n @adversaire = Adversaire.new(params[:adversaire])\n @equipe = Equipe.find(params[:equipe_id])\n\n respond_to do |format|\n if @adversaire.save\n format.html { redirect_to @equipe, :notice => 'Adversaire was successfully created.' }\n format.json { render :json => @adversaire, :status => :created, :location => @equipe }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @adversaire.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @talent = Talent.new(params[:talent])\n\n respond_to do |format|\n if @talent.save\n format.html { redirect_to @talent, :notice => 'Talent was successfully created.' }\n format.json { render :json => @talent, :status => :created, :location => @talent }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @talent.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @studant = Studant.new(studant_params)\n\n respond_to do |format|\n if @studant.save\n format.html { redirect_to studants_path, notice: 'Studant was successfully created.' }\n format.json { render :show, status: :created, location: @studant }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @studant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @desem_laboral = DesemLaboral.new(desem_laboral_params)\n\n respond_to do |format|\n if @desem_laboral.save\n format.html { redirect_to new_expectativas_egresado_path, notice: 'Desem laboral was successfully created.' }\n format.json { render :show, status: :created, location: @desem_laboral }\n else\n format.html { render :new }\n format.json { render json: @desem_laboral.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @dept_supervisor = DeptSupervisor.new(params[:dept_supervisor])\n\n respond_to do |format|\n if @dept_supervisor.save\n format.html { redirect_to @dept_supervisor, notice: 'Dept Supervisor was successfully created.' }\n format.json { render json: @dept_supervisor, status: :created, location: @dept_supervisor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dept_supervisor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @dessert = Dessert.new(dessert_params)\n\n respond_to do |format|\n if @dessert.save\n format.html { redirect_to @dessert}\n format.json { render :show, status: :created, location: @dessert }\n else\n format.html { render :new }\n format.json { render json: @dessert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @assistencia = Assistencia.new(assistencia_params)\n\n respond_to do |format|\n if @assistencia.save\n format.html { redirect_to assistencias_path, notice: 'Assistencia was successfully created.' }\n format.json { render :show, status: :created, location: @assistencia }\n else\n format.html { render :new }\n format.json { render json: @assistencia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @restaturant = Restaturant.new(restaturant_params)\n\n respond_to do |format|\n if @restaturant.save\n format.html { redirect_to @restaturant, notice: \"Restaturant was successfully created.\" }\n format.json { render :show, status: :created, location: @restaturant }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @restaturant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @departement = Departement.new(departement_params)\n\n respond_to do |format|\n if @departement.save\n format.html { redirect_to departements_path, notice: 'Departement was successfully created.' }\n format.json { render :show, status: :created, location: @departement }\n else\n format.html { render :new }\n format.json { render json: @departement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @relatorio_gerals = RelatorioGeral.all\n authorize @relatorio_gerals\n\n @relatorio_geral = RelatorioGeral.new(relatorio_geral_params)\n\n respond_to do |format|\n if @relatorio_geral.save\n format.html { redirect_to @relatorio_geral, notice: 'Relatório geral criado com sucesso!' }\n format.json { render :show, status: :created, location: @relatorio_geral }\n else\n format.html { render :new }\n format.json { render json: @relatorio_geral.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if not check_logged_in then\n return\n end\n\n @personal_plant = PersonalPlant.new(params[:personal_plant])\n \n respond_to do |format|\n if @personal_plant.save\n format.html { redirect_to \"/gardens/\"+@personal_plant.garden[:id].to_s, notice: 'Personal plant was successfully created.' }\n format.json { render json: \"/gardens/\"+@personal_plant.garden[:id].to_s, status: :created, location: @personal_plant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @personal_plant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @dental = Dental.new(params[:dental])\n\n respond_to do |format|\n if @dental.save\n format.html { redirect_to @dental, notice: 'Dental was successfully created.' }\n format.json { render json: @dental, status: :created, location: @dental }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dental.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @solicitante = Solicitante.new(solicitante_params)\n\n respond_to do |format|\n if @solicitante.save\n format.html { redirect_to @solicitante, notice: 'Solicitante was successfully created.' }\n format.json { render :show, status: :created, location: @solicitante }\n else\n format.html { render :new }\n format.json { render json: @solicitante.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @contestant = Contestant.new(contestant_params)\n #@contestant.user_id = current_user.id \n @contestant.pageant_id = @pageant.id\n \n respond_to do |format|\n if @contestant.save\n format.html { redirect_to @pageant, notice: 'Contestant was successfully created.' }\n format.json { render :show, status: :created, location: @contestant }\n else\n format.html { render :new }\n format.json { render json: @contestant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @dessert = Dessert.new(dessert_params)\n\n respond_to do |format|\n if @dessert.save\n format.html { redirect_to @dessert, notice: 'Dessert was successfully created.' }\n format.json { render :show, status: :created, location: @dessert }\n else\n format.html { render :new }\n format.json { render json: @dessert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @desinfectante = Desinfectante.new(desinfectante_params)\n\n respond_to do |format|\n if @desinfectante.save\n format.html { redirect_to @desinfectante, notice: 'Desinfectante was successfully created.' }\n format.json { render :show, status: :created, location: @desinfectante }\n else\n format.html { render :new }\n format.json { render json: @desinfectante.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend",
"def index\n @consultors = Consultor.all\n end",
"def index\n @consultors = Consultor.all\n end",
"def create\n @dept = Dept.new(dept_params)\n\n if @dept.save\n render json: @dept, status: :created, location: @dept\n else\n render json: @dept.errors, status: :unprocessable_entity\n end\n end",
"def create_consultation_using_post(cio_consultation_request, opts = {})\n data, _status_code, _headers = create_consultation_using_post_with_http_info(cio_consultation_request, opts)\n data\n end",
"def create_and_invitation_studant(params = {})\n run(:post, \"/invitations\", [201,422], JSON.dump(params))\n end",
"def advisor_create\n @advisor = Person.new(person_params)\n respond_to do |format|\n if @advisor.save\n format.html { redirect_to new_advisor_path, notice: 'データが新規作成されました。' }\n format.json { render :advisor_show, status: :created, location: @advisor }\n else\n format.html { redirect_to new_advisor_path }\n format.json { render json: @advisor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @employe = Employe.new(employe_params)\n\n respond_to do |format|\n if @employe.save!\n \n params = {:nom => @employe.nom, :email => @employe.courriel, :password => \"password\", :role => Role.where(id: @employe.role_id).first.role}\n uri = URI.parse(\"http://fierce-earth-91666.herokuapp.com/usagers/sign_up\")\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Post.new(uri.request_uri)\n request.set_form_data(params)\n response = http.request(request)\n\n\n puts response.code # => 200\n puts response.body # => The body (HTML, JSON, etc)\n \n format.html { redirect_to action: :index , api_id: @employe.organisme_id }\n format.json { render :show, status: :created, location: @employe }\n else\n format.html { render :new }\n format.json { render json: @employe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consultant_customer_destination = ConsultantCustomerDestination.new(consultant_customer_destination_params)\n\n respond_to do |format|\n if @consultant_customer_destination.save\n format.html { redirect_to @consultant_customer_destination, notice: 'Consultant customer destination was successfully created.' }\n format.json { render action: 'show', status: :created, location: @consultant_customer_destination }\n else\n format.html { render action: 'new' }\n format.json { render json: @consultant_customer_destination.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sugerencia = Sugerencia.new(params[:sugerencia])\n\n respond_to do |format|\n if @sugerencia.save\n format.html { redirect_to @sugerencia, :notice => 'Sugerencia was successfully created.' }\n format.json { render :json => @sugerencia, :status => :created, :location => @sugerencia }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @sugerencia.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @departamento = Departamento.new(departamento_params)\n\n if @departamento.save\n render json: @departamento, status: :created, location: @departamento\n else\n render json: @departamento.errors, status: :unprocessable_entity\n end\n end",
"def create_department\n @department = @company.departments.create(name: params[:department][:name],division_id: params[:division_id])\n \trespond_to do |format|\n format.json { render json: @department }\n end\n end",
"def create\n @expediente = Expediente.new(params[:expediente])\n \n respond_to do |format|\n if @expediente.save\n format.html { redirect_to @expediente, notice: 'Expediente was successfully created.' }\n format.json { render json: @expediente, status: :created, location: @expediente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @expediente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ef_mental = @visit.create_ef_mental(params[:ef_mental])\n\n respond_to do |format|\n if @ef_mental.save\n format.html { redirect_to [@patient,@visit,@ef_mental], notice: 'Ef mental was successfully created.' }\n format.json { render json: @ef_mental, status: :created, location: @ef_mental }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ef_mental.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @agente = Agente.new(params[:agente])\n\n respond_to do |format|\n if @agente.save\n format.html { redirect_to @agente, notice: 'Agente se ha creado con éxito.' }\n format.json { render json: @agente, status: :created, location: @agente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @agente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @consulta = Consulta.find(params[:id])\n\n render json: @consulta\n end",
"def create\n @person_expense_record = PersonExpenseRecord.new(person_expense_record_params)\n\n if @person_expense_record.save\n render json: @person_expense_record, status: :created, location: @person_expense_record\n else\n render json: @person_expense_record.errors, status: :unprocessable_entity\n end\n end",
"def create\n @consulta = Consulta.new(params[:consulta])\n\n # Diferenciando consulta de retorno\n @jah_tem_consulta = Consulta.find(:first, :conditions => [ \"paciente_id = ?\", @consulta.paciente_id] )\n\n if @jah_tem_consulta\n @consulta.consulta_id = 1\n else\n @consulta.consulta_id = 0\n end\n\n respond_to do |format|\n if @consulta.save\n format.html { redirect_to(@consulta, :notice => 'Consulta was successfully created.') }\n format.xml { render :xml => @consulta, :status => :created, :location => @consulta }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @consulta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @residente = Residente.new(residente_params)\n\n respond_to do |format|\n if @residente.save\n format.html { redirect_to @residente, notice: 'Residente was successfully created.' }\n format.json { render :show, status: :created, location: @residente }\n else\n format.html { render :new }\n format.json { render json: @residente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @entrevistum = Entrevistum.new(entrevistum_params)\n\n respond_to do |format|\n if @entrevistum.save\n format.html { redirect_to entrevista_path, notice: 'Entrevistum was successfully created.' }\n format.json { render :index, status: :created, location: @entrevistum }\n else\n format.html { render :new }\n format.json { render json: @entrevistum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @consultation = Consultation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consultation }\n end\n end",
"def create\n @grantee = Grantee.new(grantee_params)\n\n respond_to do |format|\n if @grantee.save\n format.html { redirect_to @grantee, notice: 'Grantee was successfully created.' }\n format.json { render :show, status: :created, location: @grantee }\n else\n format.html { render :new }\n format.json { render json: @grantee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @personnel = Personnel.new(personnel_params)\n\n if ( @date && @date != \"\" )\n @date = params[:date].split('-')\n @personnel.birth_date = Date.new(@date[0].to_i,@date[1].to_i,@date[2].to_i)\n end\n\n if ( params[:department] && params[:department] != \"\")\n @deparment = Department.where(name: params[:department])[0]\n @personnel.workin_department_id = @deparment.id\n end\n\n if ( params[:department_manager] && params[:department_manager] != \"\")\n @department_manager = Department.where(name: params[:department_manager])[0]\n @personnel.manage_department_id = @department_manager.id\n end\n\n respond_to do |format|\n if @personnel.save\n format.html { redirect_to @personnel, notice: 'Personnel was successfully created.' }\n format.json { render :show, status: :created, location: @personnel }\n else\n format.html { redirect_to personnels_url, notice: @personnel.errors }\n format.json { render json: @personnel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def consultation_params\n params.fetch(:consultation, {}).permit(:id, :subject, :importance, :category, :body, :city, :skype, :email, :phone, :contact, :archive, :age, :gender, :last_name, :first_name, :patronymic_name, :chronic_diseases)\n end",
"def create\n @laboratorio = Laboratorio.new(laboratorio_params)\n get_responsavel\n puts \"O responsavel é: #{@laboratorio.responsavel_id}\"\n if (@responsavel != \"sem_responsavel\")\n @laboratorio.docentes << Docente.find(@laboratorio.responsavel_id)\n puts \"Add relação entre #{@laboratorio.nome} e #{Docente.find(@laboratorio.responsavel_id).user.nome}\"\n end\n respond_to do |format|\n if @laboratorio.save\n format.html { redirect_to @laboratorio, notice: 'Laboratorio was successfully created.' }\n format.json { render :show, status: :created, location: @laboratorio }\n else\n format.html { render :new }\n format.json { render json: @laboratorio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @colony_ant = ColonyAnt.new(colony_ant_params)\n\n respond_to do |format|\n if @colony_ant.save\n format.html { redirect_to @colony_ant, notice: 'Colony ant was successfully created.' }\n format.json { render :show, status: :created, location: @colony_ant }\n else\n format.html { render :new }\n format.json { render json: @colony_ant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n respond_to do |format|\n if @agency.save\n format.html { redirect_to @agency, notice: 'Agency was successfully created.' }\n format.json { render json: @agency, status: :created, location: @agency }\n else\n format.html { render action: \"new\" }\n format.json { render json: @agency.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @dept_supervisor = DeptSupervisor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dept_supervisor }\n end\n end",
"def create\n @personnel = Personnel.new(personnel_params)\n\n respond_to do |format|\n if @personnel.save\n format.html { redirect_to @personnel, notice: 'Personnel was successfully created.' }\n format.json { render :show, status: :created, location: @personnel }\n else\n format.html { render :new }\n format.json { render json: @personnel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @personnel = Personnel.new(personnel_params)\n\n respond_to do |format|\n if @personnel.save\n format.html { redirect_to @personnel, notice: 'Personnel was successfully created.' }\n format.json { render :show, status: :created, location: @personnel }\n else\n format.html { render :new }\n format.json { render json: @personnel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @andress = Andress.new(andress_params)\n\n respond_to do |format|\n if @andress.save\n format.html { redirect_to @andress, notice: 'Andress was successfully created.' }\n format.json { render :show, status: :created, location: @andress }\n else\n format.html { render :new }\n format.json { render json: @andress.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @expert = Expert.new(expert_params)\n\n respond_to do |format|\n if @expert.save\n format.html { redirect_to @expert, notice: 'Expert was successfully created.' }\n format.json { render :show, status: :created, location: @expert }\n else\n format.html { render :new }\n format.json { render json: @expert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @donante = Donante.new(donante_params)\n\n respond_to do |format|\n if @donante.save\n format.html { redirect_to @donante, notice: 'Donante was successfully created.' }\n format.json { render action: 'show', status: :created, location: @donante }\n else\n format.html { render action: 'new' }\n format.json { render json: @donante.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @department = Department.new(department_params)\n\n if @department.save\n render :show, status: :created, location: @department\n else\n render json: @department.errors, status: :unprocessable_entity\n end\n end",
"def create\r\n @design_dissertation = DesignDissertation.new(params[:design_dissertation])\r\n\r\n respond_to do |format|\r\n if @design_dissertation.save\r\n format.html { redirect_to @design_dissertation, notice: 'Design dissertation was successfully created.' }\r\n format.json { render json: @design_dissertation, status: :created, location: @design_dissertation }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @design_dissertation.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def index\n #@users = User.all\n @respuesta = Consulta.new(300,params[0])\n\n respond_to do |format|\n format.json { render json: @respuesta }\n \n end\n end",
"def create\n @responsible = Responsible.new(responsible_params)\n\n respond_to do |format|\n if @responsible.save\n format.html { redirect_to @responsible, notice: 'Responsavel criado com sucesso.' }\n format.json { render action: 'show', status: :created, location: @responsible }\n else\n format.html { render action: 'new' }\n format.json { render json: @responsible.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @faltante = Faltante.new(faltante_params)\n @employees = Employee.all\n @faltantes = Tipofaltante.all\n \n respond_to do |format|\n if @faltante.save\n format.html { redirect_to @faltante, notice: 'Faltante was successfully created.' }\n format.json { render :show, status: :created, location: @faltante }\n else\n format.html { render :new }\n format.json { render json: @faltante.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @adviser = Adviser.new(adviser_params)\n\n respond_to do |format|\n if @adviser.save\n format.html { redirect_to @adviser, notice: 'Adviser was successfully created.' }\n format.json { render :show, status: :created, location: @adviser }\n else\n format.html { render :new }\n format.json { render json: @adviser.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipo_despesa = TipoDespesa.new(tipo_despesa_params)\n\n respond_to do |format|\n if @tipo_despesa.save\n format.html { redirect_to tenant_tipo_despesas_path(tenant_id: @tenant.id), notice: 'Tipo despesa was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_despesa }\n else\n format.html { render :new }\n format.json { render json: @tipo_despesa.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7297487",
"0.7130123",
"0.6880817",
"0.6829281",
"0.679948",
"0.67819154",
"0.67055196",
"0.66422904",
"0.6362503",
"0.6276895",
"0.6231227",
"0.6210812",
"0.61969227",
"0.6196808",
"0.6190428",
"0.6160402",
"0.60289246",
"0.6023749",
"0.5976119",
"0.59737074",
"0.5923343",
"0.5920696",
"0.5901332",
"0.58909607",
"0.5854978",
"0.5836391",
"0.5836294",
"0.5826839",
"0.581621",
"0.58132994",
"0.58109903",
"0.58058995",
"0.5804965",
"0.57993597",
"0.5792762",
"0.5752607",
"0.5749087",
"0.5742704",
"0.5735866",
"0.571786",
"0.57058924",
"0.57057184",
"0.5704189",
"0.5702489",
"0.5689631",
"0.5689442",
"0.5688916",
"0.5675514",
"0.56711644",
"0.56504226",
"0.56485355",
"0.56421316",
"0.56319565",
"0.5629446",
"0.5625553",
"0.56109506",
"0.5607064",
"0.55992633",
"0.55952036",
"0.55920166",
"0.5590884",
"0.55886495",
"0.55886495",
"0.5585651",
"0.5578417",
"0.55761206",
"0.55745506",
"0.5566199",
"0.55645484",
"0.55637294",
"0.55615133",
"0.55603355",
"0.5553395",
"0.5550378",
"0.55501807",
"0.5549931",
"0.5547258",
"0.5542911",
"0.5540663",
"0.5535216",
"0.55335146",
"0.5532845",
"0.55314064",
"0.5531322",
"0.5531064",
"0.5528267",
"0.5528128",
"0.5526807",
"0.55253804",
"0.55253804",
"0.55178773",
"0.55117327",
"0.5511259",
"0.5508656",
"0.5508191",
"0.5507666",
"0.5504984",
"0.54960185",
"0.5495406",
"0.5492989"
] |
0.6256312
|
10
|
PATCH/PUT /consultants/1 PATCH/PUT /consultants/1.json
|
def update
respond_to do |format|
@consultant.department_id = consultant_params[:department_attributes][:id]
if @consultant.update(consultant_params.except(:department_attributes))
set_consultants_grid
format.html { redirect_to @consultant, notice: t('activerecord.success.messages.updated', model: Consultant.model_name.human) }
format.js
else
format.html { render :edit }
format.js { render :edit }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @consulta = Consulta.find(params[:id])\n\n if @consulta.update(params[:consulta])\n head :no_content\n else\n render json: @consulta.errors, status: :unprocessable_entity\n end\n end",
"def update\n @consultum = Consultum.find(params[:id])\n\n respond_to do |format|\n if @consultum.update_attributes(params[:consultum])\n format.html { redirect_to @consultum, notice: 'Consultum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @consultum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consult.update(consult_params)\n format.html { redirect_to @consult, notice: 'Consult was successfully updated.' }\n format.json { render :show, status: :ok, location: @consult }\n else\n format.html { render :edit }\n format.json { render json: @consult.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consultor.update(consultor_params)\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @consultor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consultor.update(consultor_params)\n format.html { redirect_to @consultor, notice: 'Consultor was successfully updated.' }\n format.json { render :show, status: :ok, location: @consultor }\n else\n format.html { render :edit }\n format.json { render json: @consultor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n@complain = find_complain\n respond_to do |format| \n \n if @consult = @complain.update(consult_params)\n format.html { redirect_to @consult, notice: 'Consult was successfully updated.' }\n format.json { render :show, status: :ok, location: @consult }\n else\n format.html { render :edit }\n format.json { render json: @consult.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consulta.update(consulta_params)\n format.html { redirect_to paciente_consultas_path, notice: 'Consulta foi editada com sucesso.' }\n format.json { render :show, status: :ok, location: @consulta }\n else\n format.html { render :edit }\n format.json { render json: @consulta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @consultant_master = ConsultantMaster.find(params[:id])\n\n respond_to do |format|\n if @consultant_master.update_attributes(params[:consultant_master])\n format.html { redirect_to @consultant_master, notice: 'Consultant master was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @consultant_master.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consult.update(consult_params)\n format.html { redirect_to \"/admin/consults/#{@consult.id}?ud=#{@consult.user_id}\", notice: t('activerecord.models.consult')+'更新成功!' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @consult.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consultum.update(consultum_params)\n format.html { redirect_to @consultum, notice: 'Consulta foi editada com sucesso.' }\n format.json { render :show, status: :ok, location: @consultum }\n else\n # format.html { render :edit }\n format.json { render json: @consultum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consultation.update(consultation_params)\n format.html { redirect_to @consultation, notice: 'Consulta atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @consultation }\n else\n format.html { render :edit }\n format.json { render json: @consultation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n if @consulta.update_attributes(params[:consulta])\n format.html { redirect_to(@consulta, :notice => 'Consulta was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @consulta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n if @consulta.update_attributes(params[:consulta])\n format.html { redirect_to(@consulta, :notice => 'Consulta was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @consulta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @consultation = Consultation.find(params[:id])\n\n respond_to do |format|\n if @consultation.update_attributes(params[:consultation])\n format.html { redirect_to(@consultation, :notice => t(\"flash.notices.model.consultation.updated\"))}\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @consultation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @demanda = Demanda.find(params[:id])\n\n respond_to do |format|\n if @demanda.update_attributes(params[:demanda])\n if @demanda.tipo_demanda == '1' || @demanda.tipo_demanda == 1\n format.html { redirect_to \"/consultas/list/1\", :notice => 'Consulta atualizada com sucesso.'}\n format.json { head :no_content }\n elsif @demanda.tipo_demanda == '2' || @demanda.tipo_demanda == 2\n format.html { redirect_to \"/consultas/list/2\", :notice => 'Levantamento atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { redirect_to \"/consultas/list/3\", :notice => 'Flagrante atualizado com sucesso.' }\n format.json { head :no_content }\n end\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @demanda.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consultorio.update(consultorio_params)\n format.html { redirect_to @consultorio, notice: 'Consultorio actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @consultorio }\n else\n format.html { render :edit }\n format.json { render json: @consultorio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"def update\n respond_to do |format|\n if @consultorio_n.update(consultorio_n_params)\n format.html { redirect_to @consultorio_n, notice: 'Consultorio n was successfully updated.' }\n format.json { render :show, status: :ok, location: @consultorio_n }\n else\n format.html { render :edit }\n format.json { render json: @consultorio_n.errors, status: :unprocessable_entity }\n end\n end\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def update\n respond_to do |format|\n if @consulta_viaje.update(consulta_viaje_params)\n format.html { redirect_to @consulta_viaje, notice: 'Consulta viaje was successfully updated.' }\n format.json { render :show, status: :ok, location: @consulta_viaje }\n else\n format.html { render :edit }\n format.json { render json: @consulta_viaje.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @consulta = Consulta.find(params[:id])\n\n respond_to do |format|\n if @consulta.update_attributes(params[:consulta])\n flash[:notice] = 'Consulta atualizada com sucesso.'\n format.html { redirect_to(@consulta) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @consulta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trein_consul_comercial.update(trein_consul_comercial_params)\n format.html { redirect_to @trein_consul_comercial, notice: 'Trein consul comercial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trein_consul_comercial.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\n end\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update\n respond_to do |format|\n if @tipo_consulta.update(tipo_consulta_params)\n format.html { redirect_to @tipo_consulta, notice: 'Tipo consulta was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_consulta }\n else\n format.html { render :edit }\n format.json { render json: @tipo_consulta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @person.seat\n render json: {errors: 'Cannot update a seated person'}, status: 422\n else\n @person.update person_params\n render json: @person\n end\n end",
"def edit\n @therapist_consent = TherapistConsent.find(params[:id])\n respond_to do |format|\n format.html { render action: 'edit' }\n format.json { render :status => 200, :json => { action: 'edit', therapist_consent: @therapist_consent}}\n end\n end",
"def update\n @formulary = Formulary.find(params[:id])\n\n respond_to do |format|\n if @formulary.update_attributes(params[:formulary])\n format.html { redirect_to @formulary, notice: 'Formulario actualizado exitosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @formulary.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @servant.update(servant_params)\n format.html { redirect_to @servant, notice: 'Servant was successfully updated.' }\n format.json { render :show, status: :ok, location: @servant }\n else\n format.html { render :edit }\n format.json { render json: @servant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"def update\n respond_to do |format|\n if @formulary.update(formulary_params)\n format.html { redirect_to formularies_url, alert: I18n.t('activerecord.models.formulary') + I18n.t('helpers_locale.models.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @formulary.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @persona = Persona.find(params[:id])\n \n respond_to do |format|\n if @persona.update_attributes(params[:persona])\n format.json { head :ok }\n else\n format.json { render :json => @persona.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"def update\n if request.content_type == \"application/json\"\n # .update is like a \"update people set ...\" in sql\n if @person.update(person_params)\n render json: @person\n else\n render json: @person.errors, status: :not_found\n end\n else\n render status: :bad_request\n end\n end",
"def update\n @agency = Agency.find(params[:id])\n\n if @agency.update(agency_params)\n #head :no_content\n render json: @agency, status: :accepted, location: @agency #sera? status accepted? \n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end",
"def update\n @person = Person.find(params[:id]) \n respond_to do |format|\n if @person.update(person_params)\n format.json { render json: @person, status: :ok }\n else\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end",
"def update\n respond_to do |format|\n if @resturant.update(resturant_params)\n format.html { redirect_to @resturant, notice: 'Resturant was successfully updated.' }\n format.json { render :show, status: :ok, location: @resturant }\n else\n format.html { render :edit }\n format.json { render json: @resturant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @agency.update_attributes(params[:agency])\n format.html { redirect_to @agency, notice: 'Agency was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @agency.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @compromise = Compromise.find(params[:id])\n\n respond_to do |format|\n if @compromise.update_attributes(params[:compromise])\n format.html { redirect_to @compromise, notice: 'Compromise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @compromise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @personaje = Personaje.find(params[:id])\n\n respond_to do |format|\n if @personaje.update_attributes(params[:personaje])\n format.html { redirect_to @personaje, notice: 'Personaje was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @personaje.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @aspirant = Aspirant.find(params[:id])\n\n respond_to do |format|\n if @aspirant.update_attributes(params[:aspirant])\n format.html { redirect_to @aspirant, :notice => 'Аспирант успешно изменен.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @aspirant.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @initiative = Initiative.find(params[:id])\n \n respond_to do |format|\n if @initiative.update_attributes(params[:initiative])\n \n format.html { redirect_to @initiative, notice: 'Initiative was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @initiative.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n #parametros_autocomplete!(params[:estudiante][:persona])\n @estudiante = Estudiante.find(params[:id])\n \n begin\n @estudiante.persona_id = params[:persona][:id]\n rescue\n end\n\n respond_to do |format|\n if @estudiante.update_attributes(params[:estudiante])\n format.html { redirect_to @estudiante, notice: 'Estudiante actualizado' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estudiante.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @agency.update(agency_params)\n format.html { redirect_to @agency, notice: 'Agency was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @agency.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @pfs_consultation = PfsConsultation.find(params[:id])\n\n respond_to do |format|\n if @pfs_consultation.update_attributes(params[:pfs_consultation])\n format.html { redirect_to(@pfs_consultation, :notice => 'Pfs consultation was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pfs_consultation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_initiative.update(api_v1_initiative_params)\n format.html { redirect_to @api_v1_initiative, notice: 'Initiative was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @request_for_change.set_manager(force: true)\n @request_for_change.set_security_officer(force: true)\n\n respond_to do |format|\n if @request_for_change.update(request_for_change_params)\n format.html { redirect_to edit_request_for_change_path(@request_for_change), notice: 'Request for change was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @request_for_change.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lead = @consultation.lead\n respond_to do |format|\n if @consultation.update(consultation_params)\n @consultation.lead.update_attribute(:stage, 'booked_consult')\n @consultation.lead.save\n format.js { render :file => \"app/views/business/consultations/consult.js.erb\" }\n else\n @consult_errors = @consultation.errors.full_messages.map(&:inspect).join(', ').gsub!('\"', '').humanize if @consultation.errors.any?\n format.js { render :file => \"app/views/business/consultations/consult_error.js.erb\" }\n end\n end\n end",
"def update\n @claimant = Claimant.find(params[:id])\n\n respond_to do |format|\n if @claimant.update_attributes(params[:claimant])\n format.html { redirect_to @claimant, notice: 'Claimant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @claimant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to [:admin, @oferta], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @responsible.update(responsible_params)\n format.html { redirect_to @responsible, notice: 'Responsavel editado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @responsible.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @expertise = Expertise.find(params[:id])\n\n if @expertise.update(expertise_params)\n head :no_content\n else\n render json: @expertise.errors, status: :unprocessable_entity\n end\n end",
"def activo_update\n respond_to do |format|\n activo = params[:laboratorio][:activo]\n id = params[:id]\n Laboratorio.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"def rest_patch(base_uri,json_payload,params)\n begin\n @response = RestClient.patch(base_uri,json_payload,params)\n rescue => e\n puts @response.code\n end\n return @response\n end",
"def update\n @analyst = Analyst.find(params[:id])\n\n if @analyst.update(params[:analyst])\n head :no_content\n else\n render json: @analyst.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @dessert.update(dessert_params)\n format.html { redirect_to @dessert}\n format.json { render :show, status: :ok, location: @dessert }\n else\n format.html { render :edit }\n format.json { render json: @dessert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @diabetes_consultation = DiabetesConsultation.find(params[:id])\n\n respond_to do |format|\n if @diabetes_consultation.update_attributes(params[:diabetes_consultation])\n format.html { redirect_to(@diabetes_consultation, :notice => 'Diabetes consultation was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @diabetes_consultation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @apprentice = Apprentice.find(params[:id])\n\n respond_to do |format|\n if @apprentice.update_attributes(params[:apprentice])\n format.html { redirect_to @apprentice, notice: 'Apprentice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @apprentice.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_consultation_using_put_with_http_info(consultation, consultation_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SupportApi.update_consultation_using_put ...'\n end\n # verify the required parameter 'consultation' is set\n if @api_client.config.client_side_validation && consultation.nil?\n fail ArgumentError, \"Missing the required parameter 'consultation' when calling SupportApi.update_consultation_using_put\"\n end\n # verify the required parameter 'consultation_id' is set\n if @api_client.config.client_side_validation && consultation_id.nil?\n fail ArgumentError, \"Missing the required parameter 'consultation_id' when calling SupportApi.update_consultation_using_put\"\n end\n # resource path\n local_var_path = '/consultation/{consultation_id}'.sub('{' + 'consultation_id' + '}', consultation_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(consultation)\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Consultation')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SupportApi#update_consultation_using_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @admin_agency = Admin::Agency.find(params[:id])\n\n respond_to do |format|\n if @admin_agency.update_attributes(params[:admin_agency])\n format.html { redirect_to @admin_agency, notice: 'Agency was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_agency.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @agency = Agency.find(params[:id])\n\n if @agency.update(agency_params)\n #head :no_content\n render json: @agency, status: :accepted, location: @agency #sera? status accepted? \n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end",
"def update\n @persona = Persona.find(params[:id])\n\n respond_to do |format|\n if @persona.update_attributes(params[:persona])\n format.html { redirect_to personas_path, notice: 'Persona was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @persona.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @fulcliente = Fulcliente.find(params[:id])\n\n respond_to do |format|\n if @fulcliente.update_attributes(params[:fulcliente])\n format.html { redirect_to @fulcliente, notice: 'Fulcliente was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fulcliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @respuesta = Respuesta.find(params[:id])\n\n respond_to do |format|\n if @respuesta.update_attributes(params[:respuesta])\n format.html { redirect_to @respuesta, notice: 'Respuesta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @respuesta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n @dept = Department.find(params[:id])\n @form_id = 'edit-form'\n \n respond_to do |fmt|\n fmt.html { render :partial => 'form' }\n fmt.json { render :json => @dept }\n end\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to contestants_path, notice: 'Contestant was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def update\n respond_to do |format|\n if @dessert.update(dessert_params)\n format.html { redirect_to @dessert, notice: 'Dessert was successfully updated.' }\n format.json { render :show, status: :ok, location: @dessert }\n else\n format.html { render :edit }\n format.json { render json: @dessert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n resource.update(deposit_contract_params)\n respond_with client, resource\n end",
"def edit\n respond_with(reagent)\n end",
"def update\n respond_to do |format|\n if @intervenant.update(intervenant_params)\n format.html { redirect_to @intervenant, notice: 'Intervenant was successfully updated.' }\n format.json { render :show, status: :ok, location: @intervenant }\n else\n format.html { render :edit }\n format.json { render json: @intervenant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @employ = Employ.find(params[:id])\n\n respond_to do |format|\n if @employ.update_attributes(params[:employ])\n format.html { redirect_to @employ, notice: 'Employ was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @employ.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @etudiant = Etudiant.find(params[:id])\n\n respond_to do |format|\n if @etudiant.update_attributes(params[:etudiant])\n format.html { redirect_to @etudiant, notice: 'Etudiant was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @etudiant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @fortune = Fortune.find(params[:id])\n\n respond_to do |format|\n if @fortune.update_attributes(params[:fortune])\n format.html { redirect_to @fortune, notice: 'Piosenka pozytywnie zaktualizowana.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fortune.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @manage_retreat.update(manage_retreat_params)\n format.html { redirect_to @manage_retreat, notice: 'Manage retreat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @manage_retreat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @patient = @client.patients.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n @designation = Designation.find(params[:id])\n @form_id = 'edit-form'\n \n respond_to do |fmt|\n fmt.html { render :partial => 'form' }\n fmt.json { render :json => @designation }\n end\n end",
"def update\n @adversaire = Adversaire.find(params[:id])\n @equipe = Equipe.find(params[:equipe_id])\n respond_to do |format|\n if @adversaire.update_attributes(params[:adversaire])\n format.html { redirect_to @equipe, :notice => 'Adversaire was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @adversaire.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @dossier = Dossier.find(params[:id])\n \n respond_to do |format|\n if @dossier.update_attributes(params[:dossier])\n format.html { redirect_to(@dossier, :notice => 'Dossier was successfully updated.') }\n format.xml { head :ok }\n format.json { render :json => { :success => true, :message => \"Updated Dossier #{@dossier.id}\", :data => @dossier.attributes.merge(:institution_nom => @dossier.institution.nom, :type_etat_dossier_description => @dossier.type_etat_dossier.try(:description), :juge_mission_id => @dossier.juge_mission.try(:contact_id), :juge_controlleur_id => @dossier.juge_controlleur.try(:contact_id))}}\n \n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @dossier.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @patient = Patient.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient].except(:person_attributes))\n format.html { redirect_to people_url, notice: 'Patient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @rest.update(rest_params)\n format.html { redirect_to @rest, notice: 'Rest was successfully updated.' }\n format.json { render :show, status: :ok, location: @rest }\n else\n format.html { render :edit }\n format.json { render json: @rest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: t('.update_ok') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end",
"def set_consultant\r\n @consultant = Consultant.find(params[:id])\r\n end",
"def update\n respond_to do |format|\n if @residential.update(residential_params)\n format.html { redirect_to @residential, notice: 'Residential was successfully updated.' }\n format.json { render :show, status: :ok, location: @residential }\n else\n format.html { render :edit }\n format.json { render json: @residential.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_initiative_update.update(api_v1_initiative_update_params)\n format.html { redirect_to @api_v1_initiative_update, notice: 'Initiative update was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_update }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_update.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @person = Person.find(params[:id])\n @treasury = @person.treasury\n return if needs_treasury_supervisor(@treasury)\n\n respond_to do |format|\n if @person.update_attributes(person_params)\n format.html { redirect_to @treasury }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: { errors: @person.errors }, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @residencia.update(residencia_params)\n format.html { redirect_to [@programa, @residencia], notice: 'residencia was successfully updated.' }\n format.json { render :show, status: :ok, location: [@programa, @residencia] }\n else\n format.html { render :edit }\n format.json { render json: @residencia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @person = Person.find(params[:id])\n\n populate_attributes(@person, params[:person])\n respond_to do |format|\n \n if @person.save && @person.identifiable_entries.each(&:save!)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @consumo = Consumo.find(params[:id])\n\n respond_to do |format|\n if @consumo.update_attributes(params[:consumo])\n format.html { redirect_to @consumo.cliente, :notice => 'Consumo alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @consumo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @colony_ant.update(colony_ant_params)\n format.html { redirect_to @colony_ant, notice: 'Colony ant was successfully updated.' }\n format.json { render :show, status: :ok, location: @colony_ant }\n else\n format.html { render :edit }\n format.json { render json: @colony_ant.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.68250626",
"0.67603624",
"0.6703207",
"0.65662676",
"0.6527295",
"0.6520575",
"0.65140396",
"0.6512651",
"0.6466661",
"0.64252913",
"0.63861287",
"0.63631815",
"0.63631815",
"0.6239034",
"0.6235277",
"0.61142397",
"0.6109616",
"0.6091964",
"0.6091964",
"0.6091658",
"0.6079503",
"0.60785514",
"0.6070459",
"0.6052919",
"0.60526156",
"0.6050906",
"0.60334146",
"0.6031728",
"0.6011665",
"0.5983443",
"0.5979703",
"0.597785",
"0.597785",
"0.59723514",
"0.5968816",
"0.59477997",
"0.594093",
"0.5935893",
"0.5921197",
"0.59205794",
"0.5909918",
"0.5888234",
"0.58831525",
"0.58810437",
"0.5879512",
"0.587382",
"0.58624935",
"0.5860844",
"0.5858653",
"0.5850631",
"0.58450264",
"0.5837899",
"0.58376646",
"0.58360374",
"0.5835593",
"0.58352923",
"0.5827412",
"0.58246374",
"0.582099",
"0.5808901",
"0.5799544",
"0.57911015",
"0.5786169",
"0.5775835",
"0.5770997",
"0.5770329",
"0.57666564",
"0.5765238",
"0.5757015",
"0.5752113",
"0.5748209",
"0.5743223",
"0.57419074",
"0.57388353",
"0.5726293",
"0.5720048",
"0.5717357",
"0.5716887",
"0.5716431",
"0.5705673",
"0.5705187",
"0.5704083",
"0.5703165",
"0.5700059",
"0.5697818",
"0.5696584",
"0.56946",
"0.5694531",
"0.5693859",
"0.56928426",
"0.56928426",
"0.56928426",
"0.56928426",
"0.56928426",
"0.5684809",
"0.5680893",
"0.5678471",
"0.5673426",
"0.56733364",
"0.56733316"
] |
0.6086605
|
20
|
DELETE /consultants/1 DELETE /consultants/1.json
|
def destroy
@consultant.destroy
respond_to do |format|
set_consultants_grid
format.html { redirect_to consultants_url, notice: t('activerecord.success.messages.destroyed', model: Consultant.model_name.human) }
format.js
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @consultum = Consultum.find(params[:id])\n @consultum.destroy\n\n respond_to do |format|\n format.html { redirect_to consulta_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consult.destroy\n respond_to do |format|\n format.html { redirect_to consults_url, notice: 'Consult was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consult.destroy\n respond_to do |format|\n format.html { redirect_to consults_url, notice: 'Consult was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consultor.destroy\n respond_to do |format|\n format.html { redirect_to consultors_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consulta = Consulta.find(params[:id])\n @consulta.destroy\n\n head :no_content\n end",
"def destroy\n @consultation.destroy\n respond_to do |format|\n format.html { redirect_to consultations_url, notice: 'Consulta apagada' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consultant_master = ConsultantMaster.find(params[:id])\n @consultant_master.destroy\n\n respond_to do |format|\n format.html { redirect_to consultant_masters_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consultation.destroy\n respond_to do |format|\n format.html { redirect_to consultations_url, notice: 'Consultation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consultor.destroy\n respond_to do |format|\n format.html { redirect_to consultors_url, notice: 'Consultor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consult.destroy\n respond_to do |format|\n format.html { redirect_to admin_consults_url, notice: t('activerecord.models.consult')+'删除成功!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consultation = Consultation.find(params[:id])\n @consultation.destroy\n\n respond_to do |format|\n format.html { redirect_to(consultations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @consulta.destroy\n respond_to do |format|\n format.html { redirect_to paciente_consultas_path, notice: 'Consulta foi deletada com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consultum.destroy\n respond_to do |format|\n format.html { redirect_to consulta_url, notice: 'Consulta foi excluída com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consulta = Consulta.find(params[:id])\n @consulta.destroy\n\n respond_to do |format|\n format.html { redirect_to(consultas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @consulta = Consulta.find(params[:id])\n @consulta.destroy\n\n respond_to do |format|\n format.html { redirect_to(consultas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @diabetes_consultation = DiabetesConsultation.find(params[:id])\n @diabetes_consultation.destroy\n\n respond_to do |format|\n format.html { redirect_to(diabetes_consultations_url) }\n format.xml { head :ok }\n end\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @contestant = Contestant.find(params[:id])\n @contestant.destroy\n\n respond_to do |format|\n format.html { redirect_to contestants_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @aspirant = Aspirant.find(params[:id])\n @aspirant.destroy\n\n respond_to do |format|\n format.html { redirect_to aspirants_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @consultorio.destroy\n respond_to do |format|\n format.html { redirect_to consultorios_url, notice: 'Consultorio eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consulta_viaje.destroy\n respond_to do |format|\n format.html { redirect_to consulta_viajes_url, notice: 'Consulta viaje was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Company.delete(params[\"id\"])\n end",
"def destroy\n @pfs_consultation = PfsConsultation.find(params[:id])\n @pfs_consultation.destroy\n\n respond_to do |format|\n format.html { redirect_to(pfs_consultations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @consultorio_n.destroy\n respond_to do |format|\n format.html { redirect_to consultorio_ns_url, notice: 'Consultorio n was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_consulta.destroy\n respond_to do |format|\n format.html { redirect_to tipo_consultas_url, notice: 'Tipo consulta was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def incident_delete(statuspage_id, incident_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['incident_id'] = incident_id\n\n request :method => :post,\n :url => @url + 'incident/delete',\n :payload => data\n end",
"def destroy\n @resturant.destroy\n respond_to do |format|\n format.html { redirect_to resturants_url, notice: 'Resturant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n \n keystone.delete_tenant(keystone.get_tenant(params[:id])[:id])\n\n respond_to do |format|\n format.html { redirect_to tenants_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @admin_agency = Admin::Agency.find(params[:id])\n @admin_agency.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_agencies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @etudiant = Etudiant.find(params[:id])\n @etudiant.destroy\n\n respond_to do |format|\n format.html { redirect_to etudiants_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @persona = Persona.find(params[:id])\n @persona.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n \n end",
"def delete\n render json: Alien.delete(params[\"id\"])\n end",
"def destroy\n @servant.destroy\n respond_to do |format|\n format.html { redirect_to servants_url, notice: 'Servant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @visitante_credenciado = VisitanteCredenciado.find(params[:id])\n @visitante_credenciado.destroy\n\n respond_to do |format|\n format.html { redirect_to visitante_credenciados_url }\n format.json { head :no_content }\n end\n \n end",
"def destroy\n @claimant = Claimant.find(params[:id])\n @claimant.destroy\n\n respond_to do |format|\n format.html { redirect_to claimants_url }\n format.json { head :no_content }\n end\n end",
"def delete(query)\n\n connect if @persevere.nil?\n\n deleted = 0\n\n if ! query.is_a?(DataMapper::Query)\n resources = [query].flatten\n else\n resources = read_many(query)\n end\n\n resources.each do |resource|\n tblname = resource.model.storage_name\n id = resource.attributes(:field)['id']\n \n # Retrieve the ID from persever if the resource doesn't have an ID field\n if id.nil?\n query = Persevere.enhance(resource.query)\n path = \"/#{tblname}/#{query.to_json_query_filter}[={'id':id}]\"\n response = @persevere.retrieve(path, {})\n id = JSON.parse(response.body)[0]['id'].match(/(\\w+\\/)*(\\d+)/)[2]\n end\n \n path = \"/#{tblname}/#{id}\"\n # path = \"/#{tblname}/#{resource.key.first}\"\n \n DataMapper.logger.debug(\"(Delete) PATH/QUERY: #{path}\")\n\n result = @persevere.delete(path)\n\n if result.code == \"204\" # ok\n deleted += 1\n end\n end\n return deleted\n end",
"def destroy\n @hydrant = Hydrant.find(params[:id])\n @hydrant.destroy\n\n respond_to do |format|\n format.html { redirect_to(hydrants_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @plant = @garden.plants.find(params[:id])\n @plant.destroy\n respond_to do |format|\n format.html { redirect_to @garden, notice: 'Plant deleted.' }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def destroy\n @contestant.destroy\n respond_to do |format|\n format.html { redirect_to contestants_url, notice: 'Contestant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @plantation.destroy\n respond_to do |format|\n format.html { redirect_to farm_plantations_url(@farm), notice: 'Plantation enlevée.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @equipe = Equipe.find(params[:equipe_id])\n @adversaire = Adversaire.find(params[:id])\n @adversaire.destroy\n\n respond_to do |format|\n format.html { redirect_to @equipe }\n format.json { head :no_content }\n end\n end",
"def destroy\n @occupant = Occupant.find(params[:id])\n @occupant.destroy\n\n respond_to do |format|\n format.html { redirect_to occupants_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dental = Dental.find(params[:id])\n @dental.destroy\n\n respond_to do |format|\n format.html { redirect_to dentals_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consultant_customer_destination.destroy\n respond_to do |format|\n format.html { redirect_to consultant_customer_destinations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @my_studio_client = MyStudio::Client.find(params[:id])\n @my_studio_client.destroy\n\n respond_to do |format|\n format.html { redirect_to my_studio_clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @intervenant.destroy\n respond_to do |format|\n format.html { redirect_to intervenants_url, notice: 'Intervenant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_plant = TestPlant.find(params[:id])\n @test_plant.destroy\n\n respond_to do |format|\n format.html { redirect_to(test_plants_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n request(:delete)\n end",
"def destroy\n @visitante.destroy\n respond_to do |format|\n format.html { redirect_to visitantes_url, notice: 'Visitante was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @department_entry.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def delete\n supprimer = SondageService.instance.supprimerSondage(params[:id])\n (supprimer) ? (render json: true, status: :ok) : (render json: false, status: :not_found)\nend",
"def destroy\n @antecedente = Antecedente.find(params[:id])\n @antecedente.destroy\n\n respond_to do |format|\n format.html { redirect_to antecedentes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @immigrant = Immigrant.find(params[:id])\n @immigrant.destroy\n\n respond_to do |format|\n format.html { redirect_to immigrants_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @agency.update_attribute(:status, 'N')\n respond_to do |format|\n format.html { redirect_to agencies_url, notice: 'Agency was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @demanda = Demanda.find(params[:id])\n @demanda.destroy\n\n respond_to do |format|\n if params[:tipo_demanda] == '1'\n format.html { redirect_to \"/consultas/list/1\" }\n format.json { render :json => @demandas }\n elsif params[:tipo_demanda] == '2'\n format.html { redirect_to \"/consultas/list/2\" }\n format.json { render :json => @demandas }\n else\n format.html { redirect_to \"/consultas/list/3\" }\n format.json { render :json => @demandas }\n end\n end\n end",
"def destroy\n @solicitud.destroy\n respond_to do |format|\n format.html { redirect_to solicitudes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if not check_logged_in then\n return\n end\n @personal_plant = PersonalPlant.find(params[:id])\n @personal_plant.destroy\n\n respond_to do |format|\n format.html { redirect_to personal_plants_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consultationcharge = Consultationcharge.find(params[:id])\n @consultationcharge.destroy\n\n respond_to do |format|\n format.html { redirect_to(consultationcharges_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vacancy.destroy\n respond_to do |format|\n format.html { redirect_to vacancies_url, notice: 'Вакансия удалена.' }\n format.json { head :no_content }\n end\n end",
"def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end",
"def destroy\n if @diet.destroy\n head :no_content, status: 200\n else\n render json: @diet.errors, status: 405\n end\n end",
"def destroy\n @dept_supervisor = DeptSupervisor.find(params[:id])\n @dept_supervisor.destroy\n\n respond_to do |format|\n format.html { redirect_to dept_supervisors_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @restaturant.destroy\n respond_to do |format|\n format.html { redirect_to restaturants_url, notice: \"Restaturant was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n @uuid = params[:uuid]\n respond_to do |format|\n format.html { redirect_to :controller => 'ads', :action => 'admin_dash', :id => 1, :uuid => @uuid }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tangent.destroy\n respond_to do |format|\n format.html { redirect_to tangents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @agency.destroy\n respond_to do |format|\n format.html { redirect_to agencies_url, notice: \"Agency was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dessert.destroy\n respond_to do |format|\n format.html { redirect_to desserts_url, notice: 'Dessert was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vacancy.destroy\n respond_to do |format|\n format.html { redirect_to vacancies_url, notice: 'Vacante eliminada correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hospital = Hospital.find(params[:id])\n @hospital.destroy\n\n respond_to do |format|\n format.html { redirect_to hospitals_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @optin_contestant = OptinContestant.find(params[:id])\n @optin_contestant.destroy\n\n respond_to do |format|\n format.html { redirect_to optin_contestants_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @design_dissertation = DesignDissertation.find(params[:id])\r\n @design_dissertation.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to design_dissertations_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @detalle = Detalle.find(params[:id])\n @detalle.destroy\n\n respond_to do |format|\n format.html { redirect_to detalles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exalt = Exalt.find(params[:id])\n @exalt.destroy\n\n respond_to do |format|\n format.html { redirect_to exalts_url }\n format.json { head :ok }\n end\n end",
"def maintenance_delete(statuspage_id, maintenance_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['maintenance_id'] = maintenance_id\n\n request :method => :post,\n :url => @url + 'maintenance/delete',\n :payload => data\n end",
"def destroy\n @direcciont.destroy\n respond_to do |format|\n format.html { redirect_to direccionts_url, notice: 'Direcciont was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @colony_ant.destroy\n respond_to do |format|\n format.html { redirect_to colony_ants_url, notice: 'Colony ant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @accountant.destroy\n respond_to do |format|\n format.html { redirect_to accountants_url, notice: 'Accountant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n super \"/templates/#{template_id}.json\", {}\n end",
"def destroy\n @supervisor_estagio = SupervisorEstagio.find(params[:id])\n @supervisor_estagio.destroy\n\n respond_to do |format|\n format.html { redirect_to(supervisor_estagios_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tipo_plan.destroy\n respond_to do |format|\n msg = { :status => \"ok\", :message => \"Eliminado!\" }\n format.json { render :json => msg }\n end\n end",
"def destroy\n @direct_deposit.destroy\n respond_to do |format|\n format.html { redirect_to admin_employee_path(@employee), notice: 'Direct deposit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @talent = Talent.find(params[:id])\n @talent.destroy\n\n respond_to do |format|\n format.html { redirect_to talents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @datos_personal.destroy\n respond_to do |format|\n format.html { redirect_to datos_personals_url, notice: 'Datos personal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reprogramacion = Reprogramacion.find(params[:id])\n @reprogramacion.destroy\n\n respond_to do |format|\n format.html { redirect_to reprogramaciones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @talent = Talent.find(params[:id])\n @talent.destroy\n\n respond_to do |format|\n format.html { redirect_to talents_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @client_sex = ClientSex.find(params[:id])\n @client_sex.destroy\n\n respond_to do |format|\n format.html { redirect_to client_sexes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @consulta = Consulta.find(params[:id])\n @consulta.destroy\n flash[:notice] = 'Consulta removida com sucesso.'\n\n redirect_to(consultas_url)\n end",
"def destroy\n @datos_insumos_reactivo.destroy\n respond_to do |format|\n format.html { redirect_to datos_insumos_reactivos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n respond_to do |format|\n format.html { redirect_to respuestas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @diciplina = Diciplina.find(params[:id])\n @diciplina.destroy\n\n respond_to do |format|\n format.html { redirect_to diciplinas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n# redirect_to activacionclientets_path # ted esto para evitar que borren por la web. ok. Que valla al index. provisional ok.\n \n #@activacionclientet.destroy\n respond_to do |format|\n format.html { redirect_to activacionclientets_url, notice: 'Activacionclientes no se puede eliminar por esta via. Contacte el administrador.' } # ted esto para evitar que borren por la web\n format.json { head :no_content }\n end\n end",
"def destroy \n @franchise = @franchise_set.franchises.find(params[:id])\n @franchise.destroy\n\n # respond_to do |format| \n # format.html { redirect_to \"/franchise_sets/#{franchise_set.id}/edit\" }\n # format.json { head :ok }\n # end\n \n respond_to do |format|\n format.json {head :ok}\n end\n \n end",
"def destroy\n @fulcliente = Fulcliente.find(params[:id])\n @fulcliente.destroy\n\n respond_to do |format|\n format.html { redirect_to fulclientes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @examination.destroy\n\n respond_to do |format|\n format.html { redirect_to @examination.project }\n format.json { head :no_content }\n end\n end",
"def destroy\n @database = Database.find(params[:id])\n path = @database.path\n delete = %x[rm -R #{path}]\n @database.destroy\n\n respond_to do |format|\n format.html { redirect_to databases_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy_old_dress\n redirect_unless_privilege('Vestidos')\n \n @dress = Dress.find(params[:id])\n @dress.destroy\n\n respond_to do |format|\n format.html { redirect_to administration_old_dresses_path }\n format.json { head :ok }\n end\n end"
] |
[
"0.7340677",
"0.72465384",
"0.72465384",
"0.7235835",
"0.7078425",
"0.70709074",
"0.7062798",
"0.70406264",
"0.7026597",
"0.70027065",
"0.6966685",
"0.6952975",
"0.6922758",
"0.68865496",
"0.68865496",
"0.6855391",
"0.6803215",
"0.6789495",
"0.67832017",
"0.6754852",
"0.67259604",
"0.6724071",
"0.66745126",
"0.6657347",
"0.66194063",
"0.66182446",
"0.6602751",
"0.65817547",
"0.65788317",
"0.65783167",
"0.65536255",
"0.65414655",
"0.65214455",
"0.651205",
"0.6500537",
"0.64975846",
"0.6490945",
"0.64903337",
"0.6473151",
"0.64694875",
"0.64605683",
"0.64593476",
"0.6450808",
"0.6429177",
"0.642829",
"0.6426526",
"0.64235425",
"0.6420701",
"0.6411328",
"0.6410496",
"0.64073056",
"0.64072853",
"0.640691",
"0.6398912",
"0.6398456",
"0.63977784",
"0.6397372",
"0.63931066",
"0.63923573",
"0.63886124",
"0.6387805",
"0.6387667",
"0.63801754",
"0.6377908",
"0.63763165",
"0.6376234",
"0.6376101",
"0.6374326",
"0.63690305",
"0.6366864",
"0.63663924",
"0.6364869",
"0.63630456",
"0.6356956",
"0.6356175",
"0.63555104",
"0.63474816",
"0.63474435",
"0.63457215",
"0.6342199",
"0.6338688",
"0.63374513",
"0.6332587",
"0.63304794",
"0.63302344",
"0.63296795",
"0.63281924",
"0.6326972",
"0.6322728",
"0.6322161",
"0.63210374",
"0.6320673",
"0.631877",
"0.6317266",
"0.631621",
"0.6313794",
"0.6311799",
"0.6311552",
"0.63040286",
"0.6303419",
"0.6302096"
] |
0.0
|
-1
|
Use callbacks to share common setup or constraints between actions.
|
def set_consultant
@consultant = Consultant.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_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"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.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def consultant_params
params.require(:consultant).permit(
:name,
:department_id,
:department,
:short_name,
:institution_type,
:capital,
:person_in_charge_name,
:is_qualified_3rd_party_institution,
:company_address,
:department_attributes => [
:name,
: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 end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"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.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
Loading in the whole sections association could be expensive if there were a lot of records, but I'm not expecting that to be an issue in this case. If it is, we can address it later. But think about it if I make a general form object based on this one.
|
def initialize(gym = nil)
@gym = gym || Gym.new
@sections = @gym.sections.to_a
if @sections.empty?
@sections << Section.new
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def _section_fields\n {\n 'article' => ['r:Title', 'o:Author', 'o:DOI'],\n 'journal' => ['r:Title', 'o:ISSN', 'r:Volume', 'o:Issue', 'r:Year', 'r:Pages'],\n 'host' => ['o:Title', 'o:ISSN or ISBN', 'o:Volume', 'o:Issue', 'r:Year', 'o:Pages'],\n 'auto-cancel' => ['o:Automatic cancellation'],\n 'notes' => ['o:Notes'],\n 'conference' => ['r:Title', 'o:Location', 'r:Year', 'o:ISSN or ISBN', 'r:Pages'],\n 'book' => ['r:Title', 'o:Author', 'o:Edition', 'o:DOI', 'o:ISBN', 'r:Year', 'o:Publisher'],\n 'thesis' => ['r:Title', 'r:Author', 'o:Affiliation', 'o:Publisher', 'o:Type', 'r:Year', 'o:Pages'],\n 'report' => ['r:Title', 'o:Author', 'o:Publisher', 'o:DOI', 'o:Report Number'],\n 'standard' => ['r:Title', 'o:Subtitle', 'o:Publisher', 'o:DOI', 'o:Standard Number', 'o:ISBN', 'r:Year', 'o:Pages'],\n 'patent' => ['r:Title', 'o:Inventor', 'o:Patent Number', 'r:Year', 'o:Country'],\n 'other' => ['r:Title', 'o:Author', 'o:Publisher', 'o:DOI']\n }\nend",
"def set_form_section\n @form_section = FormSection.unscoped.find(params[:id])\n end",
"def set_section\n @section = @form.sections.find(params[:id])\n end",
"def set_form_section\n @form_section = ::FormSection.in_account(current_user.account.id).find(params[:section_id])\n end",
"def get_single_submission_sections(section_id,assignment_id,user_id,include,opts={})\n query_param_keys = [\n :include\n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"section_id is required\" if section_id.nil?\n raise \"assignment_id is required\" if assignment_id.nil?\n raise \"user_id is required\" if user_id.nil?\n raise \"include is required\" if include.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :section_id => section_id,\n :assignment_id => assignment_id,\n :user_id => user_id,\n :include => include\n )\n\n # resource path\n path = path_replace(\"/v1/sections/{section_id}/assignments/{assignment_id}/submissions/{user_id}\",\n :section_id => section_id,\n :assignment_id => assignment_id,\n :user_id => user_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response\n \n end",
"def section_params\n params.require(:section)\n end",
"def section_by_id(section_id); end",
"def sections\n @sections ||= @account.sections\n end",
"def sections\n respond_with @page.sections\n end",
"def sections\n respond_with @page.sections\n end",
"def flatten_course_sections_expand section_coll, courses\n # flatten sections\n section_ids = []\n courses.each do |course|\n course['sections'] = flatten_sections course['sections']\n section_ids.concat course['sections']\n end\n\n # expand sections if ?expand=sections\n if params[:expand] == 'sections'\n sections = find_sections section_coll, section_ids\n sections = [sections] if not sections.kind_of?(Array) # hacky, maybe modify find_sections?\n\n # map sections to course hash & replace section data\n if not sections.empty?\n course_sections = sections.group_by { |e| e['course'] }\n courses.each { |course| course['sections'] = course_sections[course['course_id']] }\n end\n end\n\n return courses\n end",
"def section_params\n params.fetch(:section, {}).permit( :id, :page_id, :position, :title, :desc, :status, :_destroy,\n carousels_attributes: [:id, :section_id, :slide_priority, :slide_image, :slide_title, :slide_desc, :slide_video, :video_url, :status, :_destroy],\n texts_attributes: [:id, :section_id, :priority, :title, :body, :status, :_destroy],\n accordions_attributes: [:id, :section_id, :priority, :title, :desc, :status, :_destroy],\n galleries_attributes: [:id, :section_id, :priority, :title, :img_alt, :image, :status, :_destroy],\n iconboxes_attributes: [:id, :section_id, :priority, :icon, :title, :desc, :status, :_destroy],\n imageboxes_attributes: [:id, :section_id, :priority, :image, :title, :desc, :url, :target, :layout, :status, :_destroy],\n listgroups_attributes: [:id, :section_id, :priority, :title, :desc, :status, :_destroy],\n videos_attributes: [:id, :section_id, :position, :title, :url, :video_file , :status, :_destroy],\n timelines_attributes: [:id, :section_id, :event_date, :event_title, :event_content, :status, :_destroy],\n fullslides_attributes: [:id, :section_id, :priority, :image, :title, :desc, :url, :status, :_destroy]\n #profiles_attributes: [:id, :section_id, :priority, :user_id, :title, :desc, :url, :status, :_destroy]\n )\n end",
"def subsections\n Section.where(parent_id: id)\n end",
"def sections\n account.accessible_sections if account\n end",
"def set_divisions_and_sections\n @division = current_user.section.division\n @sections = @division.sections.order(\"number\")\n end",
"def set_sections\n @sections = Section.find_ordered_parents\n end",
"def section_params\n params.fetch(:section, {})\n end",
"def render_form_section(step_number)\n render :partial => form_section_partial(step_number)\n end",
"def load_section!\n if @extra_page\n @section = current_cookbook.sections.find @extra_page.section_id\n else\n @section = current_cookbook.sections.find params[:section_id]\n end\n end",
"def form_section_params\n params.require(:form_section).permit( :name, :form_section_id, :order )\n end",
"def load_sections(solution_to_load = nil, show_previews = false)\n\n user = User.find session[:user]\n plan = user.semesters.find(params[:id]).course_plan\n semester = Semester.find(params[:id]);\n courses = semester.cis_courses\n\n if solution_to_load\n plan.cis_sections.delete plan.cis_sections\n plan.cis_sections.concat session[:solution][solution_to_load]\n end\n\n # previews stuff\n npreviews = 6\n @solutions = session[:solution]\n\n @total_width = 100\n @total_height = 100\n padding_horiz = 5\n padding_vert = 5\n ndays = 6\n nhours = 15\n @start_hour = 8\n\n @seconds_per_pixel = nhours * 60 * 60 / (@total_height - 2 * padding_vert)\n\n @width = (@total_width - 2 * padding_horiz)/ ndays\n\n @day_left = {\n 'M' => 0,\n 'T' => @width,\n 'W' => @width * 2,\n 'R' => @width * 3,\n 'F' => @width * 4,\n 'S' => @width * 5,\n }\n\n if !session[:generator_error] && (!session[:solution] || session[:solution].length == 0)\n session[:generator_error] = 'No possible schedules (Click here to close).'\n end\n\n render :update do |page|\n if solution_to_load\n page.replace_html 'times_row', :partial => 'times_row', :locals => {:semester => semester}\n courses.each do |course|\n if course.sections_for_semester(semester) && course.sections_for_semester(semester).length != 0\n page.replace_html \"sects_#{semester.id}_#{course.id}\", :partial => 'section_choice', :collection => course.sections_for_semester(semester), :locals => {:semester => semester}\n end\n end\n else\n if session[:generator_error]\n page.replace_html 'generator_error', session[:generator_error]\n else\n page.replace_html 'previews_list', :partial => 'solution', :collection => @solutions[session[:marker], npreviews]\n end\n end\n if show_previews\n page.visual_effect :toggle_blind, 'previews_window'\n end\n end\n end",
"def sections\n temp_sections = []\n if @section_ids.count > 0\n @section_ids.each do |section_id|\n temp_sections.push @client.section(@org_id, section_id)\n end\n end\n return temp_sections\n end",
"def show\n @sections = @course.sections.all.to_a\n end",
"def section_params\n params.require(:section).permit(:name, :semester, :schedule, :teacher_id, :subject_id, teaching_loads_attributes: [:teacher_id, :subject_id])\n end",
"def section\n BSection.store[@section_id]\n end",
"def section_params\n params.require(:section).permit(:name, :description, :location_id, :interior_map)\n end",
"def section_list_for record\n tags_for_context_and_taggable(context: :sections, taggable: record)\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def sections\n @sections.values\n end",
"def section_params\n params.require(:section).permit(:course_id, :year_id, :term_id, :block_id)\n end",
"def section_params\n params.require(:section).permit(:id, :form_wrapper_id, :title_en, :title_es, :title_fr, :title_pt, :description_en, :description_es, :description_fr, :description_pt, :sort_index)\n end",
"def initialize\n @sections = {}\n end",
"def sections\n @pages.collect { |p| p.sections }.flatten\n end",
"def set_section\n @course = Course.find(params[:course_id])\n @section = @course.sections.find(params[:section_id])\n end",
"def section_params\n params.require(:section).permit(:name, questions_attributes: [:content, :cans, answers_attributes: [:content]])\n end",
"def add_section_params\n sections = Section.where(:section_piece_id=>self.section_piece_id)\n for section in sections\n section.section_params.create do|section_param|\n section_param.section_root_id = section.root_id\n section_param.section_piece_param_id = self.id\n end\n end\n end",
"def section_params\n params.require(:section).permit(:title, :content, :description, :status_id, :visibility_id, :document_id, :order,\n display_format:[:suppress_collapse, :collapse_default])\n end",
"def add_section(fields={})\n section_data = fields.merge({\n :suite_id => data.id,\n })\n return add_entity(Section, data.project_id, section_data)\n end",
"def update\n # Find new object using form params\n @section = Section.find(params[:id])\n # Update object\n if @section.update_attributes(section_params) #use private method below to get permited data for mass assignment\n # If successful, redirect to show action\n flash[:notice] = \"Section updated successfully.\"\n redirect_to(section_path(@section, :page_id => @page.id))\n else\n # Else, redisplay form so user can fix problems\n render('edit') # renders form template with original pre-populated\n end\n end",
"def section_params\n params.require(:section).permit(:title, :previous_id, :next_id, :course_id)\n end",
"def forms_fields(form, action)\n section_fields = []\n form.form_sections.each do |section|\n if section['permissions'][\"#{current_user.role.short_name}\"][action] == '1'\n section_fields << section.section_fields.map do |field|\n if field.field_type.field_type.start_with?('select') && field.field_type.options['multivalue'] == '1'\n { field.id.to_s.to_sym => [] }\n else\n field.id.to_s.to_sym\n end\n end\n end\n end\n section_fields\n end",
"def merge_params(params)\n params = form_params(params)\n self.each do |section|\n if params.key?(section.key)\n section.merge_params(params[section.key])\n end\n end\n end",
"def index\n #@sections = Section.find(params[:course_id])\n #@sections = Section.all\n end",
"def section(section_name, parent_id = nil)\n html = \"\"\n parent_id = get_parent_id(parent_id)\n objects_to_render = {}\n Base.where(:'connections.parent_id' => parent_id, :'connections.section' => section_name, :'connections.file'.ne => nil).each do |record|\n connection = record.connections.where(:parent_id => parent_id, :section => section_name, :file.ne => nil).first\n\n if objects_to_render[connection.order_id] == nil\n number = connection.order_id\n else\n number = get_unique_number(objects_to_render, connection.order_id)\n end\n objects_to_render[number] = {:record => record, :connection => connection}\n end\n Hash[objects_to_render.sort].each do |k, object|\n html += show object[:connection].file, {views: [\"app/views/#{object[:record]._type}\", \"app/views/#{object[:record]._type.downcase}\"]}, {record: object[:record]}\n end\n return html\n end",
"def set_section_p\n @section = Section.find(params[:section_id])\n end",
"def nested_forms\n []\n end",
"def new\n params_hash = {institution_id: params[:institution_id],\n center_id: params[:center_id],\n academic_class_id: params[:academic_class_id]}\n @section = Section.new(params_hash)\n @section.build_profile\n @section.build_build_info\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @section }\n end\n end",
"def set_section\n @section = Section.friendly.find(params[:id])\n end",
"def section_params\n params.require(:section).permit(:name)\n end",
"def show\n @section = Section.find(params[:id]) \t\n @nav_sections = Section.where(scenario_id: @section.scenario_id).order(:order)\n @inquests = Inquest.where(section_id: params[:id]).order(:order)\n @scenario = Scenario.where(id: @section.scenario_id)[0]\n end",
"def show\n @sections = Section.find(params[:id])\n end",
"def index\n @form_sections = FormSection.all\n respond_with( @form_sections )\n end",
"def create\n # Instantiate new object using form params\n @section = Section.new(section_params) #use private method below to get permited data for mass assignment\n @section.page = @page\n # Save object\n if @section.save\n # If successful, redirect to index action\n flash[:notice] = \"Section created successfully.\"\n redirect_to(sections_path(:page_id => @page.id))\n else\n # Else, redisplay form so user can fix problems\n render('new') # renders form template with original user data pre-populated\n end\n end",
"def process_sections\n @tag_selection.attributes = {'section_ids' => []}.merge(params[:tag_selection] || {})\n end",
"def find_section\n Section.joins(course: :department).where({\n number: @row.number,\n term: @row.term,\n 'departments.subject_code': @department.subject_code,\n 'courses.course_number': @course.course_number,\n }).first\n end",
"def sectionalization_params\n params.require(:sectionalization).permit(:user_id, :classroom_id, :name, :deleted_at)\n end",
"def section_params\n params.require(:section).permit(:name, :menu_id)\n end",
"def section_params\n params.require(:section).permit(:name, :description, :slug, :parent_id, :rank)\n end",
"def load_associated_collections\n array = association_fields\n\n if array.map{|f| f.collection_loaded?}.include?(false)\n StorageRoom.log(\"Fetching associated collections for '#{name}'\")\n array.each{|f| f.collection}\n end\n end",
"def section_params\n params.require(:section).permit(:name, :description)\n end",
"def create\n @section = Section.new(section_params)\n @section.title = @section.title || \"\"\n\n document = @section.document\n @section.order = 1\n unless document.sections.blank?\n @section.order = document.sections.last.order + 1\n end\n\n @section.visibility = document.visibility\n @section.status = document.status\n\n update_user_attribution @section, true\n\n respond_to do |format|\n if @section.save\n format.html { redirect_to @section, notice: 'Section was successfully created.' }\n format.any(:json, :js) { render :show, status: :created, location: @section }\n else\n puts @section.errors.full_messages\n format.html { render :new }\n format.any(:json, :js) { render json: @section.errors, status: :unprocessable_entity }\n end\n end\n end",
"def read_drg_cms_form\r\n table_name = decamelize_type(params[:table].strip)\r\n @tables = table_name.split(';').inject([]) { |r,v| r << [v.classify.constantize, v] }\r\n# split ids passed when embedded document\r\n ids = params[:ids].to_s.strip.downcase\r\n @ids = ids.split(';').inject([]) { |r,v| r << v }\r\n# formname defaults to last table specified\r\n formname = params[:formname] || @tables.last[1]\r\n @form = YAML.load_file( dc_find_form_file(formname) )\r\n# when form extends another form file. \r\n if @form['extend']\r\n form = YAML.load_file( dc_find_form_file(@form['extend']) )\r\n @form = forms_merge(form, @form)\r\n end\r\n# add readonly key to form if readonly parameter is passed in url\r\n @form['readonly'] = 1 if params['readonly'] #and %w(1 yes true).include?(params['readonly'].to_s.downcase.strip)\r\n# !!!!!! Always use strings for key names since @parms['table'] != @parms[:table]\r\n @parms = { 'table' => table_name, 'ids' => params[:ids], 'formname' => formname,\r\n 'return_to' => params['return_to'], 'edit_only' => params['edit_only'],\r\n 'readonly' => params['readonly'] \r\n }\r\nend",
"def unique_section_object(key, container)\n Object.const_set(\"EDSLSpecSection#{key}\", Class.new(EDSL::PageObject::Section)).new(container)\nend",
"def set_page_section\n @page_section = PageSection.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def section_params\n params.require(:section).permit(:start_date, :end_date, :meeting_scheme, :meeting_time, :section_hours, :course_id)\n end",
"def set_section\n @section = Section.find(params[:id])\n end",
"def user_section_params\n params.require(:user_section).permit(:user_id, :section_id)\n end",
"def sections\n return @sections\n end",
"def sections=(value)\n @sections = value\n end",
"def show_edit_form\n section = Section.find(params[:\"section_id\"])\n authorize section\n\n form = Section::Form.new(section)\n form.offsets = section.token_offsets\n render js: concept(\"section/section_form_cell\", form, current_user: current_user, display_type: params[:display_type]).(:show_edit_form)\n end",
"def form_fields\n @item_fields = @model.typus_fields_for('form')\n @item_has_many = @model.typus_relationships_for('has_many')\n @item_has_and_belongs_to_many = @model.typus_relationships_for('has_and_belongs_to_many')\n end",
"def section_params\n params.require(:section).permit(:section,{:grade_ids => []})\n end",
"def section=(section)\n self[:section] = section\n end",
"def list_sections\n \n end",
"def section_params\n params.fetch(:section, {}).permit(:name, :eng, :jpn)\n end",
"def process_section(layout, section_options, parent_section_options, use_parent_title, object_index: nil)\n # for table and object types get the list of objects\n # skip if there are none\n if %i[object table].include?(section_options[:type])\n objects = make_sure_array(send(section_options[:code]))\n\n return [] if objects.nil? || objects.count < 1 # we need to return an empty array not nil\n end\n\n if %i[list table].include?(section_options[:type])\n # always return an array so wrap this in an array\n parent_section_options[:use_parent_title] = use_parent_title unless parent_section_options.nil?\n [SectionData.new(self, section_options, objects, parent_section_options, object_index: object_index)]\n else # object\n process_objects_section(replace_section_name(section_options), layout, objects)\n end\n end",
"def add_new_section\n @section = Section.new\n end",
"def create\n @section = Section.new(params[:section])\n\n Course.find(params[:section][:add_section]).sections << @section if params[:section][:add_section]\n\n respond_to do |format|\n if @section.save\n format.html { redirect_to @section, notice: 'Section was successfully created.' }\n format.json { render json: @section, status: :created, location: @section }\n else\n format.html { render action: \"new\" }\n format.json { render json: @section.errors, status: :unprocessable_entity }\n end\n end\n end",
"def section_dyn_vals\n\t\tname_like = params[:q]\n\t\ttype = params[:type]\n\n\t\tsection = Section.find(params[:section_id])\n\t\tif type.eql?('subjects')\n\t\t\t@objects = Subject.by_section(section.id)\n\t\telsif type.eql?('tests')\n\t\t\t@objects = Test.by_section(section.id)\n\t\telsif type.eql?('students')\t\t\t\n\t\t\t@objects = Student.by_section(section.id).name_like(\"%#{params[:q]}%\")\t\t\t\n\t\t\t#Student.where(\"section_id =? and name like ?\", section.id, \"%#{params[:q]}%\")\n\t\tend\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render :json => @objects.map(&:attributes) }\n\t\tend\t\n\tend",
"def sections\n @section_ids.collect { |idx| BSection.store[idx] }\n end",
"def index\n @sections = case current_user.rc\n when 'EA'\n Section.includes(:profile).order('profiles.firstname').page(params[:page])\n when 'IA','EO'\n current_user.sections.includes(:profile).order('profiles.firstname').page(params[:page])\n when 'MOE'\n current_user.sections.includes(:profile).order('profiles.firstname').page(params[:page])\n when 'CR'\n current_user.sections.includes(:profile).order('profiles.firstname').page(params[:page])\n when 'ET'\n current_user.center.sections.includes(:profile).order('profiles.firstname').page(params[:page])\n end\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sections }\n end\n end"
] |
[
"0.63628656",
"0.6341061",
"0.6259934",
"0.6041568",
"0.5989928",
"0.58925945",
"0.5811854",
"0.58063555",
"0.5792181",
"0.5792181",
"0.5771394",
"0.57219064",
"0.5715661",
"0.57023704",
"0.56941557",
"0.56915575",
"0.5685478",
"0.5669038",
"0.5662726",
"0.56544596",
"0.5621574",
"0.56163275",
"0.5587298",
"0.55675805",
"0.55583805",
"0.5547051",
"0.55461997",
"0.5532182",
"0.5532182",
"0.55036485",
"0.55018204",
"0.5469052",
"0.5443265",
"0.5437178",
"0.54367846",
"0.5421275",
"0.5418631",
"0.54181796",
"0.54113644",
"0.53962445",
"0.53882426",
"0.5386545",
"0.53781813",
"0.53724766",
"0.5358669",
"0.53555244",
"0.53274864",
"0.5323514",
"0.5317941",
"0.53116065",
"0.52971625",
"0.5294846",
"0.5293757",
"0.52909726",
"0.5290818",
"0.5285788",
"0.5284429",
"0.527882",
"0.52780074",
"0.52756494",
"0.52705497",
"0.5257251",
"0.52511764",
"0.5241457",
"0.5234692",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52262646",
"0.52260554",
"0.5225658",
"0.52234715",
"0.5223285",
"0.52215636",
"0.52160084",
"0.52159655",
"0.5210072",
"0.5201444",
"0.52000725",
"0.5198758",
"0.5193704",
"0.5176759",
"0.5172354",
"0.5161054",
"0.5155996",
"0.5149767"
] |
0.0
|
-1
|
NOTE: We call redirect_params AFTER super in these methods intentionally the OAuth2 strategy uses the authorize_params and token_params methods to set up some state for testing that we need in redirect_params
|
def authorize_params
params = super
params = params.merge(request_params) unless OmniAuth.config.test_mode
redirect_params.merge(params)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def authorize_params\n super.tap do |params|\n %w(scope team redirect_uri).each do |v|\n if !request.params[v].to_s.empty?\n params[v.to_sym] = request.params[v]\n end\n end\n log(:debug, \"Authorize_params #{params.to_h}\")\n end\n end",
"def authorize_params\n super.tap do |params|\n provider = session['omniauth.params'].delete('provider') rescue nil\n params[:provider] = provider if provider\n\n service = session['omniauth.params'].delete('service') rescue nil\n params[:service] = service if service\n\n context = session['omniauth.params'].delete('context') rescue nil\n params[:context] = context if context\n end\n end",
"def authorize\n params[:access_token] ||= params[:oauth_token]\n super\n end",
"def authorize_params\n super.tap do |params|\n %w[ state ].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n\n # to support omniauth-oauth2's auto csrf protection\n session['omniauth.state'] = params[:state] if v == 'state'\n end\n end\n end\n end",
"def authorize_params\n\n # Trick shamelessly borrowed from the omniauth-facebook gem!\n super.tap do |params|\n %w[scope].each { |v| params[v.to_sym] = request.params[v] if request.params[v] }\n params[:scope] ||= DEFAULT_SCOPE # ensure that we're always request *some* default scope\n end\n end",
"def authorize_params\n super.tap do |params|\n %w[auth_type display revoke scope state].each do |v|\n next unless request.params[v]\n params[v.to_sym] = request.params[v]\n\n session[\"omniauth.state\"] = params[:state] if v == \"state\"\n # to support omniauth-oauth2’s auto csrf protection\n end\n\n params[:scope] ||= DEFAULT_SCOPE\n end\n end",
"def authorize_params\n if !OmniAuth.config.test_mode\n options.authorize_params[:state] = generate_jwt_state(request.params)\n # Remove querystring params as only `state` is allowed.\n request.params.clear\n end\n params = options.authorize_params.merge(options_for(\"authorize\"))\n if OmniAuth.config.test_mode\n @env ||= {}\n @env[\"rack.session\"] ||= {}\n end\n session[\"omniauth.state\"] = params[:state]\n redirect_params.merge(params)\n end",
"def redirect_callbacks\n setup_env_params\n\n session['dta.omniauth.auth'] = request.env['omniauth.auth']\n .except('extra')\n session['dta.omniauth.params'] = omniauth_params\n tweak_session_attrs\n has_params = session['dta.omniauth.params']\n\n redirect_to action: has_params ? 'omniauth_success' : 'omniauth_failure'\n end",
"def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n\n params[:scope] ||= DEFAULT_SCOPE\n params[:approval_prompt] ||= 'force'\n end\n end",
"def authorize_url\n # Fix: replace default oauth2 options, specially to prevent the Faraday gem which\n # concatenates with \"/\", removing the Facebook api version\n options = {\n site: File.join(@site, api_version.to_s),\n authorize_url: File.join(@auth_site, api_version.to_s, auth_path),\n token_url: token_url\n }\n\n @scope = access_permissions.present? ? access_permissions.join(',') : scope\n super(options)\n end",
"def authorize_params\n super.tap do |params|\n options[:authorize_options].each do |k|\n params[k] = request.params[k.to_s] unless [nil, ''].include?(request.params[k.to_s])\n end\n end\n end",
"def authorize_params\n # Only set state if it hasn't already been set\n options.authorize_params[:state] ||= SecureRandom.hex(24)\n params = options.authorize_params.merge(options_for(\"authorize\"))\n if OmniAuth.config.test_mode\n @env ||= {}\n @env[\"rack.session\"] ||= {}\n end\n params\n end",
"def authorize_params\n options.authorize_params[:state] = SecureRandom.hex(24) + '|' + Base64.strict_encode64(request.params.to_param)\n params = options.authorize_params.merge(options_for(\"authorize\"))\n if OmniAuth.config.test_mode\n @env ||= {}\n @env[\"rack.session\"] ||= {}\n end\n session[\"omniauth.state\"] = params[:state]\n params\n end",
"def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"def authorize_url(params = {})\n super\n .tap { |result| __ext_debug(\"--> #{result.inspect}\") }\n end",
"def authorize\n if params[:redirect_path].present?\n session[:redirect_path] = params[:redirect_path]\n end\n\n # Certain providers require options to be selected\n if !params[:perform] && app_instance.app && PROVIDERS_WITH_OPTIONS.include?(app_instance.app.nid.to_s)\n render \"mno_enterprise/webhook/o_auth/providers/#{app_instance.app.nid}\"\n return\n end\n\n @redirect_to = MnoEnterprise.router.authorize_oauth_url(params[:id], extra_params.merge(wtk: wtk))\n end",
"def oauth_params\n @oauth_params ||= request.env[\"omniauth.auth\"]\n end",
"def authorize_callback\n @request_token = OAuth::RequestToken.new(@oauth,\n session[:request_token], \n session[:request_token_secret])\n\n @access_token = @request_token.get_access_token(:oauth_verifier => params[:oauth_verifier])\n session[:access_token] = @access_token.token\n session[:secret_token] = @access_token.secret\n session[:user_id] = @access_token.params[\"user_id\"] rescue \"\"\n session[:screen_name] = @access_token.params[\"screen_name\"] rescue \"\"\n session[:authorized] = true\n @log.info \"authorized, user [#{session[:screen_name]}]\"\n \n if session[:redirect_to]\n url = session[:redirect_to]\n session[:redirect_to] = nil \n redirect url\n else\n redirect '/'\n end\n\n end",
"def callback_phase\n options.client_options[:access_token_path] = \"/oauth/qzoneoauth_access_token?oauth_vericode=#{request['oauth_vericode'] }\" if request['oauth_vericode']\n super\n end",
"def redirect_from_params\n if params[:redirect_to]\n redirect_to params[:redirect_to]\n end\n end",
"def gocardless_redirect_params\n {\n params: {\n description: 'Demo GoCardless',\n session_token: \"#{current_user.id}\",\n success_redirect_url: \"#{root_url}/confirm_mandate\",\n prefilled_customer: {\n email: \"#{current_user.email}\"\n }\n }\n }\n end",
"def redirect_params\n params.require(:redirect).permit(:source, :redirect, :expiration, :status)\n end",
"def callback_phase\n error = request.params['error_reason'] || request.params['error']\n fail(OAuthError, error) if error\n @session_state = request.params['session_state']\n @id_token = request.params['id_token']\n @code = request.params['code']\n @claims, @header = validate_and_parse_id_token(@id_token)\n # validate_chash(@code, @claims, @header)\n super\n end",
"def oauth\n session[:return_to_url] = params[:redirect_after_login] if params[:redirect_after_login]\n login_at(auth_params[:provider])\n end",
"def redirect_params options = {}\n options[:mode] = @mode\n options\n end",
"def callback_phase # rubocop:disable AbcSize, CyclomaticComplexity, MethodLength, PerceivedComplexity\n super\n @env['omniauth.params'] = decode_jwt_state(session['omniauth.state'])\n end",
"def oauth_authentication; end",
"def request_phase\n redirect authorize_endpoint_url\n end",
"def oauth_authorize\n redirect_to facebook_client.authorize(oauth_callback_url)\n end",
"def redirect_original(request, state_params, site)\n response = Rack::Response.new\n # Note that app_callback_url is added by OmniAuth.config.before_request_phase\n # any value provided by a client will be overwritten in that method so that we\n # don't use/trust values sent by the client\n return_url = state_params[\"app_callback_url\"]\n query = OauthStateMiddleware.query_string(request.params, SecureRandom.hex(64))\n return_url << \"?\"\n return_url << signed_query_string(query, site.secret)\n response.redirect return_url\n response.finish\n end",
"def facebook\n oauth_info = OauthToken.get_oauth_info('facebook')\n session[:redirect_after_oauth] = params[:redirect_to] ? params[:redirect_to] : nil\n redirect_to \"https://graph.facebook.com/oauth/authorize?client_id=#{oauth_info['consumer_key']}\"+\n \"&redirect_uri=#{oauth_info['callback']}\"+\n \"&scope=read_stream,publish_stream,publish_actions,offline_access,user_likes,user_status,\"+\n \"user_birthday,user_relationships,user_relationship_details,\"+\n \"email,user_checkins,sms,user_online_presence\"+\n \"&display=touch\"\n end",
"def oauth\n redirect_to \"#{root_path}auth/#{Setting['omniauth']['provider']}\"\n end",
"def callback_url\n options.authorize_params.callback_url or super\n end",
"def params_auth_hash; end",
"def multicast_redirect_state\n super\n end",
"def merge_default_redirect_params(redirect_route, extra_params={})\n merged_redirect_url = redirect_route.dup\n extra_params.each do |key, value|\n if value.present?\n if redirect_route.include?('?')\n merged_redirect_url += \"&#{key}=#{value}\"\n else\n merged_redirect_url += \"?#{key}=#{value}\"\n end\n end\n end\n merged_redirect_url\n end",
"def merge_default_redirect_params(redirect_route, extra_params={})\n merged_redirect_url = redirect_route.dup\n extra_params.each do |key, value|\n if value.present?\n if redirect_route.include?('?')\n merged_redirect_url += \"&#{key}=#{value}\"\n else\n merged_redirect_url += \"?#{key}=#{value}\"\n end\n end\n end\n merged_redirect_url\n end",
"def redirect_params\n params.require(:redirect).permit(:code, :event_id, :evidence_id)\n end",
"def authorize\n\n @token = ::RequestToken.find_by_token params[:oauth_token]\n\n unless @token\n render :action=>\"authorize_failure\"\n return\n end\n\n unless @token.invalidated?\n if request.post?\n if params[:authorize] == '1'\n @token.authorize!(current_person)\n if @token.oauth10?\n @redirect_url = params[:oauth_callback] || @token.client_application.callback_url\n else\n @redirect_url = @token.oob? ? @token.client_application.callback_url : @token.callback_url\n end\n\n if @redirect_url\n if @token.oauth10?\n redirect_to \"#{@redirect_url}?oauth_token=#{@token.token}\"\n else\n redirect_to \"#{@redirect_url}?oauth_token=#{@token.token}&oauth_verifier=#{@token.verifier}\"\n end\n else\n render :action => \"authorize_success\"\n end\n elsif params[:authorize] == \"0\"\n @token.invalidate!\n render :action => \"authorize_failure\"\n end\n end\n else\n render :action => \"authorize_failure\"\n end\n end",
"def save(&block)\n block = nil if redirecting_to_oauth2_server?\n super(&block)\n end",
"def request_phase\n p session['omniauth.state']\n OmniAuth::Strategies::Dailycred::AUTH_PARAMS.each do |param|\n val = session['omniauth.params'][param]\n if val && !val.empty?\n options[:authorize_params] ||= {}\n options[:authorize_params].merge!(param => val)\n end\n end\n old_request_phase\n end",
"def redirection_params\n options.slice(:redirect_uri).stringify_keys\n end",
"def merge_set_up_params(params)\n if (!@oauth_token.nil? && !@version.nil?)\n params.merge!(:oauth_token => @oauth_token)\n params.merge(:v => @version)\n end\n end",
"def openid_redirect_uri=(_arg0); end",
"def valid_for_params_auth?; end",
"def authorize\n if session[:dc_access_token].nil? or session[:dc_address_for_token] != session[:dc_address] then\n session[:dc_address_for_token] = session[:dc_address]\n redirect \"#{settings.FQDN}/oauth/authorize?client_id=#{settings.api_key}&scope=DC&redirect_uri=#{settings.redirect_url}\"\n else\n redirect '/getDeviceCapabilities'\n end\nend",
"def auth_at_provider(provider)\n @provider = Config.send(provider)\n if @provider.respond_to?(:get_request_token)\n args = {:request_token => @provider.get_request_token} \n session[:request_token] = args[:request_token]\n end\n redirect_to @provider.authorize_url(args)\n end",
"def grant_authorization\n create_verification_code if authorized?\n redirect_back\n end",
"def callback2\n oauth_token = FitbitOauthToken.where(:token=>params[:state]).last\n verifier = params[:code]\n if oauth_token\n return_url = request.original_url\n #xd = YAML::load oauth_token.extra_data\n # if return_url already has a ? in it, then this needs to add an & and not a ? \n #question_mark_or_ampersand = xd[:return_url].to_s =~ /\\?/ ? '&' : '?'\n question_mark_or_ampersand = return_url.to_s =~ /\\?/ ? '&' : '?'\n #There's a code and a state that need to go with:\n url = \"\"\n url += \"#{return_url.gsub(\"callback2\",\"post_authorize\")}\"\n if !verifier.nil? && !verifier.empty? \n #Only add the token and verifier if we have both\n #This way, the recieving application can respond if they're missing\n url += \"#{question_mark_or_ampersand}\"\n url += \"oauth_token=#{params[:state]}\"\n url += \"&oauth_verifier=#{params[:code]}\"\n end\n redirect_to url\n else\n render :text=>\"error processing oauth token\", :layout=>false\n end\n end",
"def redirect_url; end",
"def callback\n # first, load the state (redirect_url, access_token)\n state = params[:state] ? LinkedAccount::Base.decode_state(params[:state]) : {}\n\n # set @linked_account, @redirect_url, and optionally @person\n case params.try(:[], :provider)\n when 'github'\n @linked_account = LinkedAccount::Github::User.find_or_create_via_oauth_code params[:code]\n @person = Person.find_by_access_token(state[:access_token])\n @redirect_url = state[:redirect_url]\n\n when 'facebook'\n @linked_account = LinkedAccount::Facebook.find_or_create_via_oauth_code params[:code]\n @person = Person.find_by_access_token(state[:access_token])\n @redirect_url = state[:redirect_url]\n\n when 'twitter'\n @linked_account = LinkedAccount::Twitter.find_or_create_via_oauth_token_and_verifier(params[:oauth_token], params[:oauth_verifier])\n @person = Person.find_by_access_token(state[:access_token])\n @redirect_url = state[:redirect_url]\n\n when 'gittip', 'gratipay'\n @linked_account = LinkedAccount::Gittip.find_by_oauth_token params[:external_access_token]\n @person = Person.find_by_access_token(params[:gittip_access_token] || params[:gratipay_access_token])\n @redirect_url = params.delete :redirect_url\n end\n\n # run through all of the use cases\n if @person && (@person == @linked_account.person)\n # nothing to do... @person is already logged in and linked to this account.\n opts = { status: 'linked', access_token: @person.create_access_token(request) }\n elsif @person && !@linked_account.person\n # should be safe to link this account to the logged in @person\n @linked_account.link_with_person(@person)\n opts = { status: 'linked', access_token: @person.create_access_token(request) }\n elsif @person\n # error! @person logged in but not the same as @linked_account.person\n opts = { status: 'error_already_linked' }\n elsif @linked_account.person\n opts = { status: 'linked', access_token: @linked_account.person.create_access_token(request) }\n\n # Alias Person ID with randomly generated Mixpanel distinct_id.\n unless state[:mp_id].blank?\n begin\n MixpanelAlias.claim(@linked_account.person.id, state[:mp_id])\n rescue MixpanelAlias::AlreadyClaimed\n opts[:reset_mixpanel_id] = true\n end\n end\n\n else\n # nobody logged in, and no person on this account... they need to create an account\n opts = {\n status: 'error_needs_account',\n email_is_registered: !!Person.find_by_email(@linked_account.email),\n account_link_id: \"#{params[:provider]}:#{@linked_account.create_access_token}\",\n first_name: @linked_account.first_name,\n last_name: @linked_account.last_name,\n email: @linked_account.email,\n image_url: @linked_account.image_url,\n display_name: @linked_account.login\n }\n end\n\n # redirect, should be provider-agnostic\n raise MissingRequiredParams, :redirect_url unless Rails.env.development? || (@redirect_url =~ WHITELISTED_REDIRECT_URL)\n\n # tack on params\n redirect_to @redirect_url + (@redirect_url['?'] ? '&' : '?') + opts.to_param\n end",
"def set_redirect\n @redirect = policy_scope(Redirect).find(params[:id])\n authorize @redirect\n end",
"def redirect\n client = Signet::OAuth2::Client.new(client_options)\n if internet_connection? \n redirect_to client.authorization_uri.to_s\n else\n redirect_to root_path\n end\n end",
"def redirect_uri\n @redirect_uri ||= root_url[0..-2] + oauth_callback_path\n end",
"def redirect_original(request, state_params, site)\n response = Rack::Response.new\n # Note that app_callback_url is added by OmniAuth.config.before_request_phase\n # any value provided by a client will be overwritten in that method so that we\n # don't use/trust values sent by the client\n return_url = state_params[\"app_callback_url\"]\n query = query_string(request, SecureRandom.hex(64))\n return_url << \"?\"\n return_url << signed_query_string(query, site.secret)\n response.redirect return_url\n response.finish\n end",
"def prepare_to_publish\n manager = OauthManager.new(@vehicle)\n @oauth = manager.oauth\n redirect_to manager.url\n\n rescue Exception => e\n flash[:error] = \"No se pudo autenticar con Facebook. #{e}\"\n redirect_to vehicles_path\n end",
"def merge_set_up_params(params)\n if (!@oauth_token.nil? && !@version.nil?)\n params.merge!(:oauth_token => @oauth_token)\n params.merge(:v => @version)\n end\n return params\n end",
"def exchange_oauth_tokens\n end",
"def login_url(params,session)\n req_token = self.get_request_token\n session[:request_token] = req_token.token\n session[:request_token_secret] = req_token.secret\n self.authorize_url({:request_token => req_token.token, :request_token_secret => req_token.secret})\n end",
"def redirect_uri\n\t\t@client.authorization.authorization_uri.to_s\n\tend",
"def wepay_authorization_url(redirect_uri)\n\t #Wefarm::Application::WEPAY.oauth2_authorize_url(OAUTH_REDIRECT_URI + self.id.to_s, self.email, self.name)\n\t Wefarm::Application::WEPAY.oauth2_authorize_url(redirect_uri, self.email, self.name)\n\tend",
"def redirect\n callback_url = url_for :action => :callback\n sc_request_token = $sc_consumer.get_request_token(:oauth_callback => callback_url)\n session[:sc_request_token] = sc_request_token.token\n session[:sc_request_token_secret] = sc_request_token.secret\n @authorize_url = \"http://soundcloud.com/oauth/authorize?oauth_token=#{sc_request_token.token}\"\n\n redirect_to @authorize_url\n end",
"def authorize\n\n # redirect to kpass for authorization (and authentication if they're not\n # signed in.)\n # \n \n\n authorize_url = \"#{ENV['KPASS_ENDPOINT']}/oauth/authorize?app_id=#{ENV['KPASS_APP_ID']}\"\n redirect_to authorize_url\n end",
"def return_from_general_auth\t\n # back from oauth wormhole..obtain facebook user and credentials\n oauth = Koala::Facebook::OAuth.new(APP_ID, APP_SECRET, GEN_AUTH_CALLBACK)\n session[:access_token] = oauth.get_access_token(params[:code])\n graph = Koala::Facebook::API.new(session[:access_token])\n facebook_user_id = graph.get_object(\"me\")[\"id\"]\n session[:individual_user_id] = \n IndividualUser.login_or_create(facebook_user_id,session[:access_token])\n\n # determine where to redirect\n state, link = false, false\n\t if params[:state]\n state = true\n decoded_state = ActiveSupport::JSON.decode(params[:state])\n \n # [Page Tab] return to the page tab\n if decoded_state['page_tab_id']\n\t\t\t graph = Koala::Facebook::API.new\n\t\t\t page_tab = graph.get_object(\"#{decoded_state['page_tab_id']}\")\n\t\t\t if page_tab[\"link\"]\n link = true\n\t\t\t\t encoded_page_state = URI.encode(ActiveSupport::JSON.encode(\n {:individual_user_id => session[:individual_user_id], \n :secret => session[:access_token]\n }))\n end\n end\n end\n \n # handle the redirect\n if state && link\n redirect_to(page_tab[\"link\"] + \n \"?sk=app_#{APP_ID}&app_data=#{encoded_page_state}\")\n else\n redirect_to(create_fb_url_with_creds(session[:individual_user_id],\n session[:access_token]))\n end\n return\n end",
"def authorize\n\t\t@@extension_url = params[:redirect_uri]\n\t\tredirect_to('/auth/google_oauth2')\n\tend",
"def authorize_application\n # init auth state and oauth url..enter wormhole\n oauth = Koala::Facebook::OAuth.new(APP_ID, APP_SECRET, GIFT_AUTH_CALLBACK)\n encoded_auth_state = create_auth_state\n oauth_url = create_oauth_url(oauth.oauth_callback_url, encoded_auth_state)\n redirect_to(:action => \"exit_portal\", :url => oauth_url) and return\n end",
"def set_redirect_location\n @redirect_location = @shareable\n end",
"def authorize_request\n if basic_auth.values.all?\n [:basic_auth, @username, @password]\n else\n [:desk_oauth, oauth]\n end\n end",
"def update_tokens(oauth_params)\n# binding.pry\n self.oauth_token = oauth_params.credentials.token\n # facebook, google provide this; twitter, linkedin don't\n self.oauth_expires_at = Time.at(oauth_params.credentials.expires_at) if oauth_params.credentials.expires_at\n # twitter\n self.oauth_secret = oauth_params.credentials.secret if oauth_params.credentials.secret\n end",
"def use_oauth\n\t\t\t\n\t\tend",
"def create\n # find or create an auth_grant for a given user\n application = Opro::Oauth::ClientApp.find_by_client_id(params[:client_id])\n auth_grant = Opro::Oauth::AuthGrant.find_or_create_by_user_app(current_user, application)\n\n # add permission changes if there are any\n auth_grant.update_permissions(params[:permissions])\n redirect_to auth_grant.redirect_uri_for(params[:redirect_uri], params[:state])\n end",
"def redirects; end",
"def bind_with_oauth\n if u = User.find_by_email(params[:user][:email])\n flash[:alert] = I18n.t 'devise.oauth_services.user.email_has_been_token'\n redirect_to new_oauth_user_registration_path and return\n end \n u = build_resource permitted_params.merge(name: session[:oauth].info.name, password: SecureRandom.hex )\n\n u.bypass_humanizer = true\n if u.save\n u.apply_oauth session[:oauth]\n flash[:notice] = I18n.t 'devise.omniauth_callbacks.success', kind: (I18n.t \"devise.oauth_services.providers.#{session[:oauth].provider}\") if session[:oauth].present?\n sign_in_and_redirect @user, :event => :authentication\n else\n flash[:alert] = I18n.t 'devise.oauth_services.user.failure'\n redirect_to new_oauth_user_registration_path\n end\n end",
"def test_redirect_url\n common_opts = {}\n if user_is_in_proper_account?\n Rails.application.routes.url_helpers.workplace_start_path(common_opts.merge({success: true, refresh: true}))\n elsif UserSession.find\n Rails.application.routes.url_helpers.workplace_failure_path(common_opts.merge({network: params[:network], wrong_network: true}))\n else\n Rails.application.routes.url_helpers.identity_provider_path(common_opts.merge({network: params[:network], fb_workplace_network: false}))\n end\n end",
"def redirect_params\n params.require(:redirect).permit(:shop_id, :origin, :destination)\n end",
"def set_redirect\n @redirect = params[:origin_url] == nil ? bookmarks_path : params[:origin_url]\n end",
"def authorize_url(params={})\n # response_type param included by default by using the OAuth 2.0\n # auth_code strategy\n # client_id param included automatically by the OAuth 2.0 gem\n params[:state] ||= state\n params[:redirect_uri] ||= \"http://localhost\"\n oauth2_client.auth_code.authorize_url(params)\n rescue OAuth2::Error => e\n raise LinkedIn::Errors::UnauthorizedError.new(e.code), e.description\n end",
"def new\n next_url = AppConfig.facebook_app_url + \"facebook/callback\"\n #next_url += (\"?request_ids=\" + params[:request_ids]) unless params[:request_ids].nil?\n @auth_url = Authentication.auth.client.web_server.authorize_url(\n :redirect_uri => next_url, :scope => AppConfig.facebook_perms\n )\n end",
"def authorize(params = {})\n open_url authorize_url(params)\n end",
"def store_location\n session[:redirect_url] = params[:redirect_url] if params[:redirect_url]\n session[:role] = params[:role] if params[:role]\n end",
"def wepay_authorization_url(redirect_uri)\n WEPAY.oauth2_authorize_url(redirect_uri, self.email, self.name)\nend",
"def oauth_callback(params)\n update! psp_credentials: payment_provider.get_access_token(params)\n end",
"def authenticate(_)\n super(session_params)\n end",
"def require_user\n \n #First, check to see if user is already logged in\n unless current_user \n \n # Second, check to see if session negotiation is ongoing \n if params[:session_action]\n if params[:request_url] # preserve a passed along request url\n redirect_to new_user_path(:request_url => params[:request_url]) and return if params[:session_action]==\"new_user\"\n else\n redirect_to new_user_path and return if params[:session_action]==\"new_user\" \n end\n end \n \n # Third, check to see if this is a logged-in, existing user (w/signed approval form Hot Ink) or a request_token authorization callback response\n if params[:oauth_token]\n if params[:sig]\n \n # This is where we actually authenticate\n access_token = OauthToken.find_by_token(params[:oauth_token])\n \n if access_token&¶ms[:sig]==Digest::SHA1.hexdigest(access_token.token + access_token.secret)\n \n # Signature matches, it's really Hot Ink and the user checks out. Log 'em in.\n UserSession.create!(access_token.user)\n \n # If a request url was forwarded along, send them there. \n # This will preserve any query-string values set by Hot Ink. \n if params[:request_url] \n redirect_to(params[:request_url])\n return\n end\n \n else\n # Either Hot Ink is confused, or someone's trying to break in\n render :text => \"Oauth verification not accepted.\", :status => 401\n return\n end\n \n else\n redirect_to new_user_path(:oauth_token => params[:oauth_token], :request_url => params[:request_url])\n return\n end \n end\n \n \n \n # Last resort, this must be a fresh user request. Forward along to Hot Ink to authenticate.\n redirect_to \"#{HOTINK_SETTINGS.site}/remote_session/new?key=#{HOTINK_SETTINGS.token}&request_url=#{request.request_uri}\"\n return false\n end\n end",
"def oauth2_authenticatable(routes, mapping)\n \n database_authenticatable(routes, mapping)\n routes.oauth_callback ::Devise.oauth2_callback_path, :controller => 'sessions', :action => 'oauth_callback'\n end",
"def oAuthValidate\r\n logger.info(\"UserController::oAuthValidate::Params:----#{params}\")\r\n \r\n end",
"def set_default_params(params)\n\t\t\tparams[:authorization_token] = @token\n\t\t\tparams[:account] = params[:account] || @account\n\t\t\t\n\t\t\tif params[:site] == \"ignore\"\n\t\t\t\tparams.delete(:site)\n\t\t\telse\n\t\t\t\tparams[:site] = params[:site] || @site\n\t\t\tend\n\t\t\t\n\t\t\tif params[:user] == \"account\" #special case for the servlet calls. The user parameter is the the account name\n\t\t\t\tparams[:user] = @account\n\t\t\tend\n\t\t\t\n\t\t\tparams\n\t\tend",
"def authorize_url\n request_token.authorize_url\n end",
"def authentication_url(params={})\n @request_token.authorize_url params\n end",
"def oauth_url_authorize\n return \"#{$SETTINGS[:oauth_server_url_authorize]}?response_type=code&client_id=#{$SETTINGS[:oauth_client_id]}&scope=ALL&redirect_uri=#{oauth_redirect_uri}\" \n end",
"def oauth\n session[:auth_token] = GoogleOauth.oauth(params)\n puts \"saving auth token #{session[:auth_token]}\"\n redirect_to(\"/characters/#{session[:char_id]}\")\nend",
"def authorize_url(attribs={})\n self.class.authorize_url id, attribs.reverse_merge(credentials: api_creds)\n end",
"def set_oauth2_urls(spec, sec_scheme_id, authorization_url, token_url)\n sec_scheme_obj = spec.dig('securityDefinitions', sec_scheme_id)\n if sec_scheme_obj.nil? || sec_scheme_obj['type'] != 'oauth2'\n raise ThreeScaleToolbox::Error, \"Expected security scheme {#{sec_scheme_id}} not found or not oauth2\"\n end\n\n sec_scheme_obj['authorizationUrl'] = authorization_url if %w[implicit accessCode].include?(sec_scheme_obj['flow'])\n sec_scheme_obj['tokenUrl'] = token_url if %w[password application accessCode].include?(sec_scheme_obj['flow'])\n end",
"def client_redirect_auth\n\t\t# Since the :restrict_access method is called whenever this method is called, that will take care of unauthenticated users (will return a 404 before this method is even run)\n\t\tapi_key = ApiKey.find_by_access_token(params[:access_token])\n\t\tusr = User.find(api_key.user_id)\n\t\trole = usr.role\n\t\ttimeUntilExp = ''\n\n\t\tmsg = \"UNAUTHORIZED\"\n\t\tif params[:authorize]\n\t\t\tif params[:role] == usr.role\n\t\t\t\t# Roles match and user is authorized\n\t\t\t\tmsg = \"AUTHORIZED\"\n\t\t\tend\n\t\telse\n\t\t\t# User is authenticated (logged in) but is not authorized\n\t\t\tmsg = \"AUTHENTICATED\"\n\t\tend\n\n\t\tif api_key\n\t\t\tputs \"WHY DOESNT THIS WORK? #{distance_of_time_in_words(Time.now, api_key.expires_at)}\"\n\t\t\tputs \"SECONDS #{((api_key.expires_at - Time.now).seconds).round}\"\n\t\t\ttimeUntilExp = ((api_key.expires_at - Time.now).seconds).round\n\t\tend\n\t\trespond_to do |format|\n \t\tformat.json { render :json => { :msg => msg, :role => role, :timeUntilExp => timeUntilExp } } \t\t\n \t\tend\n\tend",
"def authorize_url(redirect_url, state=nil)\n params = {:redirect_uri => redirect_url}\n params[:state] = state if state\n client.auth_code.authorize_url(params).gsub(/api-ssl\\./,'')\n end",
"def auth_endpoint_callback\n Rails.logger.debug \"------ Entering auth_endpoint_callback ------\"\n\n @organization = Organization.find(params[:org])\n\n session[\"access_token\"] = @organization.authorization_server.\n request_access_token(request, callback_url)\n redirect_to organization_records_path(@organization)\n end",
"def authorize\n oauth_verifier = params[:oauth_verifier]\n request_token = session[:request_token]\n access_token = request_token.get_access_token(:oauth_verifier => oauth_verifier)\n \n user = User.login(access_token)\n session[:user] = user.id unless user.nil?\n redirect_to :controller => :home\n end",
"def auth_param; end",
"def openid_redirect_uri; end",
"def token_params\n super.tap do |params|\n options[:token_options].each do |k|\n params[k] = request.params[k.to_s] unless [nil, ''].include?(request.params[k.to_s])\n end\n end\n end"
] |
[
"0.7227562",
"0.7089455",
"0.69590807",
"0.6955094",
"0.68463266",
"0.6838749",
"0.67946094",
"0.65502334",
"0.6477877",
"0.64064735",
"0.6325004",
"0.62828195",
"0.6242743",
"0.61860657",
"0.61687076",
"0.6152864",
"0.6129026",
"0.61270374",
"0.6091774",
"0.602243",
"0.6004254",
"0.59562",
"0.5899839",
"0.5888824",
"0.5888474",
"0.58727264",
"0.5868606",
"0.57836664",
"0.57693124",
"0.57670534",
"0.5728336",
"0.57200694",
"0.5710154",
"0.5708784",
"0.57069004",
"0.5704053",
"0.5704053",
"0.5695622",
"0.5689103",
"0.5669814",
"0.5661506",
"0.5661298",
"0.5638821",
"0.5622049",
"0.56175995",
"0.560354",
"0.5601366",
"0.55995536",
"0.5592659",
"0.5590446",
"0.55717087",
"0.55655557",
"0.55581814",
"0.55563515",
"0.55432284",
"0.5535645",
"0.5530312",
"0.55301183",
"0.55278504",
"0.5511387",
"0.5503803",
"0.5502494",
"0.54951787",
"0.5479107",
"0.54783165",
"0.5471627",
"0.5471165",
"0.546376",
"0.54579806",
"0.545267",
"0.5449804",
"0.5444678",
"0.5442813",
"0.54304016",
"0.54201335",
"0.54161453",
"0.541242",
"0.54113835",
"0.54027027",
"0.5400536",
"0.53947455",
"0.5388431",
"0.53869605",
"0.538595",
"0.5381909",
"0.5380974",
"0.5380432",
"0.5379757",
"0.5379756",
"0.5378953",
"0.5371259",
"0.53698444",
"0.53689086",
"0.53672034",
"0.5366942",
"0.5359591",
"0.53457284",
"0.53453636",
"0.53391117",
"0.5331833"
] |
0.77745366
|
0
|
This job will alert the user when they've been invited to a contest
|
def perform(inviter, user_id, contest_id, email = nil)
@inviter = inviter
@user = User.joins("JOIN email_preferences ON email_preferences.user_id = users.id").select(:id, :email, :name, :token_1, :token_2, :contest_invitation, :email_validated).where(id: user_id).first
if @user
@contest = Contest.find(contest_id)
MainMailer.contest_invite_with_account(@user, @inviter.name, @contest.contest_title).deliver_now if (@user.contest_invitation == 1 && @user.email_validated == true)
else
MainMailer.contest_invite_no_account(email, @inviter.name, @contest.contest_title).deliver_now
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def accept_candidate\n authorize(@job_candidate)\n @job_candidate.accepted!\n tracker = Mixpanel::Tracker.new(ENV[\"NT_MIXPANEL_TOKEN\"])\n tracker.track('employer-' + current_employer.email, 'accepted candidate')\n CandidateMailer.send_job_hire(@job_candidate.candidate.email, @job_candidate.job).deliver_later\n redirect_to employer_jobs_path, notice: 'Successfully accepted, an email was sent to the candidate.'\n end",
"def invite\n \n end",
"def admin_candidate_interview_status_change(interview, employer, candidate)\n @interview = interview\n @employer = employer\n @candidate = candidate\n \n subject = \"Candidate has \" + @interview.candidate_status + \" interview request\"\n \n mail to: \"takeoff@interviewjet.com\", subject: subject\n \n \n end",
"def trial_ending(user)\n mail to: user.email, subject: \"Only 72 Hours Left of Review Alerts!\"\n end",
"def send_invitation\n DelayedJob.enqueue('UserInviter',\n Time.now+10.second,\n self.id.to_s,\n I18n.translate(:you_are_invited_by, :name => self.user.name),\n self.message\n )\n end",
"def invite_subject\n \"Your invitation to #{org_name.possessive} Creative Difference Dashboard\"\n end",
"def accept!()\n self.status = Invite::Status::ACCEPTED\n invitable.add_member invitee\n save!\n end",
"def interview_status_change(interview, employer, candidate)\n @interview = interview\n @employer = employer\n @candidate = candidate\n \n subject = \"Takeoff - Interview Request - \" + @interview.status\n \n mail to: @employer.email, subject: subject\n end",
"def alert(annc, user)\n\t\t@greeting = annc.company.name.upcase + \" (#{annc.company.hk_ticker}) has posted an announcement at #{annc.datetime.to_formatted_s(:short)}: #{annc.message}.\"\n\t\t@url = annc.url\n\n\t\tmail to: user.email, subject: \"HK Equities Alert (#{annc.company.hk_ticker})\"\n\tend",
"def accepted(opportunity_id, profile_id)\n @opportunity = Opportunity.find(opportunity_id)\n @profile = Profile.find(profile_id)\n mail(to: [@opportunity.user.email, @profile.user.email], subject: 'A Candidate has accepted your invitation to participate in a MOBEEAS Opportunity')\n end",
"def invited_app_user(user)\n @user = user\n @subject = \"Invitation to Bunch\"\n @body = \"Bunch is a simple web dashboard that integrates with your teams’ calendars.\" \n mail(to: @user.email, subject: @subject)\n end",
"def invite!\n #logger.debug 'invite called'\n self.confirm!\n super\n #self.confirmed_at = Time.now\n #self.save\n end",
"def invited_volunteer!\n update(last_invited_volunteer: Time.current)\n end",
"def invite_worker(email, agency)\n setup_email\n body[:agency] = agency\n recipients email\n subject \"Invite from #{agency.name} to use on-line timesheets at ClockOff.com\"\n end",
"def accepted(invite, user)\n @invite = invite\n @user = user\n mail(:to => invite.user.email, :subject => \"#{@user.name} has accepted your invitation to the \\\"#{invite.idea.name}\\\" idea\", :tag => 'invite-accepted') \n end",
"def deliver_invite_to_resident(resident, user)\n return\n end",
"def event_reminder_to_chef(evt)\n @evt = evt\n @chef = User.find_by_id(@evt.user_id)\n @guests = @evt.signups.where('confirmation_status in (?)', 'Attending')\n @comments = @evt.messages.where(\"public_flag = ?\", 1).group(\"messagechain_id\", \"order_id\", \"message_content\", \"sender_id\").sort{|a,b| b[:messagechain_id] <=> a[:messagechain_id]}\n if @guests.sum(:guest_count) > 0\n @paid_communal = @guests.where(\"own_group_flag = 0\")\n @own_table = @guests.where(\"own_group_flag = 1\")\n mail(:to => @chef.email, :subject => \"Your upcoming event on Local Yum\", :from => \"\\\"Local Yum\\\" <alert@localyum.me>\")\n end\n end",
"def accept_invitation\n \n end",
"def job_moved_to_invoiced(user, job)\n @user = user\n @job = job\n\n mail(to: @user.email, subject: \"#{@user.full_name}, #{@job.name} has moved to invoiced.\")\n end",
"def perform(email, job_id)\n if email.blank? or job_id.blank?\n puts(\"Either of job or email is blank. Email: #{email}, Job: #{job_id}\")\n return\n end\n\n email_invitations = EmailInvitation.where(:email => email)\n email_invitation = nil\n email_invitations.each do |invitation|\n unless invitation[:invitor_handle].blank?\n email_invitation = invitation\n end\n end\n\n if !email_invitations.blank? and email_invitation.blank?\n email_invitation = email_invitations[0]\n end\n\n if email_invitation.blank?\n email_invitation = create_email_invitation_for_email(email, nil)\n end\n\n if email_invitation.reminder_count >= 3\n puts(\"Reminder count exceeded for user: #{email}\")\n return\n end\n\n job = get_job_by_id(job_id)\n if job.blank? or !job.live\n puts(\"Either Job is blank or not live. live? #{job.live}\")\n return\n end\n\n email_variation_id = get_job_email_variation\n user = get_user_by_email(email)\n if user.blank?\n user = create_passive_user(email)\n elsif user[:active]\n puts(\"USER (#{user})is active returning from not sending invitation\")\n return\n end\n begin\n Notifier.email_job_invitation(user, '', job, email_variation_id).deliver\n rescue Exception => ex\n puts \"Exception: #{ex}\"\n end\n\n email_invitation.last_variation_used = email_variation_id\n email_invitation.time = Time.now\n email_invitation.reminder_count = email_invitation.reminder_count + 1\n email_invitation.save\n track_email_send(\"track_job_email_#{job_id}_#{email_variation_id}\")\n end",
"def invited?\n event = Event.where(id: \"#{params[:id]}\")[0]\n unless event.invites.find_by_recipient_id(session[:current_user]['id'])\n flash[:notice] = \"You have not been invited to this event.\"\n redirect_to event_path(event)\n end\n end",
"def candidate_interview_request(interview, employer, candidate)\n @interview = interview\n @employer = employer\n @candidate = candidate\n \n subject = \"Congrats!! You have been selected for an Interview\"\n \n mail to: @candidate.email, subject: subject\n end",
"def accept_invite(event)\n invite = Invite.where(user: self, event: event)\n invite.accept if invite.present?\n end",
"def interview_request(interview, employer, candidate)\n @interview = interview\n @employer = employer\n @candidate = candidate\n \n subject = \"Takeoff - Interview Request\"\n \n mail to: \"takeoff@interviewjet.com\", subject: subject\n \n \n end",
"def invite!\n if send_email('invitation')\n self.update_column :invited_at, Time.zone.now if respond_to?(:invited_at)\n end\n end",
"def invitee_action\n begin\n if check_magic_token\n\n event_type = params[:event]\n calendar_email = params[:payload][:event][:extended_assigned_to][0][:email] # This is the email of the account used to create the calendar\n email = params[:payload][:invitee][:email]\n first_name = params[:payload][:invitee][:first_name]\n last_name = params[:payload][:invitee][:last_name]\n event_name = params[:payload][:event_type][:name]\n start_time = params[:payload][:event][:invitee_start_time_pretty]\n\n\n contact = {}\n contact['FirstName'] = first_name\n contact['LastName'] = last_name unless last_name.blank?\n contact['Email'] = email\n\n applicant_type = 'event_volunteer'\n selected_timeslot = \"#{event_name}: #{start_time}\"\n\n bz_region = User.get_bz_region(applicant_type, calendar_email)\n if bz_region.nil?\n raise NoRegionMappingException \"No bz_region set b/c we haven't mapped the calendar #{calendar_email} to a region for #{applicant_type}\"\n end\n\n if event_type == 'invitee.created'\n calendly_url = User.get_calendar_url(bz_region)\n phone = nil\n company = nil\n title_industry = nil\n city_state = nil\n career = nil\n params[:payload][:questions_and_answers].each do |qa|\n if qa[:question].downcase.include?('phone')\n phone = qa[:answer]\n elsif qa[:question].downcase.include?('employer')\n company = qa[:answer]\n elsif qa[:question].downcase.include?('title')\n title_industry = qa[:answer]\n elsif qa[:question].downcase.include?('career')\n career = qa[:answer]\n elsif qa[:question].downcase.include?('city, state')\n city_state = qa[:answer]\n end\n end\n\n # Note: city_state is supposed to be in the format: City, State. E.g. Brooklyn, NY\n # If it's not, just set the city to the whole string\n city = city_state.split(',')[0]\n state = city_state.split(',')[1]\n\n # Create a BZ User in this platform\n current_user = User.find_by_email(email)\n if current_user.nil?\n current_user = User.new(:first_name => first_name, :last_name => last_name, :email => email, :phone => phone, :applicant_type => applicant_type, :city => city, :state => state, :external_referral_url => calendly_url, :bz_region => bz_region)\n else\n current_user.bz_region = bz_region\n current_user.applicant_type = applicant_type\n end\n current_user.skip_confirmation!\n current_user.save!\n\n # Create the user in salesforce\n contact['Phone'] = phone\n contact['Signup_Date__c'] = DateTime.now\n contact['MailingCity'] = city\n contact['MailingState'] = state unless state.nil?\n contact['Company__c'] = company\n contact['Title'] = title_industry # Both their title and industry could have commans, so can't split reliable. Just stuff it all in Title field.\n contact['Career__c'] = career\n contact['BZ_Region__c'] = bz_region\n contact['User_Type__c'] = 'Event Volunteer'\n contact['BZ_User_Id__c'] = current_user.id\n contact['Came_From_to_Visit_Site__c'] = calendly_url\n\n salesforce = BeyondZ::Salesforce.new\n existing_salesforce_id = salesforce.exists_in_salesforce(email)\n client = salesforce.get_client\n if !existing_salesforce_id.nil?\n client.update('Contact', existing_salesforce_id, contact)\n else\n # There is a bug in calendly where Last Name is not actually a required field.\n # This is meant to put something in that field so at least a Salesforce record is created.\n contact['LastName'] = '<Missing>' if last_name.blank?\n\n # Note: for new users that volunteer, we don't create BZ Users. We just populate a new Salesforce\n # contact as though it was done manually. Only Fellows and LCs get BZ Users after this calendly integration goes live.\n contact['LeadSource'] = 'Volunteer Signup'\n contact['OwnerId'] = current_user.salesforce_lead_owner_id # Note that if they are already in Salesforce, we assume they have an Owner already.\n contact = client.create('Contact', contact)\n existing_salesforce_id = contact.Id\n end\n\n current_user.salesforce_id = existing_salesforce_id\n current_user.skip_confirmation!\n current_user.save!\n \n cm = current_user.auto_add_to_salesforce_campaign('Confirmed', selected_timeslot)\n if cm.nil?\n logger.debug \"######## Failed to create Campaign Member for #{current_user.inspect}. Dunno why though.\"\n end\n\n current_user.create_mailchimp\n\n elsif event_type == 'invitee.canceled'\n current_user = User.find_by_email(email)\n if !current_user.nil?\n current_user.bz_region = bz_region\n current_user.applicant_type = applicant_type\n cancellation_reason = params[:payload][:invitee][:cancel_reason]\n current_user.cancel_volunteer_signup(selected_timeslot, cancellation_reason)\n else\n logger.warn \"No user with email = #{email} found -- NOOP\"\n end\n\n else\n logger.warn \"Unrecognized event type found: #{event_type} -- NOOP\"\n end\n end\n # Need to catch all exceptions and always report that it was OK b/c Calendly will put the webhook\n # in a failed state and stop calling our endpoint until we delete and re-register the hook.\n rescue Exception => e\n logger.warn \"###### Caught #{e.inspect} -- may have failed to add the Volunteer signup information into Salesforce.\"\n end\n\n render plain: 'OK'\n end",
"def cron_invite_email\n @invites = Invite.find(:all, :conditions => ['draft=0 AND immediately=0'])\n if @invites.count > 0\n for inv in @invites \n @eve = Event.find(inv[:event_id])\n now_date = Time.now.strftime('%Y-%m-%d %H:%M')\n @eve_date = @eve[:event_start_date_time]\n \n if inv[:days]!='' && inv[:days]!=nil\n @eve_date = @eve_date - inv[:days].days\n end\n \n if inv[:hours]!='' && inv[:hours]!=nil\n @eve_date = @eve_date - inv[:hours].hours\n end\n \n if inv[:minutes]!='' && inv[:minutes]!=nil\n @eve_date = @eve_date - inv[:minutes].minutes\n end\n \n if inv[:select_date].strftime('%Y-%m-%d %H:%M') == now_date || @eve_date.strftime('%Y-%m-%d %H:%M')==now_date\n \n @guest = InviteGuest.find(:all, :conditions => ['invite_id=?', inv[:id]])\n if @guest.count > 0\n for g in @guest\n if g[:first_name]\n @name = g[:first_name]+' '+g[:last_name]\n else\n @name = '';\n end\n \n UserMailer.send_invite_email(inv, g[:email], @name).deliver\n g[:sent] = 1\n g[:send_date_time] = DateTime.now.strftime('%Y-%m-%d %H:%M:%S')\n g.save\n end ## for guest ends\n inv[:draft]=0\n inv[:sent] = 1\n inv[:send_date_time] = DateTime.now.strftime('%Y-%m-%d %H:%M:%S')\n inv.save\n \n end ### if guest ends\n end ### date compare ends \n \n end ### for ends\n end ### if ends \n render :text => (I18n.t 'invite_create.done') and return\n end",
"def send_outstanding_alert_to_contractor(agency, user)\n setup_email\n body[:agency] = agency\n body[:user] = user\n recipients user.email\n subject \"Timesheet Submission Reminder\"\n end",
"def accept_mesa_invite\n mesa_pending_invitation = get_mesa_pending_invitations \n \tif mesa_pending_invitation.exists? && mesa_pending_invitation.take.mesa_invitation_not_expired\n\t\tmesa_pending_invitation.take.update_attribute(:invitation_status, ACCEPTED_MESA_INVITATION)\n\t\tuser_name = User.find(params[:user_id]).name\n\t\tmesa = Mission.find(params[:mission_id])\n\t\tmesa_title = mesa.title\n\t\tmesa_owner_email = mesa.get_mission_owner[:email]\n mesa_owner_name = mesa.get_mission_owner[:name]\n\t\t# How to precisely check all invitations are accepteed?\n\t\t#if check_if_all_invitations_are_accepted\n\t\t # UserMailer.all_invitations_accepted_email(mesa_owner_email,mesa_owner_name ).deliver\n\t\t#end\n\t\tUserMailer.accept_mesa_invitation_email(user_name,mesa_title,mesa_owner_email).deliver\n\t\t@message = 'Your Mesa Acceptance notification has been sent.'\n\t\trespond_to do |format|\n\t\t format.json {render :json=> {:status => true} }\n\t\t format.html {render partial: 'layouts/mesa_modal_box.html.erb', layout: false}\n\t\tend\n else\n\t respond_to do |format|\n\t\t\t\t\t@message = 'Invitation expired or No user with this mission id has pending invitation'\n\t\t\t format.html {render partial: 'layouts/mesa_modal_box.html.erb', layout: false}\n\t\t format.json {render :json=> {:error=> @message , :status => false} }\n\t end\n\tend\n end",
"def send_invite\n\n Email::HookCreator::SendTransactionalMail.new(\n client_id: Client::OST_KYC_CLIENT_IDENTIFIER,\n email: @invite_admin_obj.email,\n template_name: GlobalConstant::PepoCampaigns.admin_invite_template,\n template_vars: {\n inviter_name: @admin.name,\n invitee_name: @invite_admin_obj.name,\n company_name: @client.name,\n invite_token: @invite_token\n\n }\n ).perform\n\n end",
"def stand_by_reservation_alert(num_of_runs_available, run_title, original_search_url, customer_email)\n @num_of_runs_available = num_of_runs_available\n @run_title = run_title\n @original_search_url = original_search_url\n @customer_email = customer_email\n mail(to: customer_email, subject: 'PawBookings stand-by reservation update')\n end",
"def invite\n @user = current_user\n UserMailer.invite_email(current_user, params[:email]).deliver\n redirect_to(kites_path, :notify => \"Your invitation has been sent\")\n end",
"def invited_notification(user, data_template, company)\n setup_email(user, company.id)\n @subject += 'Event Invitiation'\n @body[:url] = \"#{SITE}/#{company.name}\"\n @support_email = \"#{SUPPORT_EMAIL}\"\n @invited_to_event = \"#{data_template.event.name}\"\n @invited_to_template = \"#{data_template.name}\"\n end",
"def invite\n set_gamer\n\n return unless request.post? # else: JS do the invite\n\n # answered\n if params[:commit] == t(:do_yes)\n @gamer.accept!\n @game.check_play_now(params[:game_js_time].to_i)\n broadcast\n redirect_to play_game_path(@game), game_js_time: params[:game_js_time].to_i\n\n else # params[:commit] == 'no'\n @gamer.reject!\n @game.check_play_now(params[:game_js_time].to_i)\n broadcast\n redirect_to games_path\n\n end\n end",
"def accepted_invite(user)\n @user = user\n mail(:to => user.email, :subject => \"Welcome to the Secret Santa Society.\")\n end",
"def signed_up_alert(evt)\n @evt = evt\n host = User.find_by_id(@evt.user_id)\n mail(:to => host.email, :subject => \"There is a seat request for your Local Yum event\", :from => \"\\\"Local Yum\\\" <notification@localyum.me>\")\n end",
"def invite\n invite = params[:invite]\n profile.update_attribute(:email, invite[:email])\n invite = Notifier.send_invite(profile, invite[:message])\n invite.deliver\n flash[:notice] = \"An invititation to join YentaFriend was sent to #{profile.name}. Check your dashboard for an update when they join!\"\n end",
"def ticket_approved\n TaskMailer.with(task: Task.first).ticket_approved\n end",
"def act_as_partner\n act_as_link.click\n alert_accept if alert_present?\n end",
"def invited?(event)\n\t\tattended_events.include?(event)\n\tend",
"def act_on_ok\n if body['message'] == 'Approval successful.'\n output(\n event: 'success',\n message: message_text,\n uuid: body['uuid'],\n accession: payloads.first[:output][:accession]\n )\n else\n Rails.logger.error(\"Approve transfer Job failed with: #{message_text}\")\n output(event: 'failed', message: message_text)\n fail!\n end\n end",
"def send_approve_email\n 'send_approve_email'\n end",
"def accept_email(task)\n @task = task\n @bid = task.accepted_bid\n mail to: @task.user.email, subject: \"Contact your senior to meet\"\n end",
"def do_accept\n InviteRequest.clear_pending_request_activities(self.user, self.wants_to_join)\n end",
"def _in_invited(event)\n join event.channel\n end",
"def accept\n user = User.find_by(email: @invitation.email)\n if current_user == user\n @invitation.accept!(user.id)\n flash[:notice] = \"Invitation accepted!\"\n redirect_to admins_events_path\n else\n redirect_to admins_event_event_registrations_path, alert: \"Ups! Action not allowed for this user.\"\n end\n end",
"def appointment_notification(event, client)\n @intake_form = ENV[\"INTAKE_FORM\"]\n @office_location = ENV[\"OFFICE_LOC\"]\n @event = event\n @counselors = return_counselor_lists(@event.users)\n @name = client.name\n email_with_name = %(\"#{client.name}\" <#{client.email}>)\n mail(to: email_with_name, subject: 'Appointment reminder and intake form for ITPH')\n end",
"def participant_acceptance(participant,school)\n @participant = participant\n @school = school\n admin_user_ids = Participant.where(\"school_id = ? and role_id < ?\",@school.id,3).all.map(&:user_id)\n schooladmins = User.where(id: admin_user_ids).all.map(&:email)\n @applicant = User.find(@participant.user_id)\n applicant_email = \"#{@applicant.fullname} <#{@applicant.email}>\"\n \n mail to: applicant_email,\n reply_to: schooladmins,\n subject: \"Congratulations! You have been accepted to\" + @school.name + \" !\"\n end",
"def notify\n graduate_course = GraduateCourse.find(params[:graduate_course])\n subperiod = params[:subperiod].to_i\n year = params[:year]\n if true\n head :ok\n start(graduate_course,subperiod,year)\n cap = Capability.find_by_name(\"Gestione schemi d'orario\")\n puts \"INIZIATO\"\n receivers = graduate_course.users.find(:all, :include => :capabilities, :conditions => [\"capabilities.id = ?\", cap.id])\n receivers.each do |r|\n TeacherMailer.deliver_timetable_calculate_is_started(r,graduate_course,params[:subperiod].to_i)\n end\n else\n head :unavailable\n end\n end",
"def accept_or_decline_invitation(params = [])\n study_invites = array_of_study_invite(params)\n while study_invites.size > 0 do\n study_invites.each do |option|\n if invitations.first.study_name.text.include?(option.first) && option.last.downcase.include?('accept')\n invitations.first.inv_accept.click\n sleep 5\n study_invites.shift unless study_invites.empty?\n break\n elsif invitations.first.study_name.text.include?(option.first) && option.last.downcase.include?('decline')\n invitations.first.inv_decline.click\n sleep 5\n study_invites.shift unless study_invites.empty?\n break\n end\n end\n end\n end",
"def deliver\n @wedding.invite_process_started!\n\n mail = Invitations::InviteMailer.prepare sender: current_user,\n guests: @guests,\n wedding: @wedding\n Guest.invited! @guests if mail.deliver\n\n @wedding.evt.create! wedding: @wedding,\n headline: \"#{@guests.size} guests were sent their invitations!\"\n\n redirect_to wedding_timeline_path(@wedding), notice: \"Invitations have been sent!\"\n end",
"def after_successful_sign_in\n invite = current_account.claim_invitation\n if invite\n invitable = invite.invitable\n invitable_name = invitable.class.name.downcase\n anchor = '/%s/%d' % [invitable_name.pluralize, invitable.id]\n\n flash[:success] = _('%s invited you to collaborate on %s %s.') % [\n invite.user.nicename, invitable.title, invitable_name ]\n\n redirect_to root_path(:anchor => anchor)\n else\n super\n end\n end",
"def invited_user_registered(user)\n\t\t\tUserMailer.delay.user_registered_confirmation(user)\n\t\tend",
"def pending_acceptance\n merge(CourseUser.with_invited_state)\n end",
"def send_claim_email\n\n template = {\n :template => File.join('reviewer_invites', 'claim'),\n :locals => {\n :entity => self.entity,\n :claim_digest => self.claim_digest\n }\n }\n message = {\n :subject => \"Claim Your Invite\",\n :to => [ { :email => self.email } ],\n :merge_vars => [{\n \"rcpt\" => self.email,\n \"vars\" => [{ \"content\" => \"there\", \"name\" => \"name\" }]\n }]\n }\n Applyance::Lib::Emails::Sender::send_template(template, message)\n\n end",
"def alteration_approve\n UserNotifier.deliver_in_process(self, user)\n end",
"def check_user_invite_status\n return if @user.accepted_or_not_invited?\n\n redirect_to users_path,\n alert: 'This user has not accepted his invitation yet.'\n end",
"def reminder_sent\n end",
"def send_claim_message!\n\t\tsubject = \"Event Claimed | %s (%s) | %s at %s\" % [resource.selected_game_game_system_join.game.title, resource.selected_game_game_system_join.game_system.abbreviation, (resource.start_date_time.strftime \"%m/%d\"), (resource.start_date_time.strftime \"%l:%M%P\") ]\n\t\tbody = \"[contract id=\\\"#{resource.id}\\\"]\"\n\t\tcurrent_user.send_message(resource.seller, body, subject, true, nil, Time.now, resource)\n\t\tNotificationWorker.perform_async(resource.id, 'Contract', 'Notifications::ContractNotification', 'claimed')\n\tend",
"def accepted\n OpportunityMailer.accepted\n end",
"def job_signup_canceled_notification\n UserMailer.job_signup_canceled_notification(User.first, Job.first)\n end",
"def accept_resource\n resource_class.accept_invitation!(update_resource_params)\n ## Report accepting invitation to analytics\n \n end",
"def insist_on_confirmation(meetup, user)\n @user = user\n @meetup = meetup\n @date = meetup.sessions.last.event.date\n I18n.with_locale(@user.locale) do\n mail(to: @user.email,\n subject: I18n.t('meetup_mailer.insist_on_confirmation.subject', \\\n meetup: @meetup.title), \\\n date: @date)\n end\n end",
"def invite\n service_response = AdminManagement::AdminUser::Invite::Send.new(params).perform\n render_api_response(service_response)\n end",
"def request_approved(request)\n @request = request\n @email = @request.clid + '@louisiana.edu'\n mail to: @email, subject: \"Room Change Request Approved\"\n end",
"def deliver_invite_to_resident(resident, user)\n enqueue(ResidentInvitation, resident.id, user.id)\n end",
"def successfully_applied_for_job\n flash[:alert] = \"You have applied for the job :)\"\n end",
"def proposal_to_a_board_members\n @inv = Invitation.find params[:inv]\n @acc = Accept.find params[:acc]\n\n @summary = []\n @summary << \"L'evento\"\n @summary << \", organizzato da #{@inv.organizer},\" unless @inv.organizer.blank?\n @summary << \" avrà luogo\"\n @summary << \" a #{@inv.location}\" unless @inv.location.blank?\n @summary << \" in data #{I18n.localize(@inv.from_date_and_time.to_date, format: :long_w_weekday)}\" if @inv.from_date_and_time\n @summary << \" e\" if !@inv.location.blank? || @inv.from_date_and_time\n @summary << \" avrà per tema '#{@inv.title}'.\"\n @summary = @summary.join\n # @url =\n @preheader = \"Proposta di partecipazione ad un evento in rappresentanza di ARERA\"\n\n user = Rails.env==\"development\" ? User.find_by(username: ENV[\"test_username\"]) : @acc.user\n\n Sidekiq::Logging.logger.info \"Sending an email 'Proposta di incarico' to #{user.display_name} [#{user.email}]\"\n mail(to: user.email, subject: 'Proposta di incarico')\n\n end",
"def calendly_invitee_created\n puts \"Webhook call received for event created by #{calendly_invitee_email}\"\n if Profile.email_exist?(calendly_invitee_email)\n # do nothing\n else\n send_mail_to_invitee\n send_mail_for_event_deletion\n\n\n # Send mail to user, to created profile on our site.\n # Delete Event from calendly, (No documentation for the same)\n end\n end",
"def invite(invite)\n @invite = invite\n mail(:to => invite.email, :subject => \"#{@invite.user.name} has invited you to the \\\"#{invite.idea.name}\\\" idea\", :tag => 'invite') \n end",
"def send_accept_invitation_mail(current_user)\n\t\tUserMailer.invitation_accepted(self, current_user).deliver_now\n\tend",
"def alert_rcvr\n InvitationMailer.mail_rcvr(self).deliver\n end",
"def msg_INVITE(source, args)\n return nil\n end",
"def new_user_waiting_for_approval(faculty)\n @faculty = faculty\n\n mail(to: 'rorteammaker@gmail.com', subject: 'A new faculty member is awaiting approval!', body: 'A new faculty member is awaiting your approval!')\n end",
"def send_acceptance_email\n # UserMailer.delay.send_accepted_email(user_id)\n end",
"def click(event)\n data = {\n agenda: Agenda.file,\n initials: User.initials,\n attach: @@item.attach,\n request: request\n }\n\n @disabled = true\n Pending.update 'approve', data do |pending|\n @disabled = false\n end\n end",
"def invite\n Notifications.invite\n end",
"def confirm\r\n # Change user status to active\r\n update(status: :active)\r\n # Update all pending company_roles to active\r\n company_roles.update_all(status: 1)\r\n NotifyMailer.welcome_mail(self).deliver_later\r\n super\r\n end",
"def claim_your_reward\n InviteMailer.claim_your_reward\n end",
"def applicant_invite\n require 'date' # For DateTime.new\n \n # Create Date time value\n date = params[:applicant].values\n meeting_time = DateTime.new(date[0].to_i, date[1].to_i, date[2].to_i, date[3].to_i, date[4].to_i, 0)\n \n @applicant = Applicant.find_by(id: params[:id])\n recruiter = @applicant.recruiter\n \n # Save meeting time\n params = ActionController::Parameters.new({\n applicant: {\n meeting: meeting_time\n }\n })\n @applicant.update(applicant_params(params))\n \n \n # Send emails\n UserMailer.with(applicant: @applicant, recruiter: recruiter, meeting_time: meeting_time).applicant_meeting_email.deliver_now\n UserMailer.with(applicant: @applicant, recruiter: recruiter, meeting_time: meeting_time).recruiter_meeting_email.deliver_now\n \n # Make calendar invitations.\n redirect_to new_interview_url(@applicant.id)\n\n #redirect_to \"/applicants/#{@applicant[:id]}\"\n end",
"def response(expo_attendee_id)\n @expo_attendee = ExpoAttendee.find(expo_attendee_id)\n mail(to: @expo_attendee.email, subject: \"#{@expo_attendee.first_name} , you've entered the draw to win two free movie tickets.\")\n end",
"def email_invitees(event, apptmnt)\n apptmnt.invitees.each do |invitee|\n user = User.find(invitee.user_id)\n payload = {:user => user, :appointment => apptmnt}\n Outboundmail.outbound_event(event, user, payload)\n end\n end",
"def send_outstanding_alert_to_approver(agency, user)\n setup_email\n body[:agency] = agency\n body[:user] = user\n recipients user.email\n subject \"Timesheet Approval Reminder\"\n end",
"def browse\n todaydate = Time.now.in_time_zone(\"US/Pacific\").to_date\n now = Time.now\n\n # grab upcoming contests that user can enter.\n @contests = Contest.in_range(current_user, todaydate, todaydate+1).eligible(current_user, now)\n \n # for realtime push testing: show fake contests only when user is admin\n if current_user.try(:admin)\n @contests += Contest.where(\"contest_start > ?\", Date.strptime(\"2030\",\"%Y\"))\n end\n\n end",
"def update_to_video_calendar_invite(virtual_hearing, email_recipient_info)\n create_calendar_event(virtual_hearing.hearing) do |event, time_zone, start_time|\n if email_recipient_info.title == HearingEmailRecipient::RECIPIENT_TITLES[:judge]\n # For judges, just cancel the original invitation.\n event.status = \"CANCELLED\"\n else\n template_context = {\n virtual_hearing: virtual_hearing,\n time_zone: time_zone,\n start_time_utc: start_time\n }\n\n event.status = \"CONFIRMED\"\n event.summary = summary(email_recipient_info)\n event.description = render_virtual_hearing_calendar_event_template(\n email_recipient_info, :changed_to_video, template_context\n )\n end\n end\n end",
"def invite(invited_jid,reason=\"no reason\",&blk)\n msg = connection.message_stanza(:to => jid) do\n x('x', 'xmlns' => Namespaces::MucUser) do\n x('invite', 'to' => invited_jid.to_s) do\n x('reason', reason) if reason\n end\n end\n end\n connection.send_stanza msg, &blk\n end",
"def enqueue_job\n BackgroundJob.enqueue(\n InviteJob,\n {\n manager_id: @invitee_manager[:id],\n invite_token: @invite_token\n }\n )\n\n success\n end",
"def succesfull_submission(offer)\n @greeting = \"Χαίρετε\"\n @user = User.find(offer.user_id)\n @offer = offer\n @procurement = Procurement.find(offer.procurement_id)\n\n mail to: @user.email, subject: '[E-Proc] Tender Submitted Succesfully'\n end",
"def update\n meeting = Meeting.find(@attending.meeting_id)\n notification_text = \"#{current_user.first_name} #{current_user.last_name} has accepted your invite to #{meeting.description}.\"\n Notification.create(user_id: meeting.organiser_id, message: notification_text)\n @attending.update(confirmed: true)\n redirect_to meetings_path\n end",
"def account_activated\n participant = Participant.first\n ParticipantMailer.account_activated(participant)\n end",
"def new_caitredette_service_notice(req)\n @req = req\n mail(subject: \"[team] New Caitredette Service Request Received\")\n end",
"def send_email_after_canceled_reactive\n\n #Do nothing if status not change\n return if(!self.status_changed?)\n\n contestants = self.users\n\n #For active challenge\n if(self.status)\n\n #Send email to creator\n UserMailer.challenge_reactivated_creator(self.creator, self).deliver\n\n #Send email to contestants\n contestants.each do |c|\n UserMailer.challenge_reactivated_contestant(c, self).deliver\n end\n\n #For canceled challenge\n else\n\n #Send email to creator\n UserMailer.challenge_canceled_creator(self.creator, self).deliver\n\n #Send email to contestants\n contestants.each do |c|\n UserMailer.challenge_canceled_contestant(c, self).deliver\n end\n end\n end",
"def send_invite_email(invite)\n @invite = invite\n log_email_sent(\"send invite\", @invite.email)\n mail(:to => @invite.email, :subject => \"You've been invited to a TrueGM League\")\n end",
"def alert(message)\n Delayed::Worker.logger.debug \"Setting Asq #{id} to be in alert.\"\n\n if in_alert?\n self.status = 'alert_still'\n else\n self.status = 'alert_new'\n log('warn', 'Asq is in alert')\n end\n\n store_results(message)\n check_for_related_tickets(self) if Settings.related_tickets\n finish_refresh\n end",
"def application_approved(exam_candidate)\n @exam_candidate = exam_candidate\n \n using_locale @exam_candidate.language do\n mail :to => @exam_candidate.email_address_with_name\n end\n end",
"def invited_and_create_notification(user, data_template, company)\n setup_email(user, company.id)\n @subject += 'Event Invitiation'\n @body[:url] = \"#{SITE}/activate/#{user.activation_code}\"\n @body[:loginurl] = \"#{SITE}/#{company.name}\"\n @support_email = \"#{SUPPORT_EMAIL}\"\n @invited_to_event = \"#{data_template.event.name}\"\n @invited_to_template = \"#{data_template.name}\"\n end",
"def accepted_tutor\n if waiting?\n UserMailer.accepted_tutor(self).deliver_now if waiting?\n self.accepted!\n end\n end",
"def atest_ID_25861_suspended_user_notification()\n # Need suspended account\n end",
"def atest_ID_25861_suspended_user_notification()\n # Need suspended account\n end",
"def job_posted_announcer_notification(job)\n @job = job\n @user = User.find(@job.user_id)\n mail(:subject => \"Anuncio enviado com sucesso.\", :to => @user.email)# for announcer and a hide copy to admin\n end"
] |
[
"0.6265306",
"0.62034196",
"0.61915934",
"0.61722887",
"0.6166607",
"0.6158446",
"0.61425185",
"0.61394966",
"0.613072",
"0.6121585",
"0.610391",
"0.610049",
"0.6031447",
"0.6030711",
"0.6020831",
"0.59820503",
"0.59682935",
"0.5959971",
"0.5951934",
"0.5947938",
"0.59401923",
"0.5918935",
"0.5898908",
"0.58911186",
"0.58846754",
"0.58771783",
"0.5876921",
"0.58639264",
"0.58624136",
"0.58604586",
"0.5811438",
"0.58034813",
"0.5802002",
"0.5783463",
"0.5775406",
"0.57668525",
"0.5763999",
"0.576268",
"0.5762479",
"0.573767",
"0.5733447",
"0.57251173",
"0.5723895",
"0.5719797",
"0.5713042",
"0.57080007",
"0.5705771",
"0.57006717",
"0.5696611",
"0.56920207",
"0.56912476",
"0.56882346",
"0.5683625",
"0.5674218",
"0.5663168",
"0.56572795",
"0.565522",
"0.5650242",
"0.56473136",
"0.56385595",
"0.5636004",
"0.56338435",
"0.56263137",
"0.5614334",
"0.560987",
"0.5606495",
"0.56051517",
"0.5603033",
"0.5592912",
"0.5590934",
"0.5584805",
"0.5581635",
"0.5573469",
"0.5572783",
"0.55703473",
"0.5567205",
"0.55645937",
"0.5562671",
"0.55570084",
"0.5551847",
"0.5548199",
"0.5547955",
"0.55457366",
"0.55451995",
"0.5541914",
"0.5534132",
"0.5530437",
"0.5530177",
"0.55285275",
"0.5523747",
"0.55226994",
"0.5516713",
"0.5514079",
"0.5512392",
"0.55084646",
"0.55081916",
"0.5507462",
"0.550403",
"0.550403",
"0.55039793"
] |
0.6614172
|
0
|
GET /implementations/1 GET /implementations/1.js
|
def show
render layout: 'wide_content'
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @implement = Implement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @implement }\n end\n end",
"def interface\n respond_to do |format|\n format.json {}\n end\n end",
"def new\n @implement = Implement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @implement }\n end\n end",
"def index\n #@project_implementations = ProjectImplementation.all\n @project = Project.find(params[:project_id])\n @project_implementations = ProjectImplementation.where(project_id: params[:project_id])\n end",
"def show\n @implement = Implement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @implement }\n end\n end",
"def index\n @s = Script.find(params[:script_id])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviews }\n end\n end",
"def fetch_experiment(id)\n url = @base + \"experiments/#{id}.json?token=#{@token}\"\n puts url\n response = JSON.parse(RestClient.get(url))\nend",
"def get; end",
"def get(url)\n raise \"Needs to be implemented\"\n end",
"def GET; end",
"def index\n @project_implementations = ProjectImplementation.all\n end",
"def show\n @api_javascript = Api::Javascript.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @api_javascript }\n end\n end",
"def show\n @req = @company.implementer_requests\n end",
"def index\n @api_javascripts = Api::Javascript.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_javascripts }\n end\n end",
"def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deities }\n format.js {}\n end\n end",
"def get\n end",
"def respond(); end",
"def show\n @external_script = ExternalScript.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @external_script }\n end\n end",
"def show\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment }\n end\n end",
"def show\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment }\n end\n end",
"def show\n @algorithm = Algorithm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @algorithm }\n end\n end",
"def apis; end",
"def show\n script = Script.find(params[:id])\n render json: script\n end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def get\n end",
"def index\n @responsibilities = Responsibility.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @responsibilities }\n end\n end",
"def show\n @testing_algorithm = TestingAlgorithm.find(params[:id])\n\n render json : @testing_algorithm\n end",
"def run\n report = \"Seriously::#{params[:id].to_s.classify}Guide::Base\".constantize.run(verbose: false)\n render json: report\n end",
"def index\n @integrations = Integration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @integrations }\n end\n end",
"def show\n @fhir_base_url = FhirBaseUrl.find(params[:id])\n\n respond_to do |format|\n format.html { redirect_to :action => :edit }\n format.json { render json: @fhir_base_url }\n end\n end",
"def index\n @efforts = Effort.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @efforts }\n end\n end",
"def get_content\n respond_to do |format|\n format.js\n end\n end",
"def get_content\n respond_to do |format|\n format.js\n end\n end",
"def api; end",
"def api; end",
"def index\n render jsonapi: Seances::UseCases::FetchAll.new.call\n end",
"def http; end",
"def index\n @experiments = Experiment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @experiments }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.haml\n format.js # index.js.rjs\n format.xml { render :xml => @usrs }\n format.json { render :json => @usrs }\n end\n end",
"def show\n @experiment_software = ExperimentSoftware.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @experiment_software }\n end\n end",
"def show\n @integral = Integral.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @integral }\n end\n end",
"def show\n @laboratory = Laboratory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @laboratory }\n end\n end",
"def index\n @interests = Interests.for_person(@person)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @interests }\n end\n end",
"def show\n render json: @laboratory\n end",
"def show\n @interpret = Interpret.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @interpret }\n format.js\n end\n end",
"def show\n @application = find_application\n @story = Story.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @story }\n format.js { render :js => request[:callback] + \"(\" + @story.descriptor + \")\" }\n end\n end",
"def index\n render json: usage(params[:type])\n end",
"def index\n @usages = get_usages\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usages }\n end\n end",
"def index\n if params[:format].nil? or params[:format] == 'html'\n @iteration = params[:iteration][/\\d+/] rescue 1\n @methods = Methods.sorted_order(\"#{sort_column('methods','name')} #{sort_direction}\").search(params[:search]).paginate(\n :page => params[:page], \n :per_page => params[:DataTables_Table_0_length]\n )\n log_searches(Methods)\n else # Allow url queries of data, with scopes, only xml & csv ( & json? )\n @methods = Methods.api_search(params)\n log_searches(Methods.method(:api_search), params)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.js\n format.xml { render :xml => @methods }\n end\n end",
"def implementation; end",
"def implementation; end",
"def show\n @routine_interview = RoutineInterview.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @routine_interview }\n end\n end",
"def load_methods\n resource :get, 'api/v1/users/me/slips/methods'\n end",
"def show\n render json: @exercise_template\n end",
"def show\n @exhibition = Exhibition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exhibition }\n end\n end",
"def index\n get_data\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @unit_of_measures }\n format.js\n end\n end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def show\n @impgen = Impgen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @impgen }\n end\n end",
"def index\n @facilitators = Facilitator.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @facilitators }\n end\n end",
"def get\n @research_output = @service.get({type: params[:graph], detail: params[:detail], id: params[:id]},\n host: request.env[\"HTTP_HOST\"], limit: params[:num_results], offset: params[:start_offset], :per_project => params[:per_project], format: params[:format])\n\n respond_with @research_output\n end",
"def show\n @effort = Effort.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @effort }\n end\n end",
"def index\n @current_section = 'accounts'\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accounts }\n format.js { render :partial => 'at_a_glance'}\n end\n end",
"def get(url); end",
"def create\n @implement = Implement.new(params[:implement])\n\n respond_to do |format|\n if @implement.save\n format.html { redirect_to @implement, notice: 'Implement was successfully created.' }\n format.json { render json: @implement, status: :created, location: @implement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @implement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_content_from_server(language)\n Browser::HTTP.get(\"try_ruby_#{language}.json\") do\n on :success do |response|\n TryRuby.instance.update_json(response.json)\n end\n\n on :failure do |response|\n puts \"\\nWhoops! Loading the tutorial failed \" \\\n \"(status = #{response.status_code}).\\n\" \\\n \"Please reload the page.\"\n end\n end\n end",
"def show\n @javascript = @site.javascripts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @javascript }\n end\n end",
"def index\n authorize(@project, policy_class: CitationPolicy)\n @citations = CitationSupplyingService.new.find_by_project_id(@project.id)\n respond_to do |format|\n format.fhir_xml { render xml: @citations }\n format.fhir_json { render json: @citations }\n format.html { render json: @citations }\n format.json { render json: @citations }\n format.xml { render xml: @citations }\n format.all { render text: 'Only HTML, JSON and XML are currently supported', status: 406 }\n end\n end",
"def index\n @pattern_systems = PatternSystem.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pattern_systems }\n format.js {render :json => @pattern_systems.inject([]){|result, element| result << {:name => element.name, :short_name => element.short_name}}.to_json}\n end\n end",
"def show\n @playground = Playground.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @playground, :callback => params[:callback] }\n end\n end",
"def show\n @strategyweb = Strategyweb.find(params[:id])\n\n respond_to do |format|\n format.html\n# format.json { render json: @strategyweb }\n end\n end",
"def show\n @prototype = Prototype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prototype }\n end\n end",
"def show\n @addimition = Addimition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @addimition }\n end\n end",
"def request\n raise 'need to be implemented'\n end",
"def show\n headers['Content-Type'] = \"application/javascript\"\n path = normalize_path(params[:js_path])\n p path\n return head(:forbidden) unless can_render_path?(path)\n compiled = Barista.compile_file!(path)\n compiled.nil? ? head(:not_found) : render(:text => compiled.to_s)\n end",
"def show\n authorize! :show, Dica\n respond_to do |format|\n format.html\n format.js\n end\n end",
"def new\n @api_javascript = Api::Javascript.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @api_javascript }\n end\n end",
"def show\n @strategy = Strategy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @strategy }\n end\n end",
"def show\n @installation = Installation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @installation }\n end\n end",
"def index\n respond_to do |format|\n format.html {\n @problems = Problem.feed\n }\n\n format.js {\n @problems = Problem.feed({ filter: params[:filter], \n sorter: params[:sorter],\n search_filter: params[:search_filter] })\n }\n end\n end",
"def show\n @scraping_algorithm = ScrapingAlgorithm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scraping_algorithm }\n end\n end"
] |
[
"0.6346865",
"0.5797082",
"0.5680824",
"0.5619362",
"0.55823195",
"0.55374527",
"0.54910177",
"0.5477331",
"0.5459867",
"0.5449342",
"0.54267836",
"0.5401884",
"0.53583854",
"0.53281885",
"0.53062326",
"0.52835166",
"0.5271254",
"0.52643394",
"0.523734",
"0.523734",
"0.52345014",
"0.52315974",
"0.5223797",
"0.5216671",
"0.5216671",
"0.5216671",
"0.5216671",
"0.5215426",
"0.5180718",
"0.516556",
"0.5164412",
"0.515646",
"0.51551867",
"0.5147208",
"0.5147072",
"0.5147072",
"0.51426595",
"0.51426595",
"0.5139787",
"0.51391363",
"0.513438",
"0.51334107",
"0.5132207",
"0.5131029",
"0.5128402",
"0.512603",
"0.5123898",
"0.51230204",
"0.5111456",
"0.5096441",
"0.5089909",
"0.5089737",
"0.50883245",
"0.50883245",
"0.5078197",
"0.5077164",
"0.5077057",
"0.5076871",
"0.50767845",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50617254",
"0.50606006",
"0.5056852",
"0.505356",
"0.5053464",
"0.5051293",
"0.5050105",
"0.5047325",
"0.5046849",
"0.5044034",
"0.50430006",
"0.50419545",
"0.504057",
"0.5034794",
"0.5031893",
"0.5029656",
"0.50280786",
"0.502391",
"0.502248",
"0.50154626",
"0.5013336",
"0.5013144",
"0.5011912",
"0.5010923"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def implementation_params
p = params.permit(:scenario_id)
p.merge params.require(:implementation).permit(:library_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 end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def valid_params_request?; end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def url_whitelist; end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.6980957",
"0.6783065",
"0.6747844",
"0.6741468",
"0.67356336",
"0.6592548",
"0.65036845",
"0.64978707",
"0.64825076",
"0.64795035",
"0.64560914",
"0.64397955",
"0.6379666",
"0.6376688",
"0.6366702",
"0.6319728",
"0.6300833",
"0.6300629",
"0.6294277",
"0.6293905",
"0.6291174",
"0.62905735",
"0.6283171",
"0.6242344",
"0.62403613",
"0.6218049",
"0.62143815",
"0.62104696",
"0.61949855",
"0.6178671",
"0.6176147",
"0.6173327",
"0.6163395",
"0.6153005",
"0.6151833",
"0.6147288",
"0.61224324",
"0.6118827",
"0.61075264",
"0.61054534",
"0.6092497",
"0.6080082",
"0.60710967",
"0.60627776",
"0.60219413",
"0.60175914",
"0.60153484",
"0.60107356",
"0.60081726",
"0.60081726",
"0.60013986",
"0.6000165",
"0.59978646",
"0.59936947",
"0.59925723",
"0.5992084",
"0.59796256",
"0.5967569",
"0.5960056",
"0.59589803",
"0.5958441",
"0.5958401",
"0.5952607",
"0.5952406",
"0.5944409",
"0.59391016",
"0.593842",
"0.593842",
"0.5933845",
"0.59312123",
"0.5926475",
"0.59248453",
"0.59179676",
"0.59109294",
"0.59101623",
"0.5908172",
"0.59058356",
"0.5899052",
"0.5897749",
"0.5896101",
"0.58942914",
"0.58939576",
"0.5892063",
"0.5887407",
"0.588292",
"0.58797663",
"0.587367",
"0.58681566",
"0.5868038",
"0.5866578",
"0.58665025",
"0.58655846",
"0.58640826",
"0.5863465",
"0.5862226",
"0.586065",
"0.58581287",
"0.5854443",
"0.5854172",
"0.58507544",
"0.5849934"
] |
0.0
|
-1
|
Write a function that accepts a positive number N. The function should console log a step shape with N levels using the character. Make sure the step has spaces on the right hand side! Examples steps(2) ' ' '' steps(3) ' ' ' ' '' steps(4) ' ' ' ' ' ' ''
|
def steps(n)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def steps (n, row = 0, stair = '')\n return if n == row\n\n if n == stair.length\n puts stair\n return steps(n, row + 1)\n end\n\n stair.length <= row ? stair += '#' : stair += ' '\n\n steps(n, row, stair)\nend",
"def how_many_steps?\n puts \"Left\"\n puts \"Right\"\n puts \"/1\\nRight\\n2\\nLeft/\"\n puts \"/3/\"\n puts \"/4/\"\n puts \"/5/\"\n puts \"/6/\"\nend",
"def steps (x, y, path)\n if x == 0 && y == 0\n then puts (path)\n return\n end\n if x > 0\n then steps(x - 1, y, path + \"R\")\n steps(x - 1, y + 1, path + \"L\")\n end\n if y > 0\n then steps(x, y - 1, path + \"H\")\n end\nend",
"def num_steps(n)\n # if n = 1\n # 1\n # elsif n = 2\n # 2\n # elsif n = 3\n # num_steps(1) + num_steps(2)\n # elsif n = 4\n # num_steps(2) + num_steps(3)\n # end\n if n < 3\n n\n else\n num_steps(n-2) + num_steps(n-1)\n end\nend",
"def num_steps(n)\n return 1 if n <= 1\n num_steps(n-1) + num_steps(n-2)\nend",
"def tab(n, *string)\r\n string.each_with_index { |e, i| i == 0 ? (puts \" \" * n + e) : (puts e) }\r\n end",
"def num_steps(n)\n if n < 4\n initial = [1,2,4]\n return initial[n-1]\n else\n num_steps(n-1) + num_steps(n-2) + num_steps(n-3)\n end\nend",
"def triangle(n)\n 1.upto(n){ |i| p \"#{' ' * (n-i)}#{ '*' * i }\" }\nend",
"def format_step_number(number)\n \"#{number}. \"\n end",
"def stepPerms(n)\n return 0 if n < 0\n return 1 if n == 0\n \n stepPerms(n - 1) + stepPerms(n - 2) + stepPerms(n - 3)\nend",
"def kaprekar_step(n)\n\n # TODO: Solve it!\n\n end",
"def print_stairs n, str\n\ts = str;\n\tn.times {|n| puts s; s += str}\nend",
"def generate_shape(n)\n p (\"+\" * n + \"\\n\") * (n - 1) + \"+\" * n\nend",
"def level_print(message, count)\n\n if count > 0\n indention = \"\"\n indention += \" \" until indention.length() == 2*count\n print indention\n end\n\n puts message\nend",
"def n_steps(stairs)\n return 1 if stairs <= 1 \n count = 0\n count += n_steps(stairs - 1) + n_steps(stairs - 2)\nend",
"def full_pyramid\n\n#On salut notre visiteur\n\tputs \"Salut, bienvenue dans ma super pyramide ! Combien d'etages veux-tu ?\"\n\tprint \"> \"\n\n#On demande le nombre d'étages\n\tsteps = gets.chomp.to_i\n\n#On affiche la pyramide\n\tputs \"Voici la pyramide :\"\n\tsteps.times do |i|\n\tputs \" \" * (steps - ( i + 1 )) + \"#\" * ( 2 * i + 1) + \" \" * (steps - ( i + 1 ))\nend\nend",
"def letra_i(n)\n result = \"\"\n n.times do |i|\n if i == 0 || i == n-1\n n.times {result += \"*\"} \n else\n n.times do |b|\n if (n-1)/2 == b\n result += \"*\"\n else\n result += \" \"\n end\n end\n end \n result += \"\\n\" \n end \n result\nend",
"def diamond_enum_sol(n, full:true)\n step_one_to_n_to_one(n).each do |i|\n line = full || i == 1 ? '*' * i : '*' +' ' * (i - 2) + '*'\n puts line.center(n)\n end\nend",
"def yummie(n)\r\n\r\n print \"(\"\r\n (1..n).each{\r\n print \" \"\r\n }\r\n print \".\"\r\n (1..n).each{\r\n print \" \"\r\n }\r\n print \"v\"\r\n (1..n).each{\r\n print \" \"\r\n }\r\n print \".\"\r\n (1..n).each{\r\n print \" \"\r\n }\r\n print \")\"\r\n\r\nend",
"def border(n)\r\n puts \"-\" * n\r\n end",
"def step_test\n 3.upto(6) do |x|\n puts \" \"\n x.upto(x + 2) do |i|\n print \"#{i}\\t\"\n end\n end\nend",
"def triangle(n)\n n.downto(1) do |i|\n puts \"#{'*' * i}#{' ' * (n-i)}\"\n end\nend",
"def steps(value)\n factor = 10**(Math.log10(value).floor - 1)\n case \n when value < factor * 10\n factor\n when value < 5 * factor * 10\n 5 * factor\n else\n 10 * factor\n end\n end",
"def steps(value)\n factor = 10**(Math.log10(value).floor - 1)\n case \n when value < factor * 10\n factor\n when value < 5 * factor * 10\n 5 * factor\n else\n 10 * factor\n end\n end",
"def step(words)\n @step ||= 0\n @step += 1\n \"#{@step}) #{words}\\n\"\n end",
"def pyramid(n)\n count = 1\n n.times do\n puts (\" \" * (n - count)) + (\"#\" * count)\n count += 1\n end\nend",
"def triangle(n)\n n.times{ |i| puts \"#{' ' * (n-i+1)}#{'*' * (i+1)}\" }\nend",
"def n_dots(n) \n retval = \"\"\n (0...n).each do \n retval += \"X\"\n end\n return retval\nend",
"def a_few_more_steps\n puts \"Turn\"\n puts \"Left foot crosses over right\"\n puts \"Right foot steps right and back\"\n puts \"Stop\"\n puts \"Left foot back\"\n puts \"Right foot back\"\nend",
"def triangles(n)\n space_count = n\n star_count = 1\n\n while star_count <= n\n puts \"#{' ' * space_count}#{'*' * star_count}\"\n space_count -= 1\n star_count += 1\n end\nend",
"def letra_x(n)\n result = \"\" \n t = n-1\n (n).times do |i| \n n.times do |b| \n if t == b \n result += \"*\"\n elsif i == b\n result += \"*\"\n else\n result += \" \"\n end\n end \n t -= 1 \n result += \"\\n\"\n end\n result\nend",
"def stairs(n)\n\ttext_to_print = \"\"\n\tn.times do |line|\n\t\ttext_to_print += (\" \" * (n-1)) + (\"*\" * (n-(n-1))) \n\t\ttext_to_print << \"\\n\"\n\t\tn -= 1\n\tend\n\ttext_to_print.split(\"\\n\").each{|line| puts line}\nend",
"def triangle(n)\n stars = 1\n spaces = n-1\n n.times do |_|\n puts ( \" \" * spaces) + (\"*\" * stars)\n stars += 1\n spaces -= 1\n end\nend",
"def triangle(n)\n counter = 1\n\n loop do\n puts \"#{' ' * (n-counter)}#{'*' * counter}\"\n counter += 1\n break if counter > n\n end\nend",
"def create_line(num)\n '-' * num\nend",
"def print_line(str, num = 1)\n num.times { print str}\nend",
"def step(steps)\r\n\tdirection = (steps > 0) ? :brighten : :dim\r\n\tnsteps = steps.abs\r\n\twhile nsteps > 0\r\n\t n = (nsteps > 6) ? 6 : nsteps\r\n\t @controller.command(@house, @unit, direction, n)\r\n\t nsteps -= n\r\n\tend\r\n end",
"def display_board(board=[\" \", \" \", \" \", \" \", \"X\", \" \", \" \", \" \", \" \"])\n 0.step(6,3) do |i|\n if (i<6)\n puts \" #{board[i]} | #{board[i+1]} | #{board[i+2]} \"\n puts \"-----------\"\n else\n puts \" #{board[i]} | #{board[i+1]} | #{board[i+2]} \"\n end\n end\nend",
"def expansion(n)\n \"1 + 1/#{nesting(n)}\"\nend",
"def printStep(min,max, step)\n i = min\n while i <= max\n puts i\n i += step\n end\nend",
"def staircase(n)\n n.times do |i|\n (n-1-i).times { |i| print ' '}\n (i+1).times { |i| print '#'}\n puts\n end\nend",
"def print_game_state (game_state, count)\n\tcase game_state\n\t\twhen 0\n\t\t\tputs \" \"\n\t\t\tputs \" \"\n\t\t\tputs \" _______10\"\n\t\t\tputs \" ___|9\"\n\t\t\tputs \" ___|8\"\n\t\t\tputs \" ___|7\"\n\t\t\tputs \" ___|6\"\n\t\t\tputs \" ___|5\"\n\t\t\tputs \" ___|4\"\n\t\t\tputs \" ___|3\"\n\t\t\tputs \" o ___|2\"\n\t\t\tputs \" /|\\\\ ___|1 You rolled the dice #{count} times\" \n\t\t\tputs \" /_\\\\__|0 You are at Step : 0\"\n\t\twhen 1\n\t\t\tputs \"\"\n\t\t\tputs \" \"\n\t\t\tputs \" _______10\"\n\t\t\tputs \" ___|9\"\n\t\t\tputs \" ___|8\"\n\t\t\tputs \" ___|7\"\n\t\t\tputs \" ___|6\"\n\t\t\tputs \" ___|5\"\n\t\t\tputs \" ___|4\"\n\t\t\tputs \" o ___|3\"\n\t\t\tputs \" /|\\\\ ___|2\"\n\t\t\tputs \" /_\\\\__|1 You rolled the dice #{count} times\" \n\t\t\tputs \" ___|0 You are at Step : 1\"\n\t\twhen 2\n\t\t\tputs \"\"\n\t\t\tputs \" \"\n\t\t\tputs \" _______10\"\n\t\t\tputs \" ___|9\"\n\t\t\tputs \" ___|8\"\n\t\t\tputs \" ___|7\"\n\t\t\tputs \" ___|6\"\n\t\t\tputs \" ___|5\"\n\t\t\tputs \" o ___|4\"\n\t\t\tputs \" /|\\\\ ___|3\"\n\t\t\tputs \" /_\\\\__|2\"\n\t\t\tputs \" ___|1 You rolled the dice #{count} times\" \n\t\t\tputs \" ___|0 You are at Step : 2\"\n\t\twhen 3\n\t\t\tputs \"\"\n\t\t\tputs \" \"\n\t\t\tputs \" _______10\"\n\t\t\tputs \" ___|9\"\n\t\t\tputs \" ___|8\"\n\t\t\tputs \" ___|7\"\n\t\t\tputs \" ___|6\"\n\t\t\tputs \" o ___|5\"\n\t\t\tputs \" /|\\\\ ___|4\"\n\t\t\tputs \" /_\\\\__|3\"\n\t\t\tputs \" ___|2\"\n\t\t\tputs \" ___|1 You rolled the dice #{count} times \" \n\t\t\tputs \" ___|0 You are at Step : 3\"\n\t\twhen 4\n\t\t\tputs \"\"\n\t\t\tputs \" \"\n\t\t\tputs \" _______10\"\n\t\t\tputs \" ___|9\"\n\t\t\tputs \" ___|8\"\n\t\t\tputs \" ___|7\"\n\t\t\tputs \" o ___|6\"\n\t\t\tputs \" /|\\\\ ___|5\"\n\t\t\tputs \" /_\\\\__|4\"\n\t\t\tputs \" ___|3\"\n\t\t\tputs \" ___|2\"\n\t\t\tputs \" ___|1 You rolled the dice #{count} times \" \n\t\t\tputs \" ___|0 You are at Step : 4\"\n\t\twhen 5\n\t\t\tputs \"\"\n\t\t\tputs \" \"\n\t\t\tputs \" _______10\"\n\t\t\tputs \" ___|9\"\n\t\t\tputs \" ___|8\"\n\t\t\tputs \" o ___|7\"\n\t\t\tputs \" /|\\\\ ___|6\"\n\t\t\tputs \" /_\\\\__|5\"\n\t\t\tputs \" ___|4\"\n\t\t\tputs \" ___|3\"\n\t\t\tputs \" ___|2\"\n\t\t\tputs \" ___|1 You rolled the dice #{count} times\" \n\t\t\tputs \" ___|0 You are at Step : 5\"\n\t\twhen 6\n\t\t\tputs \"\"\n\t\t\tputs \" \"\n\t\t\tputs \" _______10\"\n\t\t\tputs \" ___|9\"\n\t\t\tputs \" o ___|8\"\n\t\t\tputs \" /|\\\\ ___|7\"\n\t\t\tputs \" /_\\\\__|6\"\n\t\t\tputs \" ___|5\"\n\t\t\tputs \" ___|4\"\n\t\t\tputs \" ___|3\"\n\t\t\tputs \" ___|2\"\n\t\t\tputs \" ___|1 You rolled the dice #{count} times \" \n\t\t\tputs \" ___|0 You are at Step : 6\"\n\t\twhen 7\n\t\t\tputs \"\"\n\t\t\tputs \" \"\n\t\t\tputs \" _______10\"\n\t\t\tputs \" o ___|9\"\n\t\t\tputs \" /|\\\\ ___|8\"\n\t\t\tputs \" /_\\\\__|7\"\n\t\t\tputs \" ___|6\"\n\t\t\tputs \" ___|5\"\n\t\t\tputs \" ___|4\"\n\t\t\tputs \" ___|3\"\n\t\t\tputs \" ___|2\"\n\t\t\tputs \" ___|1 You rolled the dice #{count} times \" \n\t\t\tputs \" ___|0 You are at Step : 7\"\n\t\twhen 8\n\t\t\tputs \"\"\n\t\t\tputs \" \"\n\t\t\tputs \" o _______10\"\n\t\t\tputs \" /|\\\\ ___|9\"\n\t\t\tputs \" /_\\\\ __|8\"\n\t\t\tputs \" ___|7\"\n\t\t\tputs \" ___|6\"\n\t\t\tputs \" ___|5\"\n\t\t\tputs \" ___|4\"\n\t\t\tputs \" ___|3\"\n\t\t\tputs \" ___|2\"\n\t\t\tputs \" ___|1 You rolled the dice #{count} times \" \n\t\t\tputs \" ___|0 You are at Step : 8\"\n\t\twhen 9\n\t\t\tputs \"\"\n\t\t\tputs \" o \"\n\t\t\tputs \" /|\\\\ _______10\"\n\t\t\tputs \" /_\\\\ __|9\"\n\t\t\tputs \" ___|8\"\n\t\t\tputs \" ___|7\"\n\t\t\tputs \" ___|6\"\n\t\t\tputs \" ___|5\"\n\t\t\tputs \" ___|4\"\n\t\t\tputs \" ___|3\"\n\t\t\tputs \" ___|2\"\n\t\t\tputs \" ___|1 You rolled the dice #{count} times \" \n\t\t\tputs \" ___|0 You are at Step : 9\"\n\t\twhen 10\n\t\t\tputs \" o\"\n\t\t\tputs \" /|\\\\ \"\n\t\t\tputs \" /_\\\\______10\"\n\t\t\tputs \" ___|9\"\n\t\t\tputs \" ___|8\"\n\t\t\tputs \" ___|7\"\n\t\t\tputs \" ___|6\"\n\t\t\tputs \" ___|5\"\n\t\t\tputs \" ___|4\"\n\t\t\tputs \" ___|3\"\n\t\t\tputs \" ___|2\"\n\t\t\tputs \" ___|1 You rolled the dice #{count} times \" \n\t\t\tputs \" ___|0 You are at Step : 10\"\n\t\telse\n\t\t\tputs \"ERROR with the game_state\"\n\t\tend\nend",
"def tl_triangle(n)\n stars = n\n n.times do\n puts '*' * stars\n stars -= 1\n end\nend",
"def pyramid\r\n upper_level = \"1\"\r\n triangle = [upper_level]\r\n 40.times do\r\n triangle << upper_level = lower_level(upper_level)\r\n end\r\n triangle\r\nend",
"def how_many_steps?\n steps=0\n loop do\n steps += 1\n puts \"Add another step\"\n break\nend\nend",
"def print_separator(repetitions = 18)\n puts '-' * repetitions\nend",
"def nth_expansion(n)\n n==0 ? \"2\" : \"2+ 1/#{nest(n-1)}\"\nend",
"def f(n)\n sum = (\"1\"*n).to_i # the last number of the sequence is n 1's\n # start with single digit if possible\n sum += n if n.to_s.length == 1\n # 2 digits next\n x = 2\n puts terms_of_n_with_length_x(n,x).inspect\n puts \"got here\"\n puts n-1\n (1..(n-1)).to_a.reverse.each do |x|\n puts x\n puts eat_2s(x)\n end\n return sum\nend",
"def tower_builder(n)\n (1..n)\n .map { |i| ' ' * (n - i) + '*' * (i + i - 1) + ' ' * (n - i) }\nend",
"def triangle(n)\n (1..n).each { |row| puts ' ' * (n - row) + '*' * row }\nend",
"def step(number_steps = 1)\n @current_progress+= number_steps\n if ((@current_progress - number_steps) / @steps_per_progress_bar_marker).to_i \\\n < (@current_progress / @steps_per_progress_bar_marker).to_i\n @marker_counter += 1\n putc '.' \n puts if @marker_counter == @bar_length # after the last marker is printed, add a new_line\n $stdout.flush\n end\n end",
"def step\n n = gets\n if n == nil\n puts \"\"\n return 0\n end\n n.chomp!\n meth = n.split(' ')[0]\n if n.split(' ').size > 1\n arg = n[n.index(' ')..-1].strip\n else\n arg = nil\n end\n if commands.keys.include?(meth)\n commands[meth].call( arg )\n else\n puts \"Command '#{meth}' not recognized.\"\n end\n end",
"def half_pyramid\n puts \"entrer un nombre d'etage de votre choix\"\n nombre = gets.chomp.to_i\n nombre += 1\n\n nombre.times do |j|\n has = \"# \"\n puts \" #{has*=j}\"\n \n end\nend",
"def routine(n)\n print n, ' '\n throw :done if n <= 0\n routine(n-1)\n end",
"def triangle(n)\n line = 0\n loop do\n puts ' ' * (n - line) + ('*' * line)\n break if line == n\n line += 1\n end\nend",
"def letra_z(n)\n result = \"\"\n t = n-1\n n.times do |i| \n if i == 0 || i == n-1\n n.times {result += \"*\"} \n else \n n.times do |b| \n if t == b\n result += \"*\"\n else\n result += \" \"\n end\n end\n end \n t -= 1 \n result += \"\\n\" \n end \n result\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 }\nend",
"def take_steps(n, steps = 1)\n\treturn 0 if n < 0\n\n\treturn 1 if n == 0\n\treturn @hash[n] unless @hash[n].nil?\n\t\n\t@hash[n] = take_steps(n - 1) + take_steps(n - 2) + take_steps(n - 3)\n\treturn @hash[n]\nend",
"def bug_segment(win, default=0)\n reward = win - default\n reward.times do\n puts extend_bug_line_1 = \" ---- \"\n puts extend_bug_line_2 = \"/ \\\\\"\n puts extend_bug_line_3 = \"l====l\"\n end\nend",
"def pyramid(height)\n height.times do |n|\n print ' ' * (height - n)\n puts '#' * (2 * n + 1)\n end\n\nend",
"def triangle(n)\n triangle = (1..n).inject('') do |memo, current_num|\n stars = '*' * current_num\n line = stars.rjust(n) + \"\\n\"\n memo + line\n end\n puts \"\\n\" + triangle + \"\\n\"\nend",
"def pyramid(height)\n level = 1\n height.times do\n puts \" \"*(height-level) + \"#\"*level + \" \"*2 + \"#\"*level\n level += 1\n end \n \nend",
"def pyramid(num, row = 0, level = '')\n return if num === row\n\n if 2 * num - 1 === level.length\n puts level\n return pyramid(num, row + 1)\n end\n\n mid_point = (2 * num - 1) / 2\n if mid_point - row <= level.length && mid_point + row >= level.length\n level += '#'\n else\n level += ' '\n end\n\n pyramid(num, row, level)\nend",
"def next_step(n)\n if n.even?\n n/2.to_i\n else\n 3*n+1\n end\nend",
"def story(n, initial_words = nil)\n elems = generate(n, initial_words)\n format(elems)\n end",
"def navidad(n)\n result = \"\"\n n.times do |ind| \n i = ind + 1 \n (n-i).times do \n result += \" \"\n end\n i.times do\n result += \"* \" \n end\n result += \"\\n\" \n end\n \n 3.times do |i|\n if i != 2\n n.times do |b|\n if (n+1)/2 == b+1\n result += \"* \"\n else\n result += \" \"\n end \n end\n result += \"\\n\"\n else\n n.times do |b| \n if ((n+1)/2)-2 == b || ((n+1)/2)-1 == b || (n+1)/2 == b\n result += \"* \"\n else\n result += \" \"\n end \n end\n end\n end \n result\nend",
"def triangle(n)\n count = 1\n loop do\n p (' ' * (n - count)) + ('*' * count)\n count += 1\n break if count > n\n end\nend",
"def gamma_fnc(n)\n return nil if n < 1\n return 1 if n == 1\n\n gamma_fnc(n-1) * (n - 1)\nend",
"def path_count(steps, current=0)\n if current == steps\n 1\n elsif current > steps\n 0\n else\n path_count(steps, current + 1) +\n path_count(steps, current + 2) +\n path_count(steps, current + 3)\n end\nend",
"def ne(length_of_sides)\n spaces = length_of_sides\n accum_num = length_of_sides\n length_of_sides.times do\n puts \"#{' ' * (spaces - accum_num)}#{'*' * accum_num}\"\n accum_num -= 1\n end\nend",
"def depth_char(depth, depth_char = \"--\")\n char = \"\"\n depth.times do |d|\n char << depth_char\n end\n char\n end",
"def tab(str, n=1, chr=' ')\n chr * n + str\nend",
"def range_print_10\n (0..9).step(1) do |n| \n puts n \n end \n \nend",
"def stair_climb(n, step_sizes = [1, 2, 3], poss_steps = { 0 => [[]] })\n (1..n).each do |current_step|\n poss_steps[current_step] = []\n\n step_sizes.each do |next_step|\n last_counts = current_step - next_step\n next if last_counts < 0\n\n poss_steps[last_counts].each do |count|\n poss_steps[current_step] += [count + [next_step]]\n end\n end\n end\n\n poss_steps[n]\n end",
"def bottles(n)\n if n == 0 \n puts 'no more bottles of beer on the wall'\n else\n puts \"#{n} bottles of beer on the wall \"\n bottles(n-1)\n end\nend",
"def up(n = nil)\n CSI + \"#{(n || 1)}A\"\n end",
"def steps\n steps_keywords = %w(Given When Then And But)\n nsteps = 0\n @steps = []\n while true\n print \"Add step [Y/n]: \"\n choice = gets\n if choice.downcase.strip != \"n\"\n puts \"Step #{nsteps +1}:\"\n step = gets.capitalize\n init_step_word = step.split(' ').first\n if steps_keywords.include?(init_step_word)\n @steps << step\n nsteps = nsteps ++ 1\n else\n puts \"Error: #{init_step_word} unsupported initial value\"\n puts \"Use only #{steps_keywords} keywords\"\n end\n elsif choice.downcase.strip == \"n\"\n break\n else\n \"please enter a valid choice.\"\n end\n end\n write_feature\n end",
"def hailstone1(num)\n count = 0\n\n if num == 1\n print \"#{num} \"\n num = (num * 3) + 1\n count += 1\n end\n\n print \"#{num} \"\n\n hailoop(num, count)\n\n puts\n puts \"HAILSTONE 1 - Number of steps: #{count}\"\nend",
"def triangle(n)\n arr = []\n space = (n - 1)\n star = 1\n \n until n == 0 do\n (space).times do\n arr.push(\" \")\n end\n (star).times do \n arr.push(\"*\")\n end\n puts arr.join\n arr.clear\n space -= 1\n star += 1\n n -= 1\n end\nend",
"def nesting(n)\n $nest[n] ||= \"(2 + 1/#{nesting(n-1)})\"\nend",
"def line(length)\r\n puts '-'*length\r\n end",
"def climb_stairs(n)\n climb_stairs_helper(n, 0, {})\nend",
"def create_string(value, n)\n value.length < 3 ? value * n : value[0..2] * n\nend",
"def gamma_fnc(n)\r\n return nil if n <= 0\r\n return 1 if n <= 2\r\n (n - 1) * gamma_fnc(n-1)\r\n end",
"def generate_parenthesis(n)\n ans = []\n backtrack(ans, '', 0, 0, n)\n ans\nend",
"def triangle(num)\n spaces = num - 1\n stars = 1\n\n num.times do |n|\n puts (' ' * spaces) + ('*' * stars)\n spaces -= 1\n stars += 1\n end\n\nend",
"def pluralizer string, n\n if n == 1 \n puts \"#{n} #{string}\"\n elsif n > 1 || n==0\n puts \"#{n} #{string}s\"\n end\nend",
"def bottles(n, total = n)\n\n puts english_number(n).capitalize + \" bottles of beer on the wall, \" +\n english_number(n) + \" bottles of beer.\"\n puts \"Take one down and pass it around, \" + english_number(n-1) +\n \" bottle#{n-1==1 ? '' : 's'} of beer on the wall.\"\n puts\n\n # recursion\n if n > 2\n bottles(n-1, total)\n else\n puts \"1 bottle of beer on the wall. 1 bottle of beer.\"\n puts \"Take one down and pass it around, no more bottles of beer on the wall.\"\n puts\n puts \"No more bottles of beer on the wall. No more bottles of beer.\"\n puts \"Go to the store and buy some more, \" + english_number(total) +\n \" bottles of beer on the wall.\"\n puts\n end\nend",
"def repeat (a, n = 2)\n [a] * n * ' '\nend",
"def triangle(length_of_sides)\n spaces = length_of_sides\n accum_num = 1\n length_of_sides.times do\n puts \"#{' ' * (spaces - accum_num)}#{'*' * accum_num}\"\n accum_num += 1\n end\nend",
"def gamma_fnc(n)\n return nil if n == 0\n return 1 if n == 1\n gamma_fnc(n - 1) * (n - 1)\n\n\n # n = (n - 1)!\n # n = 4\n # 3! = 3 * 2 * 1\n # 3 => 2 3-1 = 2\n # 2 => 1 2-1 = 1\n\nend",
"def triangle(number)\n number_of_spaces = number - 1\n number.times do\n puts (' ' * number_of_spaces) + ('*' * (number - number_of_spaces))\n number_of_spaces -= 1\n end\nend",
"def triangle(length_of_sides)\n spaces = length_of_sides\n accum_num = length_of_sides\n length_of_sides.times do\n puts \"#{' ' * (spaces - accum_num)}#{'*' * accum_num}\"\n accum_num -= 1\n end\nend",
"def bottles(n)\n if n == 0\n puts 'no more bottles of beer on the wall'\n else\n puts \"#{n} bottles of beer on the wall\"\n bottles(n - 1)\n end\nend",
"def x(n)\n end",
"def triangle(num)\n spaces = num - 1\n count = 1\n loop do\n puts \" \" * spaces + \"*\" * count\n spaces -= 1\n count += 1\n break if count == num + 1\n end\nend",
"def gamma_fnc(n)\n return nil if n == 0\n return 1 if n <= 1\n (n-1)*gamma_fnc(n - 1)\nend",
"def print_spacing spaces\n spaces.times do\n puts \"\\n\"\n end\nend",
"def pretty_step step\n step.sub!(\"Given\", \"<div class='spector-keyword'>Given</div>\")\n step.sub!(\"When\", \"<div class='spector-keyword'>When</div>\") \n step.sub!(\"Then\", \"<div class='spector-keyword'>Then</div>\") \n step.sub!(\"And\", \"<div class='spector-keyword'>And</div>\")\n if step.include?(\"#\")\n step = \"<div class='spector-comment'>#{step}</div>\"\n end\n step = step.split(\"\\\"\").in_groups_of(2).map{|a,b| b.nil? ? a : \"#{a}<div class='spector-quote'>\\\"#{b}\\\"</div>\"}.join\n step\n end",
"def triangle(num)\n 1.upto(num) { |n| puts \"#{\"*\" * n}\".rjust(num) }\nend"
] |
[
"0.72871125",
"0.66319036",
"0.6181501",
"0.6157394",
"0.6135781",
"0.608254",
"0.60357237",
"0.59547776",
"0.59492236",
"0.59403527",
"0.5890433",
"0.58537525",
"0.5842024",
"0.5811479",
"0.5797087",
"0.5797031",
"0.5795863",
"0.57883704",
"0.5744695",
"0.57434213",
"0.5724045",
"0.5695374",
"0.5684396",
"0.5684396",
"0.56734097",
"0.5671538",
"0.56635636",
"0.565323",
"0.5650073",
"0.5631127",
"0.5628177",
"0.5624036",
"0.56156003",
"0.5601361",
"0.5530201",
"0.55013114",
"0.5499812",
"0.54988295",
"0.54733",
"0.54706633",
"0.54643077",
"0.5451414",
"0.54502964",
"0.54446155",
"0.5430396",
"0.54300636",
"0.54295146",
"0.54279995",
"0.54128116",
"0.5405578",
"0.540262",
"0.53983456",
"0.53891635",
"0.5379937",
"0.53778744",
"0.5375046",
"0.53690004",
"0.5367873",
"0.53657264",
"0.5354578",
"0.5351328",
"0.53497046",
"0.5345028",
"0.5337661",
"0.5312823",
"0.5310032",
"0.5307539",
"0.5296501",
"0.52826226",
"0.5259936",
"0.52595705",
"0.525931",
"0.5257014",
"0.5254227",
"0.5245646",
"0.5243812",
"0.5240178",
"0.5235129",
"0.52297527",
"0.5211621",
"0.52112937",
"0.52107865",
"0.52068096",
"0.5202352",
"0.5199141",
"0.5195453",
"0.5194021",
"0.51923245",
"0.5191039",
"0.51882",
"0.5187731",
"0.5187096",
"0.5187021",
"0.5186735",
"0.5186193",
"0.51841146",
"0.5178059",
"0.51777357",
"0.5173441",
"0.5171288"
] |
0.69546527
|
1
|
helper to decide if a user is online student or normal student
|
def is_a_online_student?
current_user.mode == "Online" ? true : false
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def current_user_is_student?\n if current_user.user_type == \"student\"\n true\n else\n redirect_to user_path(@current_user)\n end\n end",
"def logged_in_as_student?\n !current_student.nil?\n end",
"def student?\n return logged_in? && (current_user.class == Student)\n end",
"def student?\n @student = true if session[:role_name] == 'Student'\n end",
"def student_logged_in?\n !current_student.nil?\n end",
"def student?\n return self.eduPersonAffiliation==\"student\"\n end",
"def current_user_is_student\n if !current_user || current_user.role != 'student'\n head(403)\n end\n end",
"def is_student?\n self.role==\"student\"\n end",
"def student?\n false\n end",
"def student_logged_in?\n @student_logged_in ||= user_signed_in? and cur_student\n end",
"def student?\n self.role == \"student\"\n end",
"def student_only?(sfuid)\n result = roles sfuid\n if result.join(\"\").eql? \"undergrad\"\n return true\n end\n false\n end",
"def online? login\n return false if !@usrData\n return true if @usrData[login]\n false\n end",
"def admin?\n\tif session[:student_id].nil?\n\t\treturn\n\telse\n signed_in? == true\n\t@current_student == Student.find_by_id(24)\n\tend\nend",
"def current_user_is_school_admin?\n current_user.admin_profile ? true : false\n end",
"def student?\n return true if student\n\n student_email?(email)\n end",
"def check_student\n if !current_student\n redirect_to :root, notice: \"You are not logged in as student\"\n end \n end",
"def student_user\n unless this_is_studente?(current_user)\n flash[:danger] = \"You don't have the rights for this page.\"\n redirect_to(root_url)\n end\n end",
"def cur_student\n @current_student ||= current_user if user_signed_in? and current_user.class.name == \"Student\"\n end",
"def senior?\n\t\tgrade == 12\n\tend",
"def must_be_student\n unless current_user.role.name.eql?('Student')\n flash[:error] = \"Access denied.\"\n redirect_to root_url\n end\n end",
"def real_student?\n student? && !phantom\n end",
"def show\n if session[:student_current_user].nil?\n @login= false\n else\n @login=true\n end\n end",
"def is_student?\n student.nil?\n end",
"def user_is_current\n @user_is_current || 'Y'\n end",
"def student?\n if self.role and self.role == 4 \n true\n end\n end",
"def require_student\n redirect_to root_path unless @auth_user && @auth_user.type == 'Student'\n end",
"def become_student\n\t\tclassroom_ids = @current_teacher_user.classrooms.pluck(:id)\n\t\tif !ClassroomStudentUser.where({student_user_id: params[:student_user_id], classroom_id: classroom_ids}).first.nil?\n\t\t\tsession[:student_user_id] = params[:student_user_id]\n\t\t\trender json: {status: \"success\"}\n\t\telse\n\t\t\trender json: {status: \"error\", error: \"invalid-student-user-id-or-classroom-id\"}\n\t\tend\n\tend",
"def is_user?\ncurrent_user.username == @userl.username\n end",
"def non_student?\n !self.has_role?('student')\n end",
"def can_access_student( student)\n # 2 ways to access all student: admin or access_all flag\n if (is_admin? || current_teacher.access_all_students)\n return true\n end\n\n # last gasp: check roster of accessible students\n find_student = RosterStudent.where( teacher_id: current_teacher.id, student_id: student.id)\n if ! find_student.blank?\n return true\n end\n\n false # nope - teacher cannot access this student's data\n end",
"def student?\n student_id?\n end",
"def logged_in?\n !current_school.nil?\n end",
"def rollcall_student_required\n if current_user.is_rollcall_epi? || current_user.is_rollcall_health_officer? || current_user.is_rollcall_nurse? ||\n current_user.is_rollcall_admin?\n return true\n else\n redirect_to :action => \"unauthorized\", :controller => 'rollcall/rollcall_app'\n return false\n end\n end",
"def is_authorized_for_student(student)\n return true if self.districtwide_access?\n\n return false if self.restricted_to_sped_students && !(student.program_assigned.in? ['Sp Ed', 'SEIP'])\n return false if self.restricted_to_english_language_learners && student.limited_english_proficiency == 'Fluent'\n return false if self.school.present? && self.school != student.school\n\n return true if self.schoolwide_access? || self.admin? # Schoolwide admin\n return true if self.has_access_to_grade_levels? && student.grade.in?(self.grade_level_access) # Grade level access\n return true if student.in?(self.students) # Homeroom level access\n false\n end",
"def current_user\n if session[:type] == \"student\"\n current_student()\n elsif session[:type] == \"professor\"\n current_professor()\n else\n @current_user = \"ERROR: NO USER TYPE\"\n end\n end",
"def logged_in?\n \t!current_staff.nil? || !current_student.nil? || !current_admin.nil?\n\tend",
"def required_student\n require_user_type(:student)\n end",
"def require_student_or_admin\n redirect_to root_path unless @auth_user && ['Student', 'Admin'].include?(@auth_user.type)\n end",
"def is_user?\n usertype == 'user'\n end",
"def require_student_or_instructor\n redirect_to root_path unless @auth_user && ['Student', 'Instructor'].include?(@auth_user.type)\n end",
"def studente_user\n unless this_is_studente?(current_user)\n flash[:danger] = \"You don't have the rights for this page/action.\"\n redirect_to(root_url)\n end\n end",
"def current_student\n @current_student ||= Student.find_by(id: session[:user_id])\n end",
"def check_student\n @@name_path = request.env['PATH_INFO']\n if current_user&.student? and (@@name_path != \"/my_projects\" and @@name_path != \"/\")\n begin\n redirect_to :back, alert: \"You do not have access to that page.\"\n rescue Exception\n redirect_to \"/\", alert: \"You do not have access to that page.\"\n end\n end\n end",
"def student_user \n self.line_break\n puts \"Type in your full name to begin:\".colorize(:light_green)\n self.line_break\n student_user = gets.chomp.titleize\n if Student.find_by(name: student_user)\n self.line_break\n puts \"Welcome #{student_user.titleize}!\".colorize(:light_magenta)\n self.student_tasks(student_user)\n else \n puts \"Invalid response. You are not authorized to access the portal.\".colorize(:yellow), \"Please contact student services for additional support. Have a great day!\".colorize(:yellow)\n self.run\n end\n end",
"def check_instructor_or_student\n if !current_instructor && !current_student\n redirect_to :root, notice: \"You are not logged in as instructor or student\"\n end \n end",
"def can_i_access_your_profile(is_friend, my_city, their_city, their_school)\n if is_friend == true\n \treturn \"yes\"\n elsif their_school == \"MakerSquare\"\n \treturn \"HELL YEAH\"\n elsif my_city == their_city\n \treturn \"maybe\"\n else\n \treturn \"no\"\n end\nend",
"def can_i_access_your_profile(is_friend, my_city, their_city, their_school)\n if is_friend == true\n \treturn true\n elsif my_city == their_city && their_school == \"MakerSquare\"\n \treturn \"YES\"\n elsif my_city == their_city && their_school != \"MakerSquare\"\n \treturn \"Mehh\"\n else \n \treturn \"Naw\"\n end\nend",
"def login_user\n student.user\n end",
"def subscribing?(course)\n student? && current_user.subscribing?(course)\n end",
"def tutor_check?(academic_session, student_id)\n \tcurrent_user.is_student_tutor?(academic_session, student_id)\n end",
"def is_logged_in?\n !session[:school_id].nil?\n end",
"def must_be_current_student\n # Need to match current user to current student id\n unless current_user.id == params[:id]\n redirect_to root_path, notice: \"This is not you!\"\n end\n end",
"def coaches_student?(student)\n\t\tstudents.include?(student)\n\tend",
"def current_student\n if(student_id = session[:student_id])\n @current_student ||= Student.find_by(id: student_id)\n elsif (student_id = cookies.signed[:student_id])\n student = Student.find_by_id(student_id)\n if student && student.authenticated?(:remember, cookies[:student_remember_token])\n logged_in_as_student\n @current_student = student\n end\n end\n end",
"def show\n user_type = session[:user_type]\n case user_type\n when ApplicationController::TYPE_STUDENT\n if(current_user.id != params[:id].to_i)\n flash[:notice] = \"You are not authorised to perform this action\"\n redirect_to root_path\n end\n when ApplicationController::TYPE_LIBRARIAN\n flash[:notice] = \"You are not authorised to perform this action\"\n redirect_to root_path\n when ApplicationController::TYPE_ADMIN\n # admin can see any student\n end\n end",
"def check_online_state(source,nick,srcclist=nil)\n usr = User.first(:nickname=>source)\n return ret_fail(source+' not found') if usr == nil #user not found (can only occur after own account deletion...as a bug)\n\n #if user not in contact list -> request denied\n contact = usr.contacts.first(:userid => User.first(:nickname => nick).id)\n return ret_fail(nick+' not in your contact list') if contact == nil\n\n #check now authorization - if no authorization, dont tell state (no permission) but thats not a ret_fail!\n return {'response'=>true,'state'=>'hidden'} if contact.authgiven != 't'\n\n #everything's fine -> get state\n\n if $sessions.index(nick) != nil #that user has a session running -> online\n state = 'online'\n else\n state = 'offline'\n end\n\n return {'response'=>true, 'state'=>state}\nend",
"def online?\n\t\tstatus == \"online\"\n\tend",
"def require_user_type(user_type)\n if (user_type == :student and !student_logged_in?) or (user_type == :teacher and !teacher_logged_in?)\n redirect_to root_path, status: 301, notice: \"You must be logged in a#{'n' if user_type == :admin} #{user_type} to access this content\"\n return false\n end\n end",
"def modulect_is_online\n if app_settings.is_offline && controller_name != \"errors\" && (request.path =~ /.*\\/admin(\\/.*)?/) == nil && (request.path =~ /.*\\/login(\\/.*)?/) == nil\n if !logged_in? || (logged_in? && current_user.user_level == \"user_access\")\n redirect_to offline_path\n end\n end\n end",
"def seats_available\n\t\tavailable = total_student - UserEvent.joined_students_count(self.id)\n\n\t\tif available > 0\n\t\t\tavailable\n\t\telse\n\t\t\t\"FULL\"\n\t\tend\n\tend",
"def logged_in_normal_user?\n normal_user.present?\n end",
"def user_status(user)\n return \"Admin\" if user.admin?\n return \"Exception\" if user.override_access?\n end",
"def eventunscrape?\n @user.is_admin?\n end",
"def current_student\n @current_student ||= Student.find_by(id: session[:student_id])\n end",
"def user_type\n\t\tif (current_user.type == 'Trainer')\n\t\t\ttrainer\n\t\telsif (current_user.type == 'Client')\n\t\t\tclient\n\t\t\t\n\t\tend\n\t\t\n\tend",
"def show\n if current_user && !current_user.student?\n @user = User.find_by_id(params[:id])\n end\n end",
"def is_work?\n if @status==\"study\"\n puts \"he is a student.\"\n false\n else puts \"he is working\"\n true\n end\n end",
"def students\n if current_user.is_admin?\n @students= User.find(:all, :conditions => \"is_teacher = '0' and is_admin = '0'\")\n respond_to do |format|\n format.xml { render :xml => @students }\n end\n else\n respond_to do |format|\n format.xml { render :text => \"error\" }\n end\n end\n end",
"def user_type\n if self.class.name == \"PubcookieUser\"\n type = self.identity_type == \"Student\" ? self.identity_type : \"UW Standard user\"\n else\n type = \"External user\"\n end\n type\n end",
"def logged_in?\n\t !current_staff.nil?\n\t end",
"def current_student\n if session[:student_id]\n @current_student ||= Student.find_by(id: session[:student_id])\n end\n end",
"def senior_member?\n\t\tsenior != true\n\tend",
"def user\n student.user\n end",
"def user_active?\n\t\treturn true if teacher? && !activated\n\tend",
"def change_is_enabled\n member = Member.find params[:id]\n user = User.find(member.user_id)\n Member.change_student_status(member)\n if member.is_enabled == true\n redirect_to users_url, :flash => { :success => \"#{user.first_name} #{user.last_name} has been enabled.\" }\n else\n redirect_to users_url, :flash => { :success => \"#{user.first_name} #{user.last_name} has been disabled.\" }\n end\n end",
"def restricted?\n return ( self.user_type == User::USER_TYPE_NORMAL )\n end",
"def is_current?\r\n @is_current ||= self.semester.is_current?\r\n end",
"def status_getuser?()\n return true if (@status == TAC_PLUS_AUTHEN_STATUS_GETUSER)\n return false\n end",
"def logged_in?\n !current_teacher.nil?\n end",
"def logged_in?\n !current_teacher.nil?\n end",
"def check_must_be_student_restriction\n if @offering.allow_students_only?\n @restriction = MustBeStudentRestriction.new(:offering_id => @offering.id)\n render :action => \"restricted\" and return unless @restriction.allows?(@user_application)\n end\n if !@user_application.person.is_a?(Student) && @offering.require_invitation_codes_from_non_students?\n redirect_to :action => \"enter_code\" and return if @user_application.offering_invitation_code.nil?\n end\n end",
"def action_allowed?\n current_user_has_student_privileges?\n end",
"def possessive(user)\n return 'your' if (user == current_user)\n return 'their' unless user.contact_information && user.contact_information.gender\n user.contact_information.gender == 'male' ? 'his' : 'her'\n end",
"def is_authorized_for_student?(student)\n begin\n return true if @educator.districtwide_access?\n\n return false if @educator.restricted_to_sped_students && !(student.program_assigned.in? ['Sp Ed', 'SEIP'])\n return false if @educator.restricted_to_english_language_learners && student.limited_english_proficiency == 'Fluent'\n return false if @educator.school_id.present? && student.school_id.present? && @educator.school_id != student.school_id\n\n return true if @educator.schoolwide_access? || @educator.admin? # Schoolwide admin\n return true if @educator.has_access_to_grade_levels? && student.grade.in?(@educator.grade_level_access) # Grade level access\n return true if student.in?(@educator.students) # Homeroom level access\n return true if student.in?(@educator.section_students) # Section level access\n rescue ActiveModel::MissingAttributeError => err\n # We can't do authorization checks on models with `#select` that are missing\n # fields. If this happens, it's probably because the developer is trying to\n # to optimize a query. The authorization layer could only recover by making more\n # queries, so instead we raise and force the developer to figure out how to resolve.\n #\n # See `Authorizer.student_fields_for_authorization` and `Authorizer.educator_field_for_authorization`\n # to see what fields are required on each model.\n raise err\n end\n false\n end",
"def status_restricted?\n (prospect || exstudent || student) &&\n !(prospect && exstudent && student)\n end",
"def display_online_access_value?(field_value)\n field_value == current_user.access_type ? true : false\n end",
"def is_inviter?(user)\n membership_status(user) == StudentMembership::STATUSES[:inviter]\n end",
"def current_user_resource\n resource = Resource.find_by_id(params[:id].to_i)\n if current_user.user_type == \"student\" && current_user.coach.nil?\n redirect_to user_path(@current_user)\n elsif current_user.id == resource.user_id || current_user.coach.id == resource.user_id\n true\n else\n redirect_to user_path(@current_user)\n end\n end",
"def current_student\n Student.find_by({id: session[:student_id]})\nend",
"def junior?\n\t\tgrade == 11\n\tend",
"def active_school_admin?\n school_admin_or_user? && school.active?\n end",
"def user_login?\n\t\treval = user_info[:uid] > 0 ? true : false\n\t\tif reval\n\t\t\tuser_session_update user_info[:sid], user_info[:uid]\n\t\tend\n\t\treval\n\tend",
"def user?\n get_mode == :user\n end",
"def grade_status(student)\n\tif student[:grade] == \"F\"\n\t\t\"failed\"\n\telse\n\t\t\"passed\"\n\tend\nend",
"def is_user_trainer\n unless current_user.trainer?\n \tredirect_to(root_url)\n \tflash[:danger] = \"You do not have permission to view this page\"\n end\n end",
"def online_check\n User.where(online: true).count == 1\n end",
"def student_logged_in!\n return if current_student.present?\n \n flash[:alert] = \"You must be signed in as a student\"\n redirect_to login_url\n end",
"def student\n request.user\n end",
"def is_potential_user?\n\t\ttrue\n\tend"
] |
[
"0.7305143",
"0.72661877",
"0.7209433",
"0.719262",
"0.7156094",
"0.6969046",
"0.6910181",
"0.68802935",
"0.6865148",
"0.68130404",
"0.6788277",
"0.6705275",
"0.6654445",
"0.66370004",
"0.65740055",
"0.65714514",
"0.6562667",
"0.65451485",
"0.65362275",
"0.65109736",
"0.64291215",
"0.6395675",
"0.6395323",
"0.63373053",
"0.6333552",
"0.63166183",
"0.6290409",
"0.6279916",
"0.6250344",
"0.6242504",
"0.62394553",
"0.62379634",
"0.62361795",
"0.6154138",
"0.6144314",
"0.61409473",
"0.6137315",
"0.6136248",
"0.6113976",
"0.6112336",
"0.60537696",
"0.6047668",
"0.6042568",
"0.60411227",
"0.6026111",
"0.6025679",
"0.60235214",
"0.6001364",
"0.6001287",
"0.599172",
"0.5977414",
"0.59763116",
"0.59691197",
"0.594818",
"0.59364474",
"0.59298867",
"0.5890114",
"0.58748984",
"0.5874061",
"0.5870957",
"0.5870125",
"0.58605576",
"0.5859016",
"0.58495873",
"0.584031",
"0.5837547",
"0.5834611",
"0.5825817",
"0.5823224",
"0.58109206",
"0.5799429",
"0.5799083",
"0.579791",
"0.57912624",
"0.57849926",
"0.57772547",
"0.57740176",
"0.5768086",
"0.57662535",
"0.57630146",
"0.57630146",
"0.57616615",
"0.57608885",
"0.57579815",
"0.57575864",
"0.5756104",
"0.5752525",
"0.5741482",
"0.5725497",
"0.5724111",
"0.5723887",
"0.572287",
"0.5719536",
"0.5717705",
"0.5715163",
"0.5702496",
"0.56917745",
"0.56814396",
"0.56756294",
"0.5663617"
] |
0.84800327
|
0
|
Returns true if the fft_geomancy feature exists
|
def has_geomancy_feature?
!features(:geomancy_element_shift).empty?
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def has_feat ( f )\n return false\n end",
"def feature?(feature)\n definition[:features]&.include?(feature)\n end",
"def aperture?\n !aperture.nil?\n end",
"def float_dtype?\n [:float32, :float64].include?(dtype)\n end",
"def is_mag?(); @type == GRT_MAG; end",
"def focal_length?\n !focal_length.nil?\n end",
"def needs_ffs?()\n gadget.needs_ffs?()\n end",
"def legit_feature?\n Flipflop.feature_set.features.map(&:name).include?(params[:feature])\n end",
"def flammable?\n type.flammable?\n end",
"def complex_dtype?\n [:complex64, :complex128].include?(self.dtype)\n end",
"def flamegraph?\n @mode == :flamegraph\n end",
"def exists?\n self.class.exists?(features)\n end",
"def has_feature?(*)\n end",
"def flux_gryfx?\n\t\t\t@flux_option == \"gryfx\"\n\t\tend",
"def resampling_required?\n flac_info.streaminfo[\"samplerate\"] != target_sample_rate\n end",
"def taumaturgic?\n has_feature?(:taumaturgic)\n end",
"def fc?\n related_volumes.map(&:fc?).include?(true) && !fc_wwpns.empty?\n end",
"def flux_gs2?\n\t\t\t@flux_option == \"gs2\"\n\t\tend",
"def is_flagged?(feature)\n flags.include?feature\n end",
"def float?\n type == \"FLOAT\" || type == \"FLOAT64\"\n end",
"def valid?\n if @freq.nil?\n false\n elsif frequency_length < @duration\n false\n else\n true\n end\n end",
"def has_gram?(gram)\n @frequencies.has_key?(gram)\n end",
"def magnitude?\n self.units.reject{|d,(u,m)| m==0}.empty?\n end",
"def rescaling_required?\n flac_info.streaminfo[\"bits_per_sample\"] != 16\n end",
"def framed?\n dim_type.outer_target == \"frame\"\n end",
"def extra_field_series?\n @extra_numeric_fields && !@extra_numeric_fields.empty?\n end",
"def tdd_use_fme?\n false\n end",
"def heptagonal?\n fcache[:heptagonal] ||= (Math.sqrt(40*self +9)+3)%10 == 0\n end",
"def estimated?\n (self.story_type == 'feature') && self.story_points\n end",
"def supports?(feature_name)\n features.key? feature_name\n end",
"def is_xy?(); @type == GRT_XY; end",
"def isFloat?\n !!Float(exp) rescue false\n end",
"def has_expression_data?\n self.genes.any?\n end",
"def energized?\n @cur_energy > 0\n end",
"def complex?\n @complex\n end",
"def finite?\n @special._equal?(0)\n end",
"def is_gone?\n\n fexp.nil?\n end",
"def finite?\n end",
"def float?\n @kind == :float_lit || @kind == :float_exp_lit\n end",
"def gc_metrics_enabled?\n gc_metrics_enabled\n end",
"def complex?\n false\n end",
"def validate_feat(feature) #:doc:\n # rubocop:enable Style/CommentedKeyword\n if feature.nil? || feature.empty?\n raise(\"Feature '#{feature_id}' could not be found\")\n return false\n end\n\n if feature[:geometry].nil?\n raise(\"No geometry found in '#{feature[:properties][:name]}'\")\n return false\n end\n\n if feature[:properties].nil?\n raise(\"No properties found in '#{feature[:properties][:name]}'\")\n return false\n end\n\n unless feature[:properties][:detailed_model_filename]\n errors = JSON::Validator.fully_validate(schema, feature[:properties])\n if !errors.empty?\n raise(\"Invalid properties for '#{feature[:properties][:name]}'\\n #{errors.join('\\n ')}\")\n return false\n end\n end\n\n geometry_type = feature[:geometry][:type]\n if geometry_type == 'Polygon'\n elsif geometry_type == 'MultiPolygon'\n else\n raise(\"Unknown geometry type '#{geometry_type}'\")\n return false\n end\n return feature\n end",
"def validate_feat(feature) #:doc:\n # rubocop:enable Style/CommentedKeyword\n if feature.nil? || feature.empty?\n raise(\"Feature '#{feature_id}' could not be found\")\n return false\n end\n\n if feature[:geometry].nil?\n raise(\"No geometry found in '#{feature[:properties][:name]}'\")\n return false\n end\n\n if feature[:properties].nil?\n raise(\"No properties found in '#{feature[:properties][:name]}'\")\n return false\n end\n\n unless feature[:properties][:detailed_model_filename]\n errors = JSON::Validator.fully_validate(schema, feature[:properties])\n if !errors.empty?\n raise(\"Invalid properties for '#{feature[:properties][:name]}'\\n #{errors.join('\\n ')}\")\n return false\n end\n end\n\n geometry_type = feature[:geometry][:type]\n if geometry_type == 'Polygon'\n elsif geometry_type == 'MultiPolygon'\n else\n raise(\"Unknown geometry type '#{geometry_type}'\")\n return false\n end\n return feature\n end",
"def is_feature(test)\n test.metadata[:type].to_s == 'feature'\nend",
"def feature_table_exists?\n Feature::FlipperFeature.table_exists?\n rescue StandardError\n false\n end",
"def fireplace_present?\n $structures.any?{|structure| structure.is_a? Fireplace }\n end",
"def nd?\n true\n end",
"def special_flag(flag_id)\r\n features(FEATURE_SPECIAL_FLAG).any? {|ft| ft.data_id == flag_id }\r\n end",
"def completeable?\n if self.measurements.empty?\n !self.treatment_plan.first_session?(self) and !self.treatment_plan.last_session?(self)\n else\n # standard validation has already made sure the measurement set has the required measurement\n true \n end\n end",
"def processing_derivatives?\n !file_nodes.first.original_file?\n end",
"def data_wrapper?\n return self.features.include?('dataWrapper')\n end",
"def flac_with_m4a?\n asset.content_type == \"audio/flac\" && asset.file_derivatives.has_key?(:m4a)\n end",
"def autoreaping?; @reaping_frequency > 0; end",
"def finite?\n true\n end",
"def real?\n true\n end",
"def complex?\n true\n end",
"def FT_HAS_FAST_GLYPHS( face )\n 0\n end",
"def consistent?\n return spectralRadius < 1.0\n end",
"def feature?(feature=RC.current_feature)\n return true if self.feature.nil?\n self.feature == feature.to_s\n end",
"def have_fftw3?\n begin\n response = require('fftw3')\n true\n rescue\n begin\n Kernel.const_get('FFTW3')\n rescue\n false\n end\n end\nend",
"def temporal?\n properties.include?(\"temporal\")\n end",
"def configured_feature_requires_component?(component)\n list_configured_features_from_component(component).length > 0\n end",
"def dicom?\n @raw_image_files.first.dicom?\n end",
"def is_softfence?(); @type == GRT_SOFTFENCE; end",
"def isFacile? \n return @facile\n end",
"def loaded? feature\n $LOADED_FEATURES.any? do |path|\n path =~ /^#{feature}#{SUFFIX_RE}$/\n end\n end",
"def imag?\n false\n end",
"def special_flag(flag_id)\n features(FEATURE_SPECIAL_FLAG).any? {|ft| ft.data_id == flag_id }\n end",
"def render?\n @data_set.data_series.any? { |ds|\n ds.data_type.is_a?(RailsDataExplorer::DataType::Quantitative)\n }\n end",
"def fixed_ratio?\n fullsize_settings[:dimensions].all?(&:present?)\n end",
"def float?\n self.class.float?(self)\n end",
"def photograph?\n true\n end",
"def has_datatype?\n !datatype.nil?\n end",
"def has_extraction_form_options\n has_extraction_form = false\n extraction_forms = Study.get_extraction_form_list_array(self.id)\n unless extraction_forms.empty?\n has_extraction_form = true\n end\n return has_extraction_form\n end",
"def feature_enabled?(feature)\n experimental = features_requested\n feature = feature.to_s\n\n return global_enabled? || experimental.include?(feature)\n end",
"def FT_IS_SFNT(face)\n face.face_flags & FaceFlag[:SFNT]\n end",
"def sogr?\n (sogr)\n end",
"def has_kerning_data?\n @kern_pairs.any?\n end",
"def has_feature_constraint?(name = nil)\n if !name\n any?(&:has_feature_constraint?)\n else\n any? { |bit| bit.enabled_by_feature?(name) }\n end\n end",
"def feature_enable?(feature)\n @features ||= config.features_enable\n @features[feature] == true\nend",
"def true_facet?\n @type != 'pseudo_facet'\n end",
"def is_valid?(feature)\n !feature.description.blank?\n end",
"def fuzzy?\n return false if obsolete?\n @flag.to_s.match('fuzzy') ? true : false\n end",
"def finite?() end",
"def has_sample?\n sample_width.is_a?(Integer)\n end",
"def is_float?\n\t\tFloat(self) != nil rescue false\n\tend",
"def plot_pheno_avg?\n make_plot = false\n @groups.each do |g|\n if g.has_pheno_avg?\n make_plot = true\n break\n end\n end\n return make_plot\n end",
"def is_fact?\n false\n end",
"def supports?(feature)\n features.include?(feature)\n end",
"def is_datatype?(); @type == GRT_DATATYPE; end",
"def has_field?(field_name)\n @data.has_key?(AudioMetadata.field_name_for(field_name))\n end",
"def has_fact?(fact)\n get_fact(nil).include?(fact)\n end",
"def fcoe?\n !fcoe_san_networks.empty?\n end",
"def check\n len = 0\n @sig_waveforms.each do |pair|\n values = pair[1]\n if len == 0\n len = values.length\n else\n return false if values.length != len\n end\n end\n return true\n end",
"def finite?\n @special != 'i' && !self.nan?\n end",
"def feature_flags\n 0\n end",
"def has_datacolumns? (record)\n record.datacolumns.size > 0 ? true : false\n end",
"def ffa?\n !@doc.css('map ffa').blank?\n end",
"def usable?\n\n @trajectory.each do |a_point|\n if a_point.alt > 1000000.0\n return false\n end\n end\n\n return true\n\n end",
"def groff_available?\n require 'rbconfig'\n\n if RbConfig::CONFIG[\"host_os\"] =~ /(msdos|mswin|djgpp|mingw)/\n `which groff 2>NUL`\n else\n `which groff 2>/dev/null`\n end\n\n $? == 0\n end"
] |
[
"0.6759936",
"0.64259964",
"0.6272171",
"0.62395585",
"0.59958404",
"0.5974579",
"0.5963551",
"0.5955584",
"0.5871518",
"0.586599",
"0.5791189",
"0.5754336",
"0.5753596",
"0.5734952",
"0.56590253",
"0.56559",
"0.5640304",
"0.5625225",
"0.55964494",
"0.5590869",
"0.5571228",
"0.5569595",
"0.5564819",
"0.5557727",
"0.5551306",
"0.5548292",
"0.5510864",
"0.5500403",
"0.548868",
"0.54693085",
"0.54602724",
"0.5449303",
"0.5441891",
"0.54217905",
"0.5421017",
"0.5417492",
"0.5416541",
"0.5401197",
"0.5400704",
"0.5399528",
"0.5394716",
"0.53837734",
"0.53837734",
"0.5369268",
"0.53658503",
"0.53567284",
"0.5351016",
"0.534704",
"0.5345168",
"0.5344579",
"0.5344312",
"0.53419226",
"0.5337055",
"0.5329691",
"0.5325544",
"0.5322055",
"0.53208256",
"0.5316245",
"0.5307412",
"0.5302469",
"0.5302161",
"0.5301719",
"0.5298371",
"0.52952117",
"0.52925056",
"0.5287427",
"0.52861255",
"0.52814484",
"0.5277961",
"0.52744544",
"0.5269767",
"0.52692",
"0.52639496",
"0.5256942",
"0.5249475",
"0.5248181",
"0.52463615",
"0.5234886",
"0.5223082",
"0.522306",
"0.5222585",
"0.52168345",
"0.5214691",
"0.52108896",
"0.52079844",
"0.5207474",
"0.52040225",
"0.52028245",
"0.5195256",
"0.519189",
"0.51873016",
"0.5174902",
"0.5173855",
"0.51686347",
"0.5167591",
"0.51584595",
"0.515671",
"0.51516247",
"0.5151504",
"0.5148895"
] |
0.7363119
|
0
|
Apply "element rate rotation" for geomancy feature. Takes the base element rate. You can change these rules as you see fit.
|
def geomancy_element_shift(rate)
# absorb -> null
if rate < 0
return 0
# null -> resist (half)
elsif rate < 0.5
return 0.5
# resist (half) -> normal
elsif rate < 1
return 1
# normal -> weak (double)
elsif rate == 1
return 2
# weak -> absorb
elsif rate > 1
return -(rate-1)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def numberOfRotations(element)\n\nend",
"def draw_element_rate(x, y, width)\n draw_rates(x, y, width, $data_system.magic_elements, BestiaryConfig::ELEMENTS)\n end",
"def accelerate strength = 1.0\n self.speed += self.rotation_vector * strength/SUBSTEPS\n end",
"def apply_rotation\n if @rotation_block != nil\n (1..@rotation.modulo(@rotation_cycle)).each do |i|\n @blocks.each do |block|\n old_x = block.x\n old_y = block.y\n block.x = @rotation_block.x + (@rotation_block.y - old_y)\n block.y = @rotation_block.y - (@rotation_block.x - old_x)\n end\n end\n end\n end",
"def rotate( deg )\n set_base_image( base_image.rotate( deg ) )\n end",
"def element_rate(element_id)\n # Get values corresponding to element effectiveness\n table = [0,200,150,100,50,0,-100]\n result = table[$data_classes[@class_id].element_ranks[element_id]]\n # If this element is protected by armor, then it's reduced by half\n for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]\n armor = $data_armors[i]\n if armor != nil and armor.guard_element_set.include?(element_id)\n result /= 2\n end\n end\n # If this element is protected by states, then it's reduced by half\n for i in @states\n if $data_states[i].guard_element_set.include?(element_id)\n result /= 2\n end\n end\n # End Method\n return result\n end",
"def r90; self.rotation = 'fa-rotate-90'; self; end",
"def rotate!( angle_rad )\n self.angle += angle_rad\n self\n end",
"def rotate_deg!( angle_deg )\n self.angle_deg += angle_deg\n self\n end",
"def skt_rotateToVelocity(velocity, rate: rate)\n\t # Determine what the rotation angle of the node ought to be based on the\n\t # current velocity of its physics body. This assumes that at 0 degrees the\n\t # node is pointed up, not to the right, so to compensate we subtract π/4\n\t # (90 degrees) from the calculated angle.\n\t\tnew_angle = Math::atan2(velocity.dy, velocity.dx) - Math::PI / 2\n\t\t\n\t # This always makes the node rotate over the shortest possible distance.\n\t # Because the range of atan2() is -180 to 180 degrees, a rotation from,\n\t # -170 to -190 would otherwise be from -170 to 170, which makes the node\n\t # rotate the wrong way (and the long way) around. We adjust the angle to\n\t # go from 190 to 170 instead, which is equivalent to -170 to -190.\n\t\tif new_angle - self.zRotation > Math::PI\n\t\t\tself.zRotation += Math::PI * 2.0\n\t\telsif self.zRotation - new_angle > Math::PI\n\t\t\tself.zRotation -= Math::PI * 2.0\n\t\tend\n\t\t\n\t # Use the \"standard exponential slide\" to slowly tween zRotation to the\n\t # new angle. The greater the value of rate, the faster this goes.\n\t self.zRotation += (new_angle - self.zRotation) * rate\n\t\t\n\tend",
"def draw_element_amplifiers\n item.element_amplify.each_pair do |element, rate|\n draw_element_amplify(element, rate)\n end\n end",
"def element_rate(element_id)\n # Get a numerical value corresponding to element effectiveness\n table = [0,200,150,100,50,0,-100]\n result = table[$data_enemies[@enemy_id].element_ranks[element_id]]\n # If protected by state, this element is reduced by half\n for i in @states\n if $data_states[i].guard_element_set.include?(element_id)\n result /= 2\n end\n end\n # End Method\n return result\n end",
"def rotateByDegree(angle)\n return unless defined? angle\n currentPosition = getCurrentPosition\n z_vector = [0, 0, 1]\n\n rotationTransformation = Geom::Transformation.rotation(currentPosition, z_vector, angle.degrees)\n @@componentInstance.transform! (rotationTransformation)\n\n # Need to update the most recent transformation!!!\n # Without updating, the rotation will be changed to the initial status when move the model.\n updateAvatarLocation\n updateTransformation\n updateViewPort\n\n end",
"def rotate!(angle, axis_x = width / 2.0, axis_y = height / 2.0)\n ptr = self.class.create_image_ptr(width, height, alpha_blending?)\n ::GD2::GD2FFI.send(:gdImageCopyRotated, ptr, image_ptr, axis_x.to_f, axis_y.to_f, 0, 0, width.to_i, height.to_i, angle.to_degrees.round.to_i)\n init_with_image(ptr)\n end",
"def _updateAngle\n\t\t\t\t@angle = (@maxAngle*@idxAngle) - Math::PIH\n\t\t\tend",
"def normal_atk_element_modifiers(user, item)\n count = 0\n rates = {}\n user.feature_objects.each do |obj|\n next if obj.atk_element_modifiers.empty?\n count += 1 \n obj.atk_element_modifiers.each do |id, val|\n rates[id] ||= 0\n rates[id] += val\n end\n end\n \n return th_attack_atk_element_modifiers_item_element_rate(user, item) if rates.empty?\n return rates.inject(0) do |r, (id, val)|\n r + element_rate(id) / count * val\n end\n end",
"def scale_degrees\n \n end",
"def axis_rotation( axis, angle ) \n\t\t\traise TypeError, \"no implicit conversion of %s to ODE::Vector\" unless\n\t\t\t\taxis.is_a?( ODE::Vector )\n\t\t\tangle = Float(angle)\n\n\t\t\tif len = axis.abs\n\t\t\t\ta = axis/len * sin( angle / 2.0 );\n\t\t\t\tself.class.new( a, cos(angle/2.0) )\n\t\t\telse\n\t\t\t\tself.class.identity\n\t\t\tend\n\t\tend",
"def draw_element_rates\n item.element_rate_set.each_pair do |element, rate|\n draw_element_rate(element, rate)\n end\n end",
"def initialize\n @rate = 0.90\n end",
"def rotate( angle_rad )\n dup.rotate!( angle_rad )\n end",
"def zrotation\n end",
"def rotational_period\n return 2.0 * Math::PI / self.angular_velocity\n end",
"def rotate(angle, axis_x = width / 2.0, axis_y = height / 2.0)\n clone.rotate!(angle, axis_x, axis_y)\n end",
"def rotate_origo(angle_x = 0, angle_y = 0, angle_z = 0)\n\t\t@rect.each do |a|\n\t\t\ta.each do |b|\n\t\t\t\tx = b[0]; y = b[1]; z = b[2]\n\n\t\t\t\tx, y, z = rotate_point(x, y, z, 0, 0, 0, angle_x, angle_y, angle_z)\n\n\t\t\t\tb[0] = x; b[1] = y; b[2] = z\n\t\t\tend\n\t\tend\n\tend",
"def rotate\n @angle += Math::PI / 16\n @angle = @angle % (Math::PI * 2)\n end",
"def circ_array(pNum_elem=nil, pDegree_between=nil)\r\n # - - - - - - - - - - - - - - - - - - - -\r\n curr_beg_angle = @beg_angle\r\n curr_end_angle = @end_angle\r\n sweep_angle = @end_angle - @beg_angle\r\n\r\n if (pDegree_between == nil)\r\n pDegree_between = sweep_angle / 2.0\r\n pDegree_between_specified = false\r\n else\r\n pDegree_between = 0.0 + pDegree_between\r\n pDegree_between_specified = true\r\n end #if\r\n \r\n\r\n # Determine the number of elements we\r\n # can have\r\n if (pNum_elem == nil) || (pNum_elem == 0)\r\n degree_inc = sweep_angle + pDegree_between\r\n pNum_elem = Integer(360.0 / pDegree_inc)\r\n elsif (pNum_elem * sweep_angle) > 360\r\n max_ele = Integer(360 /sweep_angle)\r\n degree_inc = sweep_angle + pDegree_between\r\n end #if\r\n\r\n\r\n #pDegree_inc = 360.0 \r\n #Adjust space between to get even spacing\r\n #if (pDegree_between_specified == false)\r\n # total_sweep = (sweep_angle * pNum_elem)\r\n # extra_sweep = 360 - total_sweep\r\n # pDegree_between = extra_sweep / (pNum_elem - 1)\r\n # print \"(recalced pDegree_between=\", degree_betwee, \")\\n\"\r\n #end #if\r\n\r\n if (degree_between_specified == true)\r\n degree_inc = sweep_angle + pDegree_between\r\n else\r\n degree_inc = 360 / pNum_elem\r\n end #if\r\n\r\n # illustrate an easy way to get a\r\n # repeating array of arc pockets\r\n for ele_cnt in (1..pNum_elem) \r\n @beg_angle = curr_beg_angle \r\n @end_angle = beg_angle + sweep_angle\r\n do_mill()\r\n mill.retract()\r\n curr_beg_angle += degree_inc\r\n if (curr_beg_angle > 360)\r\n curr_beg_angle = curr_beg_angle % 360\r\n end #for\r\n end #for\r\n end",
"def rotate(options={}, more_options={}, &after)\n if options.is_a? Numeric\n new_angle = options\n options = more_options\n else\n new_angle = options[:angle]\n end\n\n old_angle = valueForKeyPath('layer.transform.rotation.z')\n options[:angle] = old_angle + new_angle\n rotate_to(options, &after)\n end",
"def rotate(options={}, more_options={}, &after)\n if options.is_a? Numeric\n new_angle = options\n options = more_options\n else\n new_angle = options[:angle]\n end\n\n old_angle = valueForKeyPath('layer.transform.rotation.z')\n options[:angle] = old_angle + new_angle\n rotate_to(options, &after)\n end",
"def angle_deg=( angle_deg )\n self.angle = angle_deg * DEG_TO_RAD\n self\n end",
"def start_angle\n end",
"def radius(element, transformation=nil)\n\t [40, format_value(transformation ? transformation.transform(element.radius) : element.radius)]\n\tend",
"def rate_scale; end",
"def acts_as_rateable(opts={})\n options = options_for_rateable(opts)\n extend FortiusOne::Acts::Rateable::SingletonMethods\n include FortiusOne::Acts::Rateable::InstanceMethods\n \n if opts[:average] == true\n has_many :ratings, :dependent => :destroy, :as => :rateable, :foreign_key => :rateable_id\n else\n has_one :rating, :dependent => :destroy, :as => :rateable, :foreign_key => :rateable_id \n class_eval { alias :old_rating :rating }\n \n end\n \n class_eval do\n \n # Rate this object with a_rating, also aliased as rating=\n def rate(a_rating, options={})\n options.merge!({\n :rating => a_rating.to_i\n })\n if average_rating?\n if options[:user_id]\n # Delete the old ratings for current user \n Rating.delete_all([\"rateable_type = ? AND rateable_id = ? AND user_id = ?\", self.class.base_class.to_s, self.id, options[:user_id]]) \n end\n self.ratings.create(options)\n else\n self.rating.nil? ? create_rating(options) : self.old_rating.update_attribute(:rating, a_rating.to_i)\n end\n end\n # alias for rate\n alias :rating= :rate\n\n # Return the rating of this object\n def rating\n if average_rating?\n # Integerize it for now -- no fractional average ratings\n (the_ratings = ratings.average(:rating)) ? the_ratings.round : 0.0\n else\n self.old_rating.nil? ? nil : self.old_rating.rating\n end\n end\n \n def total_ratings\n average_rating? ? ratings.count : 1\n end\n \n def average_rating?\n self.respond_to?(\"ratings\")\n end\n \n end\n end",
"def gravitational_acceleration(r)\n return self.gravitational_parameter / r**2\n end",
"def spring_to_original_bearing(timing = 2.0)\n UIView.animateWithDuration(timing,\n delay:0.3,\n usingSpringWithDamping:0.3,\n initialSpringVelocity:0.2,\n options:UIViewAnimationOptionCurveLinear,\n animations: lambda {\n radians = CGAffineTransformMakeRotation((@original_bearing.to_i - 180) * Math::PI / 180)\n self.transform = radians\n },\n completion:lambda {|finished|\n }\n )\n end",
"def rate_scale=(_arg0); end",
"def stabilise\n\t\tif almost_at_angle(0, @angle, @rotation_speed)\n\t\t\tupdate_angle(0)\n\n\t\telsif almost_at_angle(180, @angle, @rotation_speed)\n\t\t\tupdate_angle(180)\n\n\t\telsif first_quadrant?(@angle) || third_quadrant?(@angle)\n\t\t\tupdate_angle(calculate_angle(-@rotation_speed))\n\n\t\telse\n\t\t\tupdate_angle(calculate_angle(@rotation_speed))\n\n\t\tend\n\tend",
"def mutate!(mutation_rate)\n\t\t@values.size.times do |i|\n\t\t\t@values[i] += (rand - 0.5) * 0.05 if rand < mutation_rate\n\t\tend\n\n\t\tself\n\tend",
"def add_transformation_to_reagent(reagent)\n reagent.transformation = self\n end",
"def initialize\n\t\t@rotation\t= [0.0, 0.0, 0.0, 0.0]\n\tend",
"def aimtank(angle, rate = 10, dir = 0)\n @turns[0, 3] = angle % 360, rate, dir\n angle % 360 == @tankdir\n end",
"def create_rotation\n end",
"def geometric_factor\n hourly_beam_radiation_on_tilted_surface / hourly_beam_radiation_on_horizontal_surface\n end",
"def scale_degree(degree)\n \n end",
"def rotate_deg( angle_deg )\n dup.rotate_deg!( angle_deg )\n end",
"def update_object_rotation_for_time_data(delta_time)\n\n\t\t3.times do |i|\n\n\t\t\t@velocity[i] +=@acceleration[i] * delta_time * 30.0\n\n\t\t\tif\t\t@velocity[i] > MAX_VELOCITY then\n\t\t\t\t@acceleration[i]\t*= -1.0\n\t\t\t\t@velocity[i]\t\t = MAX_VELOCITY\n\t\t\telsif\t@velocity[i] < -MAX_VELOCITY then\n\t\t\t\t@acceleration[i]\t*= -1.0\n\t\t\t\t@velocity[i]\t\t = -MAX_VELOCITY\n\t\t\tend\n\n\t\t\t@rotation[i] += @velocity[i] * delta_time * 30.0\n\t\t\t@rotation[i] %= 360\n\n\t\tend\n\n\n\t\trot\t\t= [0.0, 0.0, 0.0, 0.0]\n\t\trot[0]\t= @rotation[0]\n\t\trot[1]\t= 1.0\n\t\tRotation::add_to_rotation(rot, @object_rotation)\n\t\trot[0]\t= @rotation[1]\n\t\trot[1]\t= 0.0\n\t\trot[2]\t= 1.0\n\t\tRotation::add_to_rotation(rot, @object_rotation)\n\t\trot[0]\t= @rotation[2]\n\t\trot[2]\t= 0.0\n\t\trot[3]\t= 1.0\n\t\tRotation::add_to_rotation(rot, @object_rotation)\n\n\tend",
"def angle_rads \n\t\t\t2.0 * Math.atan2( self.vec.mag, self.scalar ) \n\t\tend",
"def auto_rotate\n Jhead.call(\"-autorot\", @match, @pattern)\n end",
"def rotational_period=(period)\n self.angular_velocity = period && (2.0 * Math::PI / period)\n end",
"def update_angle( angle, node, match, angle_deg, current_word ) # TODO add param 'word', passed in from tree.hist_control.current_word\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# word is presently nil class and is causing major errors\n\t\t# set new_rotation_char (+,-) based on sign\n\t\t@literal = \"+\"\n\t\t\n\t\t@pos1 = node.str_pos\n\t\t@pos2 = match.str_pos\n\t\t# switch positions to make sure that pos1 < pos2 always, so there's a valid range later\n\t\tif @pos2 < @pos1\n\t\t\t@pos3 = @pos1\n\t\t\t@pos1 = @pos2\n\t\t\t@pos2 = @pos3\n\t\tend\n\t\t\n\t\tif @pos1 == @pos2\n\t\t\tputs \"WordController#update_angle: Well, we're fucked. How are these positions equal?\"\n\t\tend\n\t\t\n\t\t#now that @pos1 is definitely the smallest, step forward from there until you hit the first bracket\n\t\t@next_bracket = \"\"\n\t\t@pos = @pos1\n\t\t#puts \"WordController#update_angle: before while\"\n\t\twhile @next_bracket == \"\" do\n\t\t\t#puts \"WordController#update_angle: while\"\n\t\t @pos += 1\n\t\t if current_word.word[@pos..@pos] == \"[\" or current_word.word[@pos..@pos] == \"]\"\n\t\t\t\t@next_bracket = @pos\n\t\t end\n\t\t @next_bracket = current_word.word.length-1 if @pos >= current_word.word.length\n\t\t break if @pos > current_word.word.length\n\t\tend\n\t\t#puts \"WordController#update_angle: after while\"\n\t\t\n\t\tif angle > 0\n\t\t\t@literal = \"-\"\n\t\tend\n\t\t\n\t\t@times = (angle/angle_deg).abs.to_i # determines angle based on angle_deg increment\n\t\tputs \"times \" + @times.to_s\n\t\t@rotation_literal_set = \"\"\n\t\t@times.times do\n\t\t#puts \"WordController#update_angle: times.times do rotation literal set\"\n\t\t\t@rotation_literal_set << @literal\n\t\tend\n\t\tif @rotation_literal_set == \"\"\n\t\t\t@rotation_literal_set << @literal\n\t\tend\n\t\t\t\t\n\t\t#puts \"WordController#update_angle: @rotation_literal_set = #{@rotation_literal_set}\"\n\t\t#puts \"WordController#update_angle: @next_bracket = #{@next_bracket}\"\n\t\t#puts \"WordController#update_angle: pos1: \" + @pos1.to_s + \", pos2: \" + @pos2.to_s\n\t\t\n\t\t\n\t\t# replace any +/- with \n\t\t# regex starting at str_pos for a line of rotation literals +,-, more later\n\t\t\t# replace with angle/system_angle.times do @rotation_string << new_rot_char\n\t\t\n\t\t#puts \"WordController#update_angle: word[range]: \" + current_word.word[ @pos1..@next_bracket ].to_s\n\t\tcurrent_word.word[ @pos1..@next_bracket ] = current_word.word[ @pos1..@next_bracket ].gsub( /(\\++|-+)/, @rotation_literal_set )\n\t\tputs \"WordController#update_angle CURRENT WORD: \" + current_word.word.to_s\n\t\treturn current_word\n\tend",
"def initialize\n @rate = 0.10\n end",
"def element_rate(element_id)\n rank = enemy.element_ranks[element_id]\n result = [0,200,150,100,50,0,-100][rank]\n for state in states\n result /= 2 if state.element_set.include?(element_id)\n end\n return result\n end",
"def rotate\n\t\t# Compute the rotation using matrix transposition\n\t\tnew_points = rotate_points(@active_piece[:points])\n\n\t\t# Update active piece (if required, i.e. no collision detected)\n\t\t@active_piece[:points] = new_points unless collision?(new_points)\t\t\n\tend",
"def reduce_angle(a)\n modtwopi(a)\n end",
"def change_rate(rate) #TODO: separate rate changes to be dependant on dates/reservations/blocks\n @rate = rate\n end",
"def increase_rotation angle\n error(\n \"Passed argument `angle' needs to be an Integer or Float, but got\",\n \" #{angle.inspect}.#{angle.class.name}\"\n ) unless ([Integer, Float].include? angle.class)\n @rotation += angle\n handle_rotation_overflow\n end",
"def will_animate_rotate(orientation, duration)\n reapply_styles\n end",
"def will_animate_rotate(orientation, duration)\n reapply_styles\n end",
"def will_animate_rotate(orientation, duration)\n reapply_styles\n end",
"def normalize_rotation(driver, image, rotation)\n return if rotation && rotation.zero?\n\n num_quadrants = 0\n if !rotation.nil?\n if (rotation % RIGHT_ANGLE).nonzero?\n raise Applitools::EyesError.new('Currently only quadrant rotations are supported. Current rotation: '\\\n \"#{rotation}\")\n end\n num_quadrants = (rotation / RIGHT_ANGLE).to_i\n elsif rotation.nil? && driver.mobile_device? && driver.landscape_orientation? && image.height > image.width\n # For Android, we need to rotate images to the right, and for iOS to the left.\n num_quadrants = driver.android? ? 1 : -1\n end\n\n Applitools::Utils::ImageUtils.quadrant_rotate!(image, num_quadrants)\n end",
"def min_angle\n 6 * self.min\n end",
"def rotate_image(image)\n\nend",
"def rot90\n rot :d90\n end",
"def aimtank(angle,rate=10,dir=0)\n @turns[0,3] = angle%360,rate,dir\n angle%360 == heading\n end",
"def setup_rotation\n return TSBS.error(@acts[0], 3, @used_sequence) if @acts.size < 4\n @angle = @acts[1]\n change_angle(@acts[2], @acts[3])\n end",
"def get_rotation\n return @rotation\n end",
"def rotateToDegree(degree)\n preDegree = getActualAngle\n adjustment = degree - preDegree\n rotateByDegree(adjustment)\n \n dir = getCurrentDirection\n if(@@roomView)\n @@rotationArray.unshift(dir) \n end\n\n if(@@eyeView) \n @@rotateAngle = adjustment\n @@view.animation = Avatar.new\n @@rotateAngle = 0\n end\n end",
"def rotation(during, on, angle_start, angle_end, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)\n ScalarAnimation.new(during, on, :angle=, angle_start, angle_end, distortion: distortion, time_source: time_source)\n end",
"def zoom(element)\n self.raise\n case element.downcase\n when \"policy\"\n navigate_dropdown_perc(@id, 32.5, 2.5, 0, 225)\n return Zoom_policy.new\n end\n end",
"def set_polar_deg!( angle_deg, mag )\n set_polar!( angle_deg * DEG_TO_RAD, mag )\n self\n end",
"def set_relevancy!\n # calculate total of ratings\n ratings = rating.count_attributes\n ratings.each do |key,value|\n ratings[key] = value * SolutionRelevancy.send(\"rating_value_#{key}\")\n end\n total = ratings.values.inject(0) { |sum, count| sum + count }\n \n # calculate total of views\n total += views * SolutionRelevancy.view_value\n \n # calculate updates\n total += updates * SolutionRelevancy.update_value\n \n # total # of items that are included in the updates\n num_of_items = total_votes + views + updates\n\n # set the relevancy\n settings.update_attribute('relevancy',num_of_items > 0 ? total/num_of_items : AppConstants::DEFAULT_SOLUTION_RELEVANCY) \n end",
"def rotate(angle, around_x=0, around_y=0, &rendering_code); end",
"def accelerate\n @shape.body.apply_force((@shape.body.a.radians_to_vec2 * (20000.0)), CP::Vec2.new(0.0, 0.0))\n end",
"def rotate(angle)\n primitive 'rotate ' + sprintf('%g', angle)\n end",
"def rotate_by(angle, axis)\n\t\t# rotate only if cuboid is rotatable\n\t\t# determine the new dimensions for the cuboid from the old position and the given angle and axis of rotation\n\t\t# To achieve this, hold the index corresponding to the given 'axis' fixed and swap the other two idices. This is because there will be no change in dimensions in the axis of rotation. The other two indices are swapped beacuse they are perpendicular to each other and the angle of rotation is 90 degrees per rotation. The direction of rotation will be determined by the sign of the angle, where I take positive angles to be clockwise and negative angles to be counter-clockwise\n\t\tnum_of_rotations = angle.abs / 90 # determine how many roations to make\n\n\t\twhile num_of_rotations > 0 \n\t\t\tpivot = angle <= 0 ? (-1) : 1 # determine the sign from the angle. The pivot will either roatate towards the origin (0,0,0) or away from it\n\t\t\tif axis == 0\n\t\t\t\t@curr_origin = [curr_origin[0], curr_origin[1], curr_origin[2] + dimensions[2] * pivot]\n\t\t\t\t@dimensions = [dimensions[0], dimensions[2], dimensions[1]]\n\t\t\telsif axis == 1\n\t\t\t\t@curr_origin = [curr_origin[0] + dimensions[0] * pivot, curr_origin[1], curr_origin[2]]\n\t\t\t\t@dimensions = [dimensions[2], dimensions[1], dimensions[0]]\t\n\t\t\telse \n\t\t\t\t@curr_origin = [curr_origin[0], curr_origin[1] + dimensions[1] * pivot, curr_origin[2]]\n\t\t\t\t@dimensions = [dimensions[0], dimensions[1], dimensions[2]]\n\t\t\tend\n\n\t\t\tnum_of_rotations -= 1 # ignore angles smaller than 90 and round down thsoe greater than 90 to the nearest multiple of 90.\n\t\tend\n\n\t\t[@curr_origin, @dimensions] # return the curr_origin and dimensions to confirm rotation was successful\n\tend",
"def apply_rate(amount, interchange_base = 0.0, interchange_percent = 0.0)\n FeeService.apply_raw_rate(amount, @base + interchange_base, @percent + interchange_percent)\n end",
"def boost\n @shape.body.apply_force((@shape.body.a.radians_to_vec2 * (3000.0)), CP::Vec2.new(0.0, 0.0))\n end",
"def rotate_x\n x = @x.content\n z = Array.new @z.length, 0\n\n @z.length.times { |i| z[i] = x[(i - 1) % @z.length] }\n\n @z.content = z\n end",
"def grow_one_year(starting_balance, growth_rate)\n starting_balance * (1.0 + growth_rate)\nend",
"def rate_class\n super\n end",
"def rate_class\n super\n end",
"def my_rotate!(array, amt)\n\nend",
"def will_animate_rotate(orientation, duration)\n find.all.reapply_styles\n end",
"def will_animate_rotate(orientation, duration)\n find.all.reapply_styles\n end",
"def will_animate_rotate(orientation, duration)\n find.all.reapply_styles\n end",
"def will_animate_rotate(orientation, duration)\n find.all.reapply_styles\n end",
"def will_animate_rotate(orientation, duration)\n find.all.reapply_styles\n end",
"def will_animate_rotate(orientation, duration)\n find.all.reapply_styles\n end",
"def rotate angle\n position = \"#{@placement[:s]}x#{@placement[:s]}+#{@placement[:x]}+#{@placement[:y]}\"\n @image.run_command(\"convert\", @image.path, \"-rotate #{360 - angle}\", @image.path)\n @image.run_command(\"convert\", @image.path, \"-gravity Center -crop #{position}\", @image.path)\n end",
"def rotate\n g = Grid.new\n self.each do |point,v|\n g[Point.new(point.y,point.x)] = v\n end\n (0..g.height - 1).each do |y|\n ( 0..g.width/2.ceil - 1 ).each do |x|\n tmp = g[Point.new(x,y)]\n g[Point.new(x,y)] = g[Point.new(g.width - x - 1, y )]\n g[Point.new(g.width - x - 1,y)] = tmp\n end\n end\n g\n end",
"def apply_custom_transformation\n end",
"def drift_reaper_interval\n reaper_interval + (reaper_interval * DRIFT_FACTOR).to_i\n end",
"def mutate(genome)\r\n\t\tgenome.map! {|weight|\r\n\t\t\tif (rand(0..1.0) < @mutation_rate)\r\n\t\t\t\tweight + rand(-1..Params::MAX_PERTURBATION)\r\n\t\t\telse\r\n\t\t\t\tweight\r\n\t\t\tend\r\n\t\t}\r\n\tend",
"def comp_angle_max(gen)\n return 10*TREE_DEV_ANGLE_MAX_BASE*(2 - 0.5**(gen-1))\nend",
"def g_(acc,elt)\n elt/acc\nend",
"def rule\n @rule || @distribution.inject([]){|result, elm| result << [(result.empty? ? 0.0 : result.last[0]) + elm[0], elm[1]]}\\\n .tap{|array| array.last[0] = 1.0 } # make sure the last element's cdf is 1.0\n end",
"def rotation\n {\n axis: @r[0],\n angle: @r[1],\n matrix: @r[2]\n }\n end",
"def angular_velocity_rad_s\n 2 * PI / period_s\n end",
"def my_rotate(rotation = 1)\n # debugger\n answer = []\n each_with_index { |x, i| answer[i] = x }\n if rotation > 0\n rotation.times { answer.push(answer.shift) }\n elsif rotation == 0\n answer\n else\n rotation.abs.times { answer.unshift(answer.pop) }\n end\n answer\n end"
] |
[
"0.5348168",
"0.52889127",
"0.5103568",
"0.5092335",
"0.50058794",
"0.4998371",
"0.4994613",
"0.4979399",
"0.49764386",
"0.49746865",
"0.48339677",
"0.48143652",
"0.47985113",
"0.47170138",
"0.47086063",
"0.46895397",
"0.46819085",
"0.4680437",
"0.4656197",
"0.46462533",
"0.46438608",
"0.46419114",
"0.46368772",
"0.46208027",
"0.45927265",
"0.45633426",
"0.45277947",
"0.4518308",
"0.4518308",
"0.44987878",
"0.44842026",
"0.4471264",
"0.44650242",
"0.4454075",
"0.4453702",
"0.44495168",
"0.44416898",
"0.4439391",
"0.44379872",
"0.4432539",
"0.44306862",
"0.44267407",
"0.44193226",
"0.4417272",
"0.44041234",
"0.44035783",
"0.43902686",
"0.4375509",
"0.4374008",
"0.4363871",
"0.43623748",
"0.43609455",
"0.43568325",
"0.43527374",
"0.4342784",
"0.43402666",
"0.4338786",
"0.4338503",
"0.4338503",
"0.4338503",
"0.43376353",
"0.43347704",
"0.43332335",
"0.43308422",
"0.43270817",
"0.43223414",
"0.43191087",
"0.4310459",
"0.4310071",
"0.429508",
"0.42880052",
"0.42644134",
"0.42628786",
"0.4250066",
"0.42477962",
"0.42472756",
"0.4242691",
"0.42326638",
"0.42304367",
"0.4229962",
"0.42227337",
"0.42227337",
"0.4219331",
"0.4214951",
"0.4214815",
"0.4214815",
"0.4214815",
"0.4214815",
"0.4214815",
"0.42122272",
"0.41934964",
"0.4191108",
"0.41849163",
"0.41764852",
"0.41739187",
"0.41635102",
"0.41546372",
"0.41517618",
"0.41504815",
"0.41460612"
] |
0.52708966
|
2
|
Determines if the supplied user is an owner of the account.
|
def has_owner? user
self.account_users.where(user: user, is_owner: true).count > 0
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def owner?(user)\n user == owner || owners.include?(user)\n end",
"def owner? (user)\n user == owner\n end",
"def is_owner?(user)\n !user.nil? && (self.user_id == user.id)\n end",
"def is_owner?(this_user)\n user == this_user\n end",
"def is_owner?(user)\n user.id == self.user_id\n end",
"def is_owner?(username)\n User.get_user(username).eql?(self.owner)\n end",
"def owner?(user)\n\t\tuser.id == self.user.id\n\tend",
"def owned_by?(user)\n if (access_restricted?)\n return self.acl.owner?(user)\n end\n return false\n end",
"def owner? usr\n user_id == usr.id\n end",
"def is_owner?\n Account.current ? Account.current.has_owner?(self) : false\n end",
"def owned_by?(user)\n return false unless user.is_a? User\n \n # allow admins and project owners to edit\n user.admin? or self.owner == user\n end",
"def owned_by?(user)\n return false unless user.is_a? User\n \n # allow admins and project owners to edit\n user.admin? or self.owner == user\n end",
"def owned?\n user.present?\n end",
"def user_owner_entry?\n user_entry? && principle == \"OWNER\"\n end",
"def is_owner?(xaccount:)\n # DRAFT and creator means owner\n return true if publication.is_draft? && publication.current_version.is_creator?(xaccount: xaccount)\n\n # Author means owner\n return true if publication.current_version.is_author?(xaccount: xaccount)\n\n # All others are not owners\n false\n end",
"def owner?(current_user)\n user == current_user\n end",
"def owned_by?(u)\n self.user == u\n end",
"def has_owner(user)\n return self.user.id==user.id\n end",
"def owned_by? a_user\n a_user == user\n end",
"def is_owned_by_user?(user)\n self.user == user\n end",
"def user_is_owner_or_admin?\n record.user == user || user.try(:admin?)\n end",
"def user_is_guild_owner?\n @guild = Guild.find(User.find(session[:user_id])[:guild_id])\n return (@guild[:owner_id] == session[:user_id]) ? true : false\n end",
"def is_owner_of?(thing)\n return false unless thing.user == self\n true\n end",
"def object_owner?\n User.find(params[:user_id]) == current_user\n end",
"def check_owner_user\n @guild = Guild.find(@invite[:guild_id])\n if self.admin?\n return 1\n end\n return (@guild[:owner_id] == session[:user_id]) ? 1 : nil\n end",
"def is_owner?(account)\n attachable == account.profile\n end",
"def is_owner?(object, no_admin = false)\n if current_user && current_user.id === object.user.id && (object.user.is_admin? || !no_admin)\n return true\n elsif is_admin? && !no_admin\n return true\n else\n return false\n end\n rescue\n return false\n end",
"def owner?(id)\n if current_user.id == id\n return true\n else\n return false\n end\n end",
"def is_owner\n object == current_user\n end",
"def owner?(key = :user_id)\n # Lookup the original user_id\n owner_id = was(key) || send(:\"_#{key}\")\n !owner_id.nil? && owner_id == Volt.current_user_id\n end",
"def owner?(user_asking)\n user_asking.in? company.owners\n end",
"def belongs_to?(user)\n return false unless user.instance_of? User\n return self.owner == user\n end",
"def hasOwner? \n\t\tunless self.author_id.nil? || self.author_id == 0\n\t\t\tUser.find(self.author_id)\n\t\tend\n\n\tend",
"def i_am_owner_or_admin(user_id)\n\t\tuser_to_check = User.find(user_id)\n\t\tif user_to_check\n\t\t\tif user_to_check.is_admin\n\t\t\t\treturn true\n\t\t\telse\n\t \t\tif self.user_id == user_to_check.id\n\t \t\t\treturn true\n\t \t\telse\n\t \t\t\treturn false\n\t \t\tend\n\t\t\tend\n\t\tend\n\tend",
"def owned?(user_to_check = current_user)\n user_to_check ? self.creator == user_to_check : false\n end",
"def is_owner?(item)\n current_user_id == item.user_id\n end",
"def owner?\n resource.user_id == current_user.id\n end",
"def owner? obj, relation=nil\n if relation \n return true if user_relation?(obj, relation)\n end \n [:user, :owner, :author].each do |relation| \n return true if user_relation?(obj, relation)\n end\n false\n end",
"def is_owned_by?(user_id)\n self.user_id == user_id\n end",
"def owned_by?(user_id)\n user_id = user_id.id if user_id.is_a?(User)\n has_role(user_id, :creator)\n end",
"def belongs_to?(user)\n return nil if user.nil?\n\n owner == user\n end",
"def owner?\n record.id == user.id\n end",
"def user_is_owner_or_admin?\n record.reading.user == user || user.try(:admin?)\n end",
"def owner?(c_utor)\n contribution.owner?(c_utor)\n end",
"def is_owner? (opportunity)\n \topportunity.user_id == self.id\n end",
"def is_owner?(pid, oid)\n oid.owner == get_object(pid).owner\n end",
"def owned_by?(current_user)\n current_user && user_id == current_user.id\n end",
"def owner?(photo)\n !photo.nil? && photo.owner == current_user\n end",
"def owned_by?(actor)\n # defaults to false. Override if resource has owner\n false\n end",
"def i_am_owner_or_admin(user_id)\n \tuser_to_check = User.find(user_id)\n \tif user_to_check\n \t\tif user_to_check.is_admin\n \t\t\treturn true\n \t\telse\n\t \t\tif self.from_user_id == user_to_check.id\n\t \t\t\treturn true\n\t \t\telse\n\t \t\t\treturn false\n\t \t\tend\n \t\tend\n\n \tend\n\n end",
"def owner?(current_user)\n current_user && (self.user == current_user || current_user.has_role?(:refinery))\n end",
"def check_is_guild_owner\n @guild = Guild.find(User.find(session[:user_id])[:guild_id])\n return (@guild[:owner_id] == session[:user_id]) ? 1 : nil\n end",
"def owner?(resource:)\n current_user.present? && resource&.user_id == current_user.id\n end",
"def user_is_track_owner?(track)\n return false if current_user.nil?\n return true if current_user.has_role?('admin')\n current_user.is_track_owner?(track)\n end",
"def owner?(post_owner) # <= User object\n current_user == post_owner\n end",
"def article_owner?(obj)\n\t\t\tcurrent_user.id == obj.user_id\n\t\tend",
"def owner_user_in_db?\n Woodlock::User.find_by(github_username: @project.github_owner) ? true : false\n end",
"def object_owner_for_resource?(object)\n object.user == current_user\n end",
"def owner?(project)\n if id == project.user.id\n true\n else\n false\n end\n end",
"def editable_by?(user)\n\t \t# user && user == owner\n\t user == user\n \tend",
"def user_is_owner?\n current_cookbook.is_owner?(current_user)\n end",
"def is_owned_by?(member = nil)\n return false if member.blank?\n if self.designer == member or self.client == member\n true\n else\n member.is_super_user? ? true : false\n end\n rescue\n false\n end",
"def enrolled?(user)\n return false if user == owner\n users.include?(user)\n end",
"def owner?\n name == 'owner'\n end",
"def owner?\n customer.owner_id == id\n end",
"def owner?(c_utor)\n case self.contributor_type\n when \"User\"\n return (self.contributor_id == c_utor.id && self.contributor_type == c_utor.class.name)\n # TODO some new types of \"contributors\" may be added at some point - this is to cater for that in future\n # when \"Network\"\n # return self.contributor.owner?(c_utor.id) if self.contributor_type.to_s\n else\n # unknown type of contributor - definitely not the owner \n return false\n end\n end",
"def is_resource_owner?(resource)\n current_user && current_user.id == resource.user_id\n end",
"def whose?(user, object)\n case object\n when Post\n owner = object.author\n when Comment\n owner = object.user\n else\n owner = nil\n end\n if user and owner\n if user.id == owner.id\n \"his\"\n else\n \"#{owner.nickname}'s\"\n end\n else\n \"\"\n end\n end",
"def owners_remaining?(team_user)\n return true unless team_user.only_owner?\n return true unless params[:role].nil? || params[:role] != \"owner\"\n\n @message = \"Cannot remove the only owner of the team\"\n false\n end",
"def owner_of(resource)\n id == resource.user_id ? true : false\n end",
"def owned?(path)\n info = Private.info_with(path, GLib::G_FILE_ATTRIBUTE_OWNER_USER)\n owner = GLib.g_file_info_get_attribute_string(info, GLib::G_FILE_ATTRIBUTE_OWNER_USER)\n owner == GLib.g_get_user_name()\n end",
"def member?(user)\n user.has_role?(:member, self) || owner.try('member?', user)\n end",
"def owned?\n !owner.nil?\n end",
"def load_user_and_authorization\n @owner_user = User.find( params[:user_id] )\n @current_user_is_owner = ( current_user_id == params[:user_id].to_i )\n end",
"def is_global_or_owned_by?(user)\n self.is_global? || self.user_id == user.id\n end",
"def editable_by?(user)\n \tuser && user == owner\n\tend",
"def is_owner?(person)\n return person !=nil && person.team_id == self.id && person.role == \"captain\"\n end",
"def owner_set?\n return false if current_owner_name.nil?\n\n !current_owner_name.empty?\n end",
"def is_the_user_the_owner(scrollz, user)\n if scrollz.user_id != user.id\n flash[:notice] = \"?\"\n redirect_to scrollz_path(@scrollz)\n end\n end",
"def routine_owner\n record.user == user\n end",
"def managed_by? a_user\n owned_by? a_user || program.moderator == a_user\n end",
"def is_admin_or_owner client, event\n # calls users_info on slack\n info = client.users_info(user: event.user_id ) \n info['user']['is_admin'] || info['user']['is_owner']\n end",
"def owner? obj\n return false unless obj\n return true if operator?\n\n section_name = obj.class.to_s.tableize\n return true if admin?(section_name)\n\n # obj is User, simple way to define user_id\n return id == obj.id if obj.is_a?(self.class)\n\n # few ways to define user_id\n return id == obj.user_id if obj.respond_to? :user_id\n return id == obj[:user_id] if obj[:user_id]\n return id == obj[:user][:id] if obj[:user]\n\n false\n end",
"def owned_by? a_user\n a_user == program.moderator\n end",
"def current_user_owns?(item)\n \t!item.nil? && current_user.is_a?(User) && (item.is_a?(User) ? current_user == item : current_user.is_author_of?(item)) \n end",
"def game_owner?\n self == game.owner if game.winner.nil?\n end",
"def i_dont_own?(object)\n if(current_user.present? and object.user.present? and object.user.id.present? and (current_user.id == object.user.id))\n false\n else\n true\n end\n end",
"def owner?(owner_id)\n return true if current_user && current_user.id.to_i == owner_id.to_i\n\n flash[:info] = 'You are not authorised to view that page.'\n redirect '/app'\n false\n end",
"def user?(user)\n user.id == self.user_id if user\n end",
"def managed_by? a_user\n program.owned_by? a_user\n end",
"def owner_of(group)\n current_user.is_owner?(group)\n end",
"def owner?\n # exists? ? `ls -al #{path} | grep '[0-9] \\.$'`.split[2] : false\n proprieties[:owner]\n end",
"def valid?\n owner_validator = EnumAttributeValidator.new('String', [\"user\", \"application\"])\n return false unless owner_validator.valid?(@owner)\n return true\n end",
"def user_is_owner_of_proposal?(proposal_user_id)\n \t\tuser_signed_in? && (proposal_user_id == current_user.id)\n \tend",
"def owner_of_dog?\n dog_has_owner? && current_user ? dog_owner.id == current_user.id : false\n end",
"def user_can_see?(user)\n !self.private || self.is_owner?(user)\n end",
"def authorized_for_user?(user)\n is_authorized_for?(user, user.circle)\n end",
"def is_current_user?\n current_account.id.eql?(object.user.id)\n end",
"def admin_or_owner?(id)\n if (admin?(id) || owner?(id))\n return true\n else\n return false\n end\n end",
"def is_not_global_and_is_owned_by?(user)\n !self.is_global? && self.user_id == user.id\n end"
] |
[
"0.82786024",
"0.8251542",
"0.8152414",
"0.79650974",
"0.7939119",
"0.79154015",
"0.7902074",
"0.7867498",
"0.78300935",
"0.7815641",
"0.77649164",
"0.77649164",
"0.76464283",
"0.7631401",
"0.75297576",
"0.75031",
"0.749518",
"0.7440216",
"0.7437757",
"0.74172765",
"0.7387799",
"0.73531777",
"0.73410356",
"0.7312673",
"0.72929204",
"0.72655916",
"0.72487944",
"0.722417",
"0.7214087",
"0.7178083",
"0.71293783",
"0.71274203",
"0.7089215",
"0.7053239",
"0.70376146",
"0.70351315",
"0.7029852",
"0.7019662",
"0.7015197",
"0.70119566",
"0.70113593",
"0.70006335",
"0.6994529",
"0.6982744",
"0.6972506",
"0.6953557",
"0.6950789",
"0.69308853",
"0.68811065",
"0.6876269",
"0.68708616",
"0.68701947",
"0.6859577",
"0.68445456",
"0.6834946",
"0.6823235",
"0.6822322",
"0.6800689",
"0.6743963",
"0.67142546",
"0.6707742",
"0.6691248",
"0.66875774",
"0.6672261",
"0.66605246",
"0.66487175",
"0.6626691",
"0.66189075",
"0.6597838",
"0.6555656",
"0.6541451",
"0.65292805",
"0.6525476",
"0.651505",
"0.6514221",
"0.65075684",
"0.6499142",
"0.64800334",
"0.6475563",
"0.64710134",
"0.64569604",
"0.64505583",
"0.6447927",
"0.644609",
"0.6394663",
"0.63931644",
"0.63931555",
"0.6389393",
"0.6387385",
"0.6382612",
"0.6373485",
"0.63709533",
"0.6367761",
"0.6364426",
"0.635162",
"0.6348523",
"0.6339873",
"0.632986",
"0.63156587",
"0.63053906"
] |
0.8629043
|
0
|
Helper sets all defaults on the current model prior to VALIDATIONS
|
def set_defaults
self.state ||= 'NEW'
self.account_id ||= Gizmo::Util::Uuid.generate
self.account_name ||= self.subdomain
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new_model_defaults\n end",
"def set_default_attributes\n self.attributes = default_attributes\n self.attributes.each do |key, value|\n # Scrub the attributes if there's no value\n attr_clean!(key) unless value\n end\n end",
"def set_default_values\n # set_new_record_default_values\n set_attr_accessor_default_values\n end",
"def set_defaults\n #self.required_by_manufacturer ||= true\n end",
"def set_defaults\n end",
"def set_defaults\n end",
"def set_defaults\n\n end",
"def set_defaults\n\n end",
"def set_defaults\n\n end",
"def set_defaults\n\n end",
"def set_defaults\n\n end",
"def set_defaults\n\n end",
"def set_defaults\n unless persisted?\n end\n end",
"def defaults\n self.behaviour_evaluated = false if self.behaviour_evaluated.nil?\n self.special_needs_ok = false if self.special_needs_ok.nil?\n self.long_term_resident = false if self.long_term_resident.nil?\n self.senior = false if self.senior.nil?\n end",
"def set_default_values\n if self.price.nil?\n self.price = 0.0\n end\n if self.rating.nil?\n self.rating = 0\n end\n if self.enabled.nil?\n self.enabled = false\n end\n if self.no_of_reviews.nil?\n self.no_of_reviews = 0\n end\n if self.no_of_registrations.nil?\n self.no_of_registrations = 0\n end\n end",
"def set_defaults\n self.min_service_life_months ||= 0\n self.replacement_cost ||= 0\n self.lease_length_months ||= 0\n self.rehabilitation_service_month ||= 0\n self.rehabilitation_labor_cost ||= 0\n self.rehabilitation_parts_cost ||= 0\n self.extended_service_life_months ||= 0\n self.min_used_purchase_service_life_months ||= 0\n self.cost_fy_year ||= current_planning_year_year\n end",
"def set_defaults\n self.published ||= false\n self.archived ||= false\n self.is_default ||= false\n self.version ||= 0\n self.visibility = ((self.org.present? && self.org.funder_only?) || self.is_default?) ? Template.visibilities[:publicly_visible] : Template.visibilities[:organisationally_visible] unless self.id.present?\n self.customization_of ||= nil\n self.family_id ||= new_family_id\n self.archived ||= false\n self.links ||= { funder: [], sample_plan: [] }\n end",
"def set_default_values\n self.is_paid = false\n self.is_served = false\n self.is_preparation_started = false\n self.is_preparation_done = false\n return true\n end",
"def required_defaults; end",
"def reset_defaults; end",
"def default_model_attrs\n @default_model_attrs ||= begin\n config[:model].constantize.netzke_attributes.map do |attr| \n attr.merge(\n :label => attr[:label] || attr[:name].humanize,\n :attr_type => attr[:attr_type].to_s\n )\n end\n end\n end",
"def preset_default_values( params_hash = {} )\n # XXX AmbGest 1.10 does not have a Firm entity:\n# unless self.firm\n# begin\n# if self.user_id and (default_firm_id = LeUser.find(self.user_id).firm_id)\n# self.firm_id = default_firm_id\n# end\n# rescue\n# self.firm_id = nil\n# end\n# end\n # Set default date for this entry:\n# self.date_last_met = Time.now unless self.date_last_met\n self\n end",
"def set_defaults\n if self.has_attribute?(:extra_cost)\n self.extra_cost ||= 0.0\n end\n if self.has_attribute?(:stock)\n self.stock ||= 0.0\n end\n end",
"def set_defaults\n super\n end",
"def set_defaults\n super\n end",
"def set_defaults\n unless persisted? \n self.active ||= false\n self.complete ||= false\n self.start_on ||= Date.today\n self.finished_on ||= Date.today + 1\n end\n end",
"def set_defaults\n self.created_at ||= DateTime.now.utc\n self.keyword ||= nil\n self.extra ||= nil\n end",
"def set_defaults\n self.annual_inflation_rate ||= 1.1\n self.pcnt_residual_value ||= 0\n self.condition_rollup_weight ||= 0\n end",
"def set_default_values\n self.points_log ||= POINTS_LOG\n self.points_log_first_of_day ||= POINTS_LOG_FIRST_OF_DAY\n self.points_peer_assessment ||= POINTS_PEER_ASSESSMENT\n self.points_peer_assessment_first_of_team ||= POINTS_PEER_ASSESSMENT_FIRST_OF_TEAM\n self.points_project_evaluation ||= POINTS_PROJECT_EVALUATION\n self.points_project_evaluation_first_of_team ||= POINTS_PROJECT_EVALUATION_FIRST_OF_TEAM\n self.max_logs_per_day ||= MAX_LOGS_PER_DAY\n self.points_project_evaluation_submitted_first_day ||= POINTS_PROJECT_EVALUATION_SUBMITTED_FIRST_DAY\n self.points_peer_assessment_submitted_first_day ||= POINTS_PEER_ASSESSMENT_SUBMITTED_FIRST_DAY\n self.marking_algorithm_id ||= MARKING_ALGORITHM_ID\n end",
"def set_default_attrs\n self.state = 'Texas' if self.respond_to? :state\n self.origin = 'hunted' if self.respond_to? :origin\n self.gender = 'male' if self.respond_to? :gender\n if self.respond_to? :parts\n parts = Part::NAMES.map { |part_name| {name: part_name} }\n parts << { other: true }\n self.parts = parts\n end\n if self.respond_to? :taxidermy_parts\n taxidermy_parts = self.class::DEFAULT_TAXIDERMY_PARTS.map { |part_name| {name: part_name} }\n taxidermy_parts << { other: true }\n self.taxidermy_parts = taxidermy_parts\n end\n self\n end",
"def set_defaults\n if self.state.blank?\n self.state ||= :unsubmitted\n end\n if self.priority.blank?\n self.priority ||= :medium\n end\n if self.start.blank?\n self.start = Time.now + 1.day\n end\n if self.end.blank?\n self.end = start.to_time + 1.hour\n end\n if self.repeats.blank?\n end\n end",
"def set_defaults\n unassigned_status_id = Status.find_by(code: 'UNASSIGNED').try(:id)\n priority_id = Priority.find_by(code: 'LOW')\n category_id = Category.find_by(code: 'OTHER')\n self.status_id = unassigned_status_id if status_id.blank?\n self.priority_id = priority_id if self.priority_id.blank?\n self.category_id = category_id if self.category_id.blank?\n end",
"def set_defaults\n self.not_to_exceed ||= false\n self.emergency ||= false\n end",
"def set_defaults\n self.not_to_exceed ||= false\n self.emergency ||= false\n end",
"def set_default_values\n self.base_exp ||= 0\n self.time_bonus_exp ||= 0\n self.extra_bonus_exp ||= 0\n end",
"def defaults\n super\n end",
"def defaults\n if self.name == \"Alex Ames\" || self.name == \"Ife Runsewe\"\n self.admin ||= true\n else\n self.admin ||= false\n nil #^Leaving a false value on the stack means the model will not be saved.^\n end\n end",
"def validation_default; true; end",
"def validation_default; true; end",
"def set_defaults\n if self.has_attribute?(:hidden) && self.hidden.nil?\n self.hidden = true\n end\n if self.has_attribute?(:base_price)\n self.base_price ||= 0.0\n end\n end",
"def defaults!; end",
"def defaults!; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def set_default\n end",
"def preset_default_values( params_hash = {} )\n unless self.patient # Set current patient only if not set\n begin\n if params_hash[:patient_id]\n self.patient_id = params_hash[:patient_id].to_i\n end\n rescue\n self.patient_id = nil\n end\n end\n # If patient is set and price not, get the default price:\n unless self.receipt_description\n if (self.patient_id.to_i > 0) && (p = Patient.find(self.patient_id))\n self.price = p.default_invoice_price unless (self.price.to_f > 0.0)\n self.receipt_description = p.default_invoice_text if self.receipt_description.blank? && (! p.default_invoice_text.blank?)\n end\n # Set the default description if not yet set:\n self.receipt_description = Receipt.get_default_receipt_description(self) unless self.receipt_description\n end\n\n unless self.date_receipt # A default date_receipt must be set anyhow:\n begin \n self.date_receipt = params_hash[:date_receipt] ? params_hash[:date_receipt] : Time.now\n rescue # Set default date for this entry:\n self.date_receipt = Time.now\n end\n end\n\n self.receipt_num = Receipt.get_next_receipt_num() unless (self.receipt_num > 0)\n self.is_receipt_delivered ||= 0\n # [Steve, 20100915] Known issue: we cannot set automatically or directly the \"is_payed\" flag (for instance,\n # reading the corresponding flag on any issuing appointment row) since this acts as a global \"is_payed\" status\n # for the whole due amount and - also - there may be more than 1 appointment rows linked to this receipt\n # (and the patient could be paying just a partial sum on each appointment).\n # So this needs to be cleared on start, until the whole receipt has been effectively \"payed\" (the user toggles it).\n self.is_payed ||= 0\n self\n end",
"def set_default_values\n self.base_exp ||= 0\n self.time_bonus_exp ||= 0\n end",
"def set_default_values\n self.base_exp ||= 0\n self.time_bonus_exp ||= 0\n end",
"def set_defaults\n self.active = self.active.nil? ? true : self.active\n self.sogr ||= false\n self.notional ||= false\n self.multi_year ||= false\n self.emergency ||= false\n self.state ||= :unsubmitted\n self.project_number ||= 'TEMP'\n # Set the fiscal year to the current fiscal year which can be different from\n # the calendar year\n self.fy_year ||= current_fiscal_year_year\n end",
"def set_defaults\n\t\tself.outside_agency_staff\t= DEFAULT_FIELD_TEXT\t\t\tif outside_agency_staff.nil?\n\t\tself.overview \t\t\t\t\t\t= DEFAULT_FIELD_TEXT\t\t \tif overview.nil?\n\t\tself.ratio \t\t\t\t\t\t\t\t= DEFAULT_FIELD_TEXT\t\t \tif ratio.nil?\n\t\tself.trainings_needed \t\t= DEFAULT_FIELD_TEXT\t\t \tif trainings_needed.nil?\n\t\tself.medication_times \t\t= DEFAULT_FIELD_TEXT\t\t \tif medication_times.nil?\n\t\tself.waivers \t\t\t\t\t\t\t= DEFAULT_FIELD_TEXT\t\t \tif waivers.nil?\n\t\tself.keys \t\t\t\t\t\t\t\t= DEFAULT_FIELD_TEXT\t\t \tif keys.nil?\n\t\tself.schedule_info \t\t\t\t= DEFAULT_FIELD_TEXT \t\t\tif schedule_info.nil?\n\t\tself.phone_numbers \t\t\t\t= DEFAULT_FIELD_TEXT \t\t\tif phone_numbers.nil?\n\t\tself.behavior_plans \t\t\t= DEFAULT_FIELD_TEXT \t\t\tif behavior_plans.nil?\n\t\tself.name\t\t\t\t\t\t\t\t\t= \"Untitled\"\t\t\t\t \t\t\tif name.nil?\n self.address_street\t\t\t\t= DEFAULT_ADDRESS_STREET \tif address_street.nil?\n self.address_city\t\t\t\t\t= DEFAULT_ADDRESS_CITY \t\tif address_city.nil?\n self.address_state\t\t\t\t= DEFAULT_ADDRESS_STATE \tif address_state.nil?\n self.address_zip\t\t\t\t\t= DEFAULT_ADDRESS_ZIP \t\tif address_zip.nil?\n self.phone_1\t\t\t\t\t\t\t= DEFAULT_PHONE_1 \t\t\t\tif phone_1.nil?\n self.phone_2\t\t\t\t\t\t\t= DEFAULT_PHONE_2 \t\t\t\tif phone_2.nil?\n self.fax\t\t\t\t\t\t\t\t\t= DEFAULT_FAX \t\t\t\t\t\tif fax.nil?\n self.bu_code\t\t\t\t\t\t\t= DEFAULT_BU_CODE\t\t \t\t\tif bu_code.nil?\n\tend",
"def deferred_defaults\n set_default_path\n set_default_properties\n end",
"def validation_default; false; end",
"def init_default_attributes\n self.config_params ||= DEFAULT_CONFIG_PARAMS\n self.has_inventory = true\n end",
"def set_default\n self.state ||= :active\n self.validity_days ||= 14\n end",
"def set_defaults\n self.mmr ||= 1500\n self.k_value ||= 40\n self.home_mmr ||= self.mmr\n self.away_mmr ||= self.mmr\n self.active ||= true\n self.total_games ||= 0\n end",
"def set_defaults\n self.active = self.active.nil? ? true : self.active\n self.estimated_cost ||= 0\n self.anticipated_cost ||= 0\n end",
"def setup_defaults\n validate_defaults\n @selected = @choices.values_at(*@default.map { |d| d - 1 })\n @active = @default.last unless @selected.empty?\n end",
"def set_defaults\n self.state ||= 'ACTIVE'\n self.account_user_id ||= Gizmo::Util::Uuid.generate\n self.is_owner ||= false\n end",
"def initialize\n super\n self.class.attributes.reject { |attr| attr.default.nil? }.each do |attr|\n send(\"#{attr.method_name}=\", attr.default)\n end\n end",
"def defaults\n self.searchable ||= false\n self.displayable ||= true\n self.facetable ||= false\n self.multivalued ||= false\n self.sortable ||= false\n self.data_type ||= \"string\"\n end",
"def reset!\n defaults = Settler.config[self.key]\n self.label = defaults['label']\n self.value = defaults['value']\n self.editable = defaults['editable']\n self.deletable = defaults['deletable']\n self.deleted = false\n save(:validate => false)\n end",
"def defaults\n self.class.defaults\n end",
"def reset_nil_attributes_to_default\n nil_attributes = self.class.non_nil_attributes.find_all do |name|\n !instance_variable_defined?(\"@#{name}\") || instance_variable_get(\"@#{name}\").nil?\n end\n\n nil_attributes.each do |attribute|\n default = self.default_value attribute\n\n value = case default\n when Time, Numeric, Symbol, true, false, nil then default\n else default.dup\n end\n\n instance_variable_set \"@#{attribute}\", value\n end\n\n @installed_by_version ||= nil\n end",
"def assign_defaults\n\t\t## WHICH OF OUR EMPLOYEES CAN RESIGN, BECOMES THE SAME AS WHO CAN VERIFY.\n\t\tself.which_of_our_employees_will_resign_outsourced_reports = self.who_can_verify_reports if self.which_of_our_employees_will_resign_outsourced_reports.blank?\n\tend",
"def set_defaults\n self.availability ||=false\n self.email ||= @profile.user.email\n end",
"def set_defaults\n self.current_score ||= 0\n self.highest_score ||= 0\n self.total_correct ||= 0\n self.total_worth_credit ||= 0\n end",
"def set_defaults\n super\n self.extended_useful_life_months ||= 0\n self.extended_useful_life_miles ||= 0\n end",
"def setup_defaults\n if @default.to_s.empty?\n @default = (0..choices.length).find { |i| !choices[i].disabled? } + 1\n end\n validate_defaults\n if default_choice = choices.find_by(:name, @default)\n @default = choices.index(default_choice) + 1\n end\n mark_choice_as_active\n end",
"def set_default_options\n end",
"def defaults\n self.class.defaults #.merge(@defaults || {})\n end",
"def set_defaults\n self.active = self.active.nil? ? true : self.active\n self.show_in_dashboard = self.show_in_dashboard.nil? ? true : self.show_in_dashboard\n self.system_activity = self.system_activity.nil? ? false : self.system_activity\n self.frequency_quantity ||= 1\n end",
"def set_defaults\n self.country ||= 'Sverige'\n end",
"def set_default_values\n self.synced_with_gram = false\n end",
"def set_default_values\n self.synced_with_gram = false\n end",
"def default_values\n self.subtype ||= \"registered\"\n self.status ||= \"NEW\"\n end",
"def set_defaults\n unless persisted? \n self.solution_type ||= 'Export'\n self.client_approved ||= false\n self.drive_time_from_load_to_tip ||= 0\n self.drive_time_into_site ||= 0\n self.drive_time_into_tip ||= 0\n self.drive_time_out_of_site ||= 0 \n self.drive_time_tip_to_load ||= 0\n self.drive_time_out_of_tip_site ||= 0\n self.invoice_load_client ||= 0.00\n self.pay_load_client ||= 0.00\n self.invoice_tip_client ||= 0.00\n self.pay_tip_client ||= 0.00\n self.kms_one_way ||= 0\n self.load_time ||= 0\n self.loads_per_day ||= 0\n self.pay_equipment_per_unit ||= 0.00\n self.pay_tip ||= 0.00\n self.pay_tolls ||= 0.00\n self.semis_permitted ||= false\n self.approved ||= false\n self.total_material ||= 0\n self.unit_of_material ||= 'm3'\n self.unload_time ||= 0\n self.purchase_order_required ||= self.quote.project.company.PO_required\n self.drive_time_out_of_tip_site ||= 0\n # Job delegates to :equipment_units_required_per_day\n \n self.invoice_load_client ||= 0.00\n self.pay_load_client ||= 0.00\n self.invoice_tip_client ||= 0.00\n self.pay_tip_client ||= 0.00\n self.hourly_hire_rate ||= 0.00\n \n self.equipment_units_required_per_day ||= 1\n self.equipment_dollars_per_day ||= 1250 unless self.equipment_dollars_per_day\n end\n end",
"def default_values\n if order.nil? || confirm.nil?\n self.order ||= 1\n self.confirm ||= false\n end\n end",
"def set_defaults\n self.condition_estimation_type_id ||= 1\n self.condition_threshold ||= 2.5\n end",
"def preset_default_values( params_hash = {} )\n unless self.firm\n begin\n default_firm_id = params_hash[:firm_id] ||\n ( params_hash[:user_id] && LeUser.find(params_hash[:user_id].to_i).firm_id )\n self.firm_id = default_firm_id\n rescue\n self.firm_id = nil\n end\n end\n # Set default date for this entry:\n self.date_last_met = Time.now unless self.date_last_met\n self\n end",
"def default_values\n\t\tself.status = 0 unless self.status\n\t\tself.tagged = 0 unless self.tagged\n\t\tself.searched = 0 unless self.searched\n\tend",
"def reset_default_fields\n self.cleared_default_fields.each do |k, v|\n self.send(\"#{k}=\", v)\n end\n end",
"def set_defaults\n # should set the default based on category\n if self.fta_asset_category.try(:name) == 'Facilities'\n self.useful_life_benchmark ||= 3\n self.useful_life_benchmark_unit ||= 'condition_rating'\n elsif self.fta_asset_category.try(:name) != 'Infrastructure'\n self.useful_life_benchmark ||= self.asset_level.try(:default_useful_life_benchmark)\n self.useful_life_benchmark_unit ||= self.asset_level.try(:useful_life_benchmark_unit)\n end\n\n self.useful_life_benchmark_locked = self.useful_life_benchmark_locked.nil? ? false : self.useful_life_benchmark_locked\n\n if self.fta_asset_category.try(:name) == 'Infrastructure'\n self.pcnt_goal ||= 10\n else\n self.pcnt_goal ||= 0\n end\n\n self.pcnt_goal_locked = self.pcnt_goal_locked.nil? ? false : self.pcnt_goal_locked\n\n end",
"def preset_default_values( params_hash = {} )\n unless self.patient # Set current patient only if not set\n begin\n if params_hash[:patient_id]\n self.patient_id = params_hash[:patient_id].to_i\n end\n rescue\n self.patient_id = nil\n end\n end\n\n unless self.date_schedule # A default date schedule must be set anyhow:\n begin \n self.date_schedule = params_hash[:date_schedule] ? params_hash[:date_schedule] : Time.now\n rescue # Set default date for this entry:\n self.date_schedule = Time.now\n end\n end\n self\n end",
"def start_with_default_params!\n default_params = upper(:@@default_params) || {}\n @params.reverse_merge!(default_params)\n end",
"def default_values\n self.active ||= false\n end",
"def add_default_values\n ensure_license\n ensure_publisher\n ensure_resource_type\n end",
"def set_defaults\n self.active ||= false\n end",
"def set_default_values\n @mappings ||= {}\n @attr_methods ||= []\n @search_mappings ||= {}\n @value_blocks ||= {}\n @missing_blocks ||= {}\n @primary_key ||= :id\n end",
"def set_default_values\n self.class.defaults.each do |key, default|\n self[key] ||= default\n end\n end",
"def default\n defaults = {}\n @rules.each {|rule| rule.complete_defaults(defaults)}\n defaults\n end",
"def defaults(params)\n @defaults = @defaults.merge(params)\n end",
"def default_values\r\n # Create a unique ID\r\n unique = Time.now.to_f.to_s.gsub('.','').to_i.to_s(36)\r\n unique += Random.rand(\"9\".ljust(16-unique.length,\"9\").to_i).to_s\r\n self.condition_id ||= unique\r\n \r\n # Handle other defaults\r\n self.update_number ||= 1\r\n self.audit_update_date_time ||= DateTime.now\r\n self.effective_status ||= 'ACTIVE'\r\n self.effective_date ||= DateTime.now\r\n end"
] |
[
"0.75367063",
"0.71556914",
"0.7081816",
"0.70598847",
"0.7058594",
"0.7058594",
"0.7046246",
"0.7046246",
"0.7046246",
"0.7046246",
"0.7046246",
"0.7046246",
"0.7029176",
"0.68784803",
"0.68392223",
"0.6712017",
"0.67078304",
"0.66635025",
"0.66589546",
"0.6647051",
"0.66224843",
"0.6610243",
"0.66073054",
"0.66041166",
"0.66041166",
"0.6600186",
"0.6564964",
"0.6561274",
"0.65574247",
"0.6548897",
"0.65478545",
"0.6536144",
"0.651444",
"0.651444",
"0.65050256",
"0.65018266",
"0.64921224",
"0.6489903",
"0.6489903",
"0.6488622",
"0.6481897",
"0.6481897",
"0.64734435",
"0.64734435",
"0.64734435",
"0.64734435",
"0.64734435",
"0.64734435",
"0.64734435",
"0.64734435",
"0.64734435",
"0.64734435",
"0.6462961",
"0.6454067",
"0.64510375",
"0.64510375",
"0.6439302",
"0.64387083",
"0.64273995",
"0.64258546",
"0.6416687",
"0.640126",
"0.6397671",
"0.639629",
"0.63874996",
"0.63618225",
"0.6352678",
"0.6325622",
"0.63123983",
"0.6308406",
"0.6302181",
"0.62917215",
"0.62881917",
"0.6273842",
"0.62659395",
"0.62608033",
"0.6251881",
"0.6249395",
"0.6240429",
"0.6220405",
"0.6212224",
"0.6212224",
"0.6211814",
"0.6208137",
"0.62077135",
"0.61992955",
"0.61909324",
"0.6187752",
"0.6186356",
"0.6186139",
"0.6185689",
"0.6171378",
"0.61704856",
"0.61681557",
"0.61622804",
"0.61419547",
"0.6127794",
"0.6127079",
"0.6123175",
"0.6107058"
] |
0.61093056
|
99
|
Creates a new instance of ProviderObject.
|
def initialize(namespace, name)
super(namespace, name)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new(*args)\n obj = super\n @provider_instances << obj\n obj\n end",
"def new\n @provider = Provider.new\n end",
"def new\n self.default_provider.new\n end",
"def create_provider_object(config, logger, metrics, redis_connection_pool, provider_class, provider_name, options)\n provider_klass = Vmpooler::PoolManager::Provider\n provider_klass.constants.each do |classname|\n next unless classname.to_s.casecmp(provider_class) == 0\n\n return provider_klass.const_get(classname).new(config, logger, metrics, redis_connection_pool, provider_name, options)\n end\n raise(\"Provider '#{provider_class}' is unknown for pool with provider name '#{provider_name}'\") if provider_klass.nil?\n end",
"def initialize(provider)\n @provider = provider\n end",
"def factory(id = nil)\n if id\n OneProvision::Provider.new_with_id(id, @client)\n else\n OneProvision::Provider.new(OneProvision::Provider.build_xml,\n @client)\n end\n end",
"def create_new_admin\n @provider = Provider.new\n end",
"def create_simple_provider_source\n create_source(PROVIDER_TEMPLATE, provider_path)\n end",
"def initialize(name, provider)\n @name = name\n @provider = provider\n end",
"def _provider( name, options )\n\n\t\t\t@_provider ||= { }\n\t\t\t@_provider[ name ] ||= (\n\n\t\t\t\tObject::const_get( name ).new( options )\n\t\t\t)\n\t\tend",
"def initialize\n provider_builders = read_provider_builders\n @providers = Hash[provider_builders.map do |name, package_hash|\n packages = Hash[package_hash.map do |size, price|\n [size, Package.new(size, price)]\n end]\n [name, Provider.new(name, packages)]\n end]\n end",
"def create\n might_update_resource do\n provider.create\n end\n end",
"def create\n might_update_resource do\n provider.create\n end\n end",
"def create\n might_update_resource do\n provider.create\n end\n end",
"def create\n might_update_resource do\n provider.create\n end\n end",
"def initialize_provider(provider=nil)\n prv = cleanup_provider(Souffle::Config[:provider])\n Souffle::Provider.const_get(prv).new\n rescue Souffle::Exceptions::InvalidAwsKeys => e\n Souffle::Log.error \"#{e.message}:\\n#{e.backtrace.join(\"\\n\")}\"\n rescue Exception\n raise Souffle::Exceptions::InvalidProvider,\n \"The provider Souffle::Provider::#{prv} does not exist.\"\n end",
"def new_object\n @object = scope.new params[object_name.to_sym]\n set_instance\n end",
"def create\n @provider = Provider.new(provider_params)\n\n if @provider.save\n render json: @provider, status: :created, location: @provider\n else\n render json: @provider.errors, status: :unprocessable_entity\n end\n end",
"def create\n @provider = Provider.new(provider_params)\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to @provider, notice: 'Provider was successfully created.' }\n format.json { render :show, status: :created, location: @provider }\n else\n format.html { render :new }\n format.json { render json: @provider.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n BikeObject.new(self, 'Object', @type, @name)\n end",
"def initialize\n @provider = initialize_provider\n @provisioner = nil\n end",
"def initialize(type_name, name)\n @type_name = type_name\n super(PuppetStrings::Yard::CodeObjects::Providers.instance(type_name), name)\n end",
"def provider_class\n @provider_class ||= \"::Providers::#{self.provider.camelize}\".constantize.new(self)\n end",
"def create\n @provider = Provider.new(provider_params)\n @provider.user_id = current_user.id\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to @provider, notice: 'Provider was successfully created.' }\n format.json { render :show, status: :created, location: @provider }\n else\n format.html { render :new }\n format.json { render json: @provider.errors, status: :unprocessable_entity }\n end\n end\n end",
"def providify\n newparam(:provider)\n nil\n end",
"def create_provider_class(name, mod=Object, &init)\n parts = name.split('::', 2)\n cls = nil\n if parts.size == 1\n if mod.const_defined?(name)\n # Was already previously defined, undef all the known *instance* methods\n # (class methods are inherited and should not be undefined)\n cls = mod.const_get(name)\n (cls.instance_methods - RightScale::PowershellProviderBase.instance_methods).each { |m| cls.class_eval(\"undef #{m}\") }\n init.call(cls)\n else\n # New class\n cls = Class.new(RightScale::PowershellProviderBase) { |c| init.call(c) }\n mod.const_set(name, cls)\n end\n else\n m = parts[0]\n mod = if mod.const_defined?(m)\n # Recurse into existing module\n mod.const_get(m)\n else\n # Create new module and recurse\n mod.const_set(m, Module.new)\n end\n cls = create_provider_class(parts[1], mod, &init)\n end\n cls\n end",
"def create\n @provider = Provider.new(provider_params)\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to @provider, notice: 'Provider was successfully created.' }\n format.json { render action: 'show', status: :created, location: @provider }\n else\n format.html { render action: 'new' }\n format.json { render json: @provider.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @provider = Provider.new(params[:provider])\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to @provider, notice: 'Provider was successfully created.' }\n format.json { render json: @provider, status: :created, location: @provider }\n else\n format.html { render action: \"new\" }\n format.json { render json: @provider.errors, status: :unprocessable_entity }\n end\n end\n end",
"def initialize\n set_default_as_provider\n yield self if block_given?\n end",
"def create\n @title = t('view.providers.new_title')\n @provider = Provider.new(params[:provider])\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to @provider, notice: t('view.providers.correctly_created') }\n format.json { render json: @provider, status: :created, location: @provider }\n else\n format.html { render action: 'new' }\n format.json { render json: @provider.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n BaseObject.new(self)\n end",
"def create\n @provider = Provider.new(params[:provider])\n\n respond_to do |format|\n if @provider.save\n flash[:notice] = 'Provider was successfully created.'\n format.html { redirect_to providers_path }\n format.xml { render :xml => @provider, :status => :created, :location => @provider }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @provider.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def find_or_create_provider!(attrs)\n provider = Provider.find_by(name: attrs[:name])\n if provider.blank?\n provider = Provider.create!(\n name: attrs[:name],\n firm_agfs_supplier_number: attrs[:firm_agfs_supplier_number],\n api_key: attrs[:api_key],\n provider_type: attrs[:provider_type],\n vat_registered: attrs[:vat_registered],\n roles: attrs[:roles],\n lgfs_supplier_numbers: attrs[:lgfs_supplier_numbers] || []\n )\n end\n provider\n end",
"def provider\n use_provider('null') unless defined? @provider\n @provider\n end",
"def create\n @info_provider = Info::Provider.new(info_provider_params)\n\n respond_to do |format|\n if @info_provider.save\n format.html { redirect_to @info_provider, notice: 'Provider was successfully created.' }\n format.json { render :show, status: :created, location: @info_provider }\n else\n format.html { render :new }\n format.json { render json: @info_provider.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create name, object_type, config={}\n klass = @@sources[[name, object_type]]\n raise \"No Source registered with name #{name} and type #{object_type}.\" unless klass\n klass.new(config)\n end",
"def initialize(provider)\n raise \"Provider must provide a convert method\" unless provider.respond_to?('convert')\n @provider = provider\n end",
"def initialize(provider_attributes, options = {})\n @provider_attributes = provider_attributes.with_indifferent_access\n @provider_name = provider_attributes['provider']\n @options = {\n :user_attributes => {},\n :identity_attributes => {},\n :skip_raw_info => false,\n :skip_nils => true\n }.merge(options)\n\n @provider_identity = ModelMapper.new(self,\n :model => @options[:identity_model],\n :relation => @options[:identity_relation],\n :attributes => @options[:identity_attributes],\n :attribute_names => @options[:identity_attribute_names],\n :unique_identifiers => @options[:identity_identifiers] || [:provider, :uid],\n :required_criteria => @options[:identity_required_criteria]\n )\n @provider_user = ModelMapper.new(self,\n :model => @options[:user_model],\n :relation => @options[:user_relation],\n :attributes => @options[:user_attributes],\n :attribute_names => @options[:user_attribute_names],\n :unique_identifiers => @options[:user_identifiers] || [:email],\n :required_criteria => @options[:user_required_criteria]\n )\n end",
"def instantiate\n resource.new(data)\n end",
"def new\n raise('Sorry, modules cannot be instantiated!') if @is_module\n \n RObject.new self\n end",
"def new; end",
"def new; end",
"def new; end",
"def new; end",
"def new; end",
"def new; end",
"def new; end",
"def new; end",
"def new; end",
"def new\r\n @provider = Provider.new\r\n render_new\r\n end",
"def create\n @provider = current_company.providers.new(params[:provider])\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to @provider, notice: 'Provider was successfully created.' }\n format.json { render json: @provider, status: :created, location: @provider }\n else\n format.html { render action: \"new\" }\n format.json { render json: @provider.errors, status: :unprocessable_entity }\n end\n end\n end",
"def initialize( * )\n\t\tsuper\n\t\t@auth_provider = self.class.auth_provider.new( self )\n\tend",
"def provider; end",
"def new\n \n end",
"def new\n \n end",
"def new\n \n end",
"def new\n \n end",
"def new\n \n end",
"def provider_cli\n @provider_cli ||= begin\n return nil unless name = settings.exists?(\"provider.name\")\n require \"cyoi/cli/providers/provider_cli_#{settings.provider.name}\"\n klass = self.class.provider_cli(settings.provider.name)\n klass.new(settings.provider, hl)\n end\n end",
"def new\n CanadianObject.new(self)\n end",
"def create_provider(actor)\n # Differentiate care providers by content of this field\n provider = {}\n if actor.at_xpath('./ccr:Person/ccr:Name/ccr:CurrentName/ccr:Given')\n provider[:given_name] = extract_data(actor, './ccr:Person/ccr:Name/ccr:CurrentName/ccr:Given')\n provider[:family_name] = extract_data(actor, './ccr:Person/ccr:Name/ccr:CurrentName/ccr:Family')\n provider[:specialty] = extract_data(actor, './ccr:Specialty/ccr:Text')\n end\n \n provider[:specialty] = extract_data(actor, './ccr:Specialty/ccr:Text')\n\n \n npi_ids = actor.at_xpath(\"./ccr:IDs[ccr:Type/ccr:Text = \\\"NPI\\\"]\")\n if npi_ids\n npi_id = npi_ids.at_xpath(\"./ccr:ID\")\n npi = npi_id.content\n provider[:npi] = npi if Provider.valid_npi?(npi)\n end\n \n find_or_create_provider(provider)\n end",
"def my_provider\n self.class.my_provider\n end",
"def instance(config)\n PROVIDER_INSTANCES[config.provider] || MUTEX.synchronize do\n PROVIDER_INSTANCES[config.provider] ||= lookup(config.provider).new(config[:\"#{config.provider}_settings\"])\n end\n end",
"def create\n @supplier_provider = Supplier::Provider.new(supplier_provider_params)\n\n respond_to do |format|\n if @supplier_provider.save\n format.html { redirect_to @supplier_provider, notice: 'Provider was successfully created.' }\n format.json { render :show, status: :created, location: @supplier_provider }\n else\n format.html { render :new }\n format.json { render json: @supplier_provider.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_initialize_finds_records\n prov = mkprovider\n prov.default_target = :yayness\n\n prov.target_object(:yayness).write \"bill a c\\njill b d\"\n\n prov.prefetch\n\n # Now make a resource\n bill = @type.new :name => \"bill\"\n\n assert_equal(\"a\", bill.provider.one, \"Record was not found in memory\")\n end",
"def test_name_or_provider\n provider = @type.provide(:testing) do\n end\n\n # first make sure we can pass the name in\n resource = nil\n assert_nothing_raised(\"Could not create provider instance by name\") do\n resource = @type.new :name => \"yay\", :provider => :testing\n end\n\n assert_instance_of(provider, resource.provider, \"Did not create provider instance\")\n\n # Now make sure we can pass in an instance\n provinst = provider.new(:name => \"foo\")\n assert_nothing_raised(\"Could not pass in provider instance\") do\n resource = @type.new :name => \"foo\", :provider => provinst\n end\n\n assert_equal(provinst, resource.provider, \"Did not retain provider instance\")\n assert_equal(provider.name, resource[:provider], \"Provider value was set to the provider instead of its name\")\n\n # Now make sure unsuitable provider instances still throw errors\n provider = @type.provide(:badprov) do\n confine :exists => \"/no/such/file\"\n end\n\n # And make sure the provider must be a valid provider type for this resource\n pkgprov = Puppet::Type.type(:package).new(:name => \"yayness\").provider\n assert(provider, \"did not get package provider\")\n\n assert_raise(Puppet::Error, \"Did not fail on invalid provider instance\") do\n resource = @type.new :name => \"bar\", :provider => pkgprov\n end\n\n end",
"def providers\n @providers ||= {}\n end",
"def provider\n get(PROVIDER)\n end",
"def newInstance( params={} )\n model.new( params ).extend( InstanceMethods )\n end",
"def new\n @title = t('view.providers.new_title')\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provider }\n end\n end",
"def provider_object(connect)\n connect.vpc(:region => ext_management_system.provider_region).instances.instance(ems_ref)\n end",
"def provider_object(connect)\n connect.vpc(:region => ext_management_system.provider_region).instances.instance(ems_ref)\n end",
"def set_provider\n @provider = Provider.find(params[:id])\n end",
"def set_provider\n @provider = Provider.find(params[:id])\n end",
"def set_provider\n @provider = Provider.find(params[:id])\n end",
"def set_provider\n @provider = Provider.find(params[:id])\n end",
"def set_provider\n @provider = Provider.find(params[:id])\n end",
"def set_provider\n @provider = Provider.find(params[:id])\n end",
"def set_provider\n @provider = Provider.find(params[:id])\n end",
"def create_object\n sut.send(:new)\n end",
"def provider_class\n self.class\n end",
"def provider_class\n self.class\n end",
"def create\n @provider = Provider.new(params[:provider])\n @provider.active = true\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to @provider, notice: 'Provider was successfully created.' }\n format.json { render json: @provider, status: :created, location: @provider }\n else\n format.html { render action: \"new\" }\n format.json { render json: @provider.errors, status: :unprocessable_entity }\n end\n end\n end",
"def register_provider(name, klass)\n @providers[name] = klass\n end",
"def new(klass, *args)\n unless klass.is_a?(BasicObject)\n PEROBS.log.fatal \"#{klass} is not a BasicObject derivative\"\n end\n\n @lock.synchronize do\n obj = _construct_po(klass, _new_id, *args)\n # Mark the new object as modified so it gets pushed into the database.\n @cache.cache_write(obj)\n # Return a POXReference proxy for the newly created object.\n obj.myself\n end\n end",
"def new(attributes = {}, &block)\n assert_valid\n\n model = if discriminator = properties(repository_name).discriminator\n attributes[discriminator.name]\n end\n\n model ||= self\n\n resource = model.allocate\n resource.send(:initialize, attributes, &block)\n resource\n end",
"def provider\n begin\n @provider ||= eval(\"MusicProviders::#{source}\").new\n rescue\n @provider = MusicProviders::DefaultProvider.new\n end\n end",
"def integration\n if consumer_specified? && provider_specified?\n OpenStruct.new(consumer: consumer, provider: provider)\n else\n nil\n end\n end",
"def set_provider\r\n @provider = Provider.find(params[:id])\r\n end",
"def initialize(params, current_user = nil)\n @params = params.to_h.with_indifferent_access\n @provider = @params[:provider]\n @user = current_user\n @authorization = nil\n end",
"def load_provider_model\n @provider_info_model ||= provider_infos.first\n end",
"def new\n @oc_member = OcMember.new\n end",
"def new #:nodoc:\n end",
"def initialize(api_key, merchant_plugin_provider, merchant_plugin_endpoint, merchant_metadata = {}, expressly_endpoint = 'https://prod.expresslyapp.com/api')\n @api_key = api_key.include?(\":\") ? api_key : Base64.strict_decode64(api_key)\n @merchant_plugin_provider = merchant_plugin_provider\n @merchant_plugin_endpoint = merchant_plugin_endpoint\n @expressly_endpoint = expressly_endpoint\n @expressly_provider = Api.new(@api_key, expressly_endpoint)\n @merchant_metadata = merchant_metadata\n end",
"def create(template)\n rc = validate(template)\n\n return rc if OpenNebula.is_error?(rc)\n\n xml = OneProvision::Provider.build_xml\n provider = OneProvision::Provider.new(xml, @client)\n\n rc = provider.allocate(rc)\n\n return rc if OpenNebula.is_error?(rc)\n\n rc = provider.info(true)\n\n return rc if OpenNebula.is_error?(rc)\n\n provider['ID']\n end",
"def new(*args, &block)\n obj = allocate()\n obj.initialize(*args, &block)\n obj\n end",
"def create(name)\n object = new(name)\n @instances.push(object)\n object\n end",
"def create\n @provider_provider_type = Provider::ProviderType.new(provider_provider_type_params)\n @provider_provider_type.user_created_id = current_user.id\n respond_to do |format|\n if @provider_provider_type.save\n format.html { redirect_to provider_provider_types_path, notice: I18n.t('provider_types.controller.create') }\n format.json { render :show, status: :created, location: @provider_provider_type }\n else\n format.html { render :new }\n format.json { render json: @provider_provider_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @purchase = Purchase.new\n @user = User.find(54) # placeholder to be replaced with qr code\n @perk = @user.perks # needs to be replaced with the instance of the perk, not all perks available!\n end",
"def initialize\n @provider = AmqpSource\n end",
"def set_provider_project\n @provider_project = ProviderProject.find(params[:id])\n @h_providers = {}\n Provider.all.map{|p| @h_providers[p.id] = p}\n end"
] |
[
"0.78455746",
"0.78283596",
"0.69544303",
"0.69298184",
"0.69125503",
"0.6667507",
"0.6649598",
"0.656836",
"0.65661025",
"0.63434196",
"0.6251624",
"0.6163938",
"0.6163938",
"0.6163938",
"0.6163938",
"0.6160409",
"0.61305153",
"0.6118858",
"0.60745317",
"0.6073427",
"0.606216",
"0.6058596",
"0.6053751",
"0.6049936",
"0.6048726",
"0.602045",
"0.59965885",
"0.5991577",
"0.5983966",
"0.59584546",
"0.5939149",
"0.59183484",
"0.5913872",
"0.58800715",
"0.5850343",
"0.58271563",
"0.58095765",
"0.5798045",
"0.5777424",
"0.57623446",
"0.5762305",
"0.5762305",
"0.5762305",
"0.5762305",
"0.5762305",
"0.5762305",
"0.5762305",
"0.5762305",
"0.5762305",
"0.57500285",
"0.5694064",
"0.56895465",
"0.5686559",
"0.56836677",
"0.56836677",
"0.56836677",
"0.56836677",
"0.56836677",
"0.56590164",
"0.56487375",
"0.56368995",
"0.56289136",
"0.56127024",
"0.56099313",
"0.5601416",
"0.56009966",
"0.5581027",
"0.5566895",
"0.55528826",
"0.5541401",
"0.554073",
"0.554073",
"0.553013",
"0.553013",
"0.553013",
"0.553013",
"0.553013",
"0.553013",
"0.553013",
"0.5518928",
"0.5514076",
"0.5514076",
"0.5504165",
"0.5502805",
"0.5492941",
"0.54909855",
"0.54906374",
"0.5481906",
"0.5479729",
"0.5478448",
"0.54779655",
"0.5471872",
"0.5471288",
"0.5471234",
"0.54688627",
"0.5465079",
"0.5464561",
"0.5464385",
"0.54551566",
"0.54545844",
"0.5441919"
] |
0.0
|
-1
|
Constructs class name for the lightweight provider.
|
def long_name
name = ''
if @name.to_s =~ /_/
@name.to_s.split('_').each do |str|
name << str.to_s.capitalize
end
else
name = @name.to_s.capitalize
end
namespace = @namespace.to_s.split('::').map { |str| str.capitalize }
"#{namespace.join('::')}::#{name}"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def class_name\n @class_name ||= derive_class_name\n end",
"def generate\n base_name = camel_case identifier.to_s\n decorate_klass_name base_name\n end",
"def name(_prefix = false)\n 'Providers'\n end",
"def human_name(klass = T.unsafe(nil)); end",
"def human_name(klass = T.unsafe(nil)); end",
"def full_name\n klass.name\n end",
"def instancename classname\n\t\t\t'i'+classname\n\t\tend",
"def class_name\n @class_name ||= (options[:class_name] || derive_class_name).to_s\n end",
"def class_name\n @class_name ||= (options[:class_name] || derive_class_name).to_s\n end",
"def provider_class\n @provider_class ||= \"::Providers::#{self.provider.camelize}\".constantize.new(self)\n end",
"def resource_class_name(provider_class_name)\n # Chef lwr/p resource and provider base names are the same\n \"Chef::Resource::#{provider_class_name}\"\n end",
"def class_name()\n return self.id.downcase.gsub(/\\Ah?l_/i, \"\")\n end",
"def class_name; end",
"def class_name; end",
"def name\n @provider[:name]\n end",
"def class_name\n self.to_s.demodulize.underscore\n end",
"def class_name\n klass = single_class\n while klass.name == ''\n klass = klass.superclass\n end\n if list_context?\n \"[#{klass}]\"\n else\n klass.name\n end\n end",
"def construct_klass(name)\n name.to_s.split('_').map{|i|i.capitalize}.join\n end",
"def name_and_class\n [name, self['class']].compact.join('.')\n end",
"def class_name\n @class_name ||= (@options[:class_name] || @name).to_s.camelize\n end",
"def creator_class_name\n \"#{@clazz.name}Creator\"\n end",
"def class_name\n Jaspion::Kilza::Class.normalize(@original_name)\n end",
"def name\n @class_name\n end",
"def base_filename; class_to_filename(name.gsub(/.*:/, '')); end",
"def provider_class\n @__klass ||= Yeller::Provider.class_of(provider)\n end",
"def to_s\n \"#{DbAgile::RubyTools::unqualified_class_name(self.class)}: #{name}\"\n end",
"def locale_klass_name\n @locale_klass_name ||= self.class.name.gsub(/::/, '/').\n gsub(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2').\n gsub(/([a-z\\d])([A-Z])/,'\\1_\\2').\n tr('-', '_').\n downcase\n end",
"def class_name\n fetch('heroes_of_the_storm.class_names')\n end",
"def cr_class_name(attr_name)\n instance_var = attr_name.gsub('/','_').downcase()\n instance_var.gsub!(' ','_')\n instance_var = instance_var.gsub('-','_')\n class_name = \"Cr\" + camelise(instance_var)\n return class_name\nend",
"def display_name\n class_name\n end",
"def class_name\n Heroics.camel_case(name)\n end",
"def provider_name\n object.provider_id.titleize\n end",
"def name\n @provider_name\n end",
"def class_name\r\n r = \"\"\r\n up = true\r\n each_byte do |c|\r\n if c == 95\r\n if up\r\n r << \"::\"\r\n else\r\n up = true\r\n end\r\n else\r\n m = up ? :upcase : :to_s\r\n r << (c.chr.send(m))\r\n up = false\r\n end\r\n end\r\n r\r\n end",
"def make_key class_name\n name = class_name.to_s.pluralize.gsub(/::/, '__').underscore\n only_last_part_plural(name).to_sym\n end",
"def underscorized_classname\n self.class.name.split(\"::\").last.\n gsub( /([A-Z]+)([A-Z][a-z])/, '\\1_\\2' ).\n gsub( /([a-z\\d])([A-Z])/, '\\1_\\2' ).downcase\n end",
"def full_implementation_class_name\n full_item_type_name.ns_camelize\n end",
"def name\n @name ||= self.to_s.demodulize.underscore\n end",
"def classname\n @classname ||= self.class.name.split(\"::\")[1..-1].join(\"::\")\n end",
"def full_name\n decorated_class_name = case self.klass_flags\n when 0x2\n \"<Class::#{klass_name}>\"\n when 0x4\n \"<Module::#{klass_name}>\"\n when 0x8\n \"<Object::#{klass_name}>\"\n else\n klass_name\n end\n\n \"#{decorated_class_name}##{method_name}\"\n end",
"def class_name\n (self.type.to_s || self.class.name).demodulize\n end",
"def class_name(subj)\n nm = subj.respond_to?(:class_eval) ? subj.demodulize : subj.class.demodulize\n @class_name = \"#{nm}#{UUIDTools::UUID.random_create.to_s.gsub /-/, ''}\"\n @class_name\n end",
"def name\n self.class.simple_name\n end",
"def class_name\n name = @klass.name\n name.name\n end",
"def generate\n camel_cased_name = undecorate_klass_name(klass.name)\n snake_case(camel_cased_name).to_sym\n end",
"def pretty_class_name\n return self.class.to_s.split(/(?=[A-Z])/).join(' ')\n end",
"def full_name\n @full_name ||= \"#{@klass}##{@method_name}\"\n end",
"def class_name_for(module_name, name)\n \"#{module_name}::#{class_name(name)}\"\n end",
"def class_name\n self.fullname[/\\A(.*)([\\.\\#])([^\\.\\#]+)\\z/, 1]\n end",
"def provider_name\n return @provider_name\n end",
"def class_name\n @class_name ||= active_record.name\n end",
"def full_name\n \"#{@package}.#{parameterized_name}\"\n end",
"def class_name\n self.class.to_s.split('::').last\n end",
"def safe_class_name()\n self.class.name.downcase.gsub(/[^\\d\\w]/, '_')\n end",
"def my_short_name\n @my_short_name ||= self.class.name.split(\"_\").last\n end",
"def to_class_name\n parts = downcase.split('/')\n parts.each(&:capitalize!)\n parts.join('').gsub(%r{-}, '')\n end",
"def pearified_classname\n self\n end",
"def class_name(name)\n name, anchor = name.to_s.split(\"#\", 2)\n name = File.basename(name, \".json\")\n name = name + \"_\" + anchor if anchor.present?\n name.gsub(/[^\\w]/, \"_\").camelcase\n end",
"def class_name object\n return object.class.to_s.split(/(?=[A-Z])/).join(' ')\n end",
"def real_name; end",
"def name\n self.class.name || self.class.to_s\n end",
"def name\n Properties[self.class] ||= {}\n return Properties[self.class][:name] || \"\"\n end",
"def mk_name\n \"quarley poller #{rand(1_000_000)} #{Time.now.to_i}\"\n end",
"def class_name_id object\n return object.class.to_s.split(/(?=[A-Z])/).join('-').downcase\n end",
"def name\n internal_name\n end",
"def resource_name\n resource_class.slice(0,1).downcase + resource_class.slice(1,resource_class.length)\n end",
"def polymorphic_name\n store_full_class_name ? base_class.name : base_class.name.demodulize\n end",
"def class_name_for(object)\n object.name.split('.').first.downcase.tr('_', '-')\n end",
"def klass_name\n \"#{params[:klass_name].classify}\"\n end",
"def class_name\n self.class.name.split(\"::\").last.downcase\n end",
"def name\n klass.name.split('::').last\n end",
"def to_class_name\n to_s.gsub('&', 'and').gsub(/[\\- ]/, '_').camelize(:upper)\n end",
"def provider_name(provider)\n Account.provider_name(provider)\n end",
"def name\n has_module?(klass) ? klass[(klass.index(\"::\")+2)..-1] : klass\n end",
"def display_name_for_class(klass)\n klass.gsub(/^(?:[A-Z]{2})?[A-Z]{3}/) { |match| match.last }.underscore.humanize\n end",
"def full_class_name\n @class_names.join(\"::\")\n end",
"def _class\n special_attribute('@class'.freeze) || self.class.name.demodulize\n end",
"def sg_base_class_name # :nodoc:\n @sg_base_class_name ||= self.base_class.name\n end",
"def to_s\n fullname = \"#{self.class.shortname}\"\n if !@cloudobj.nil? and !@cloudobj.mu_name.nil?\n @mu_name ||= @cloudobj.mu_name\n end\n if !@mu_name.nil? and !@mu_name.empty?\n fullname = fullname + \" '#{@mu_name}'\"\n end\n if !@cloud_id.nil?\n fullname = fullname + \" (#{@cloud_id})\"\n end\n return fullname\n end",
"def to_s\n fullname = \"#{self.class.shortname}\"\n if !@cloudobj.nil? and !@cloudobj.mu_name.nil?\n @mu_name ||= @cloudobj.mu_name\n end\n if !@mu_name.nil? and !@mu_name.empty?\n fullname = fullname + \" '#{@mu_name}'\"\n end\n if !@cloud_id.nil?\n fullname = fullname + \" (#{@cloud_id})\"\n end\n return fullname\n end",
"def scm_provider_klass\n @scm_provider_klass ||= eval(danger.scm_provider.to_s)\n end",
"def definition\n \"class #{full_name}\"\n end",
"def name\n self.class.name.demodulize.underscore\n end",
"def class_name\n %x{\n var first = self[0];\n return (first && first.className) || \"\";\n }\n end",
"def name\n @name ||= self.class.non_namespaced_name\n end",
"def gen_name\n name.to_s.downcase\n end",
"def class_name\n self.class.class_name\n end",
"def name\n underscore(self.class.name)\n end",
"def base_class_name\n split('::').last\n end",
"def full_name\n \"#{namespace.name || namespace.inspect}::#{namespace.instances[ self ]}\"\n end",
"def formatted_class_name(class_name)\n class_name = class_name.split(':')[-1]\n (class_name.gsub!(/(.)([A-Z])/, '\\1_\\2') || class_name).upcase\n end",
"def sti_name\n store_full_sti_class && store_full_class_name ? name : name.demodulize\n end",
"def name\n @ruby_class.name\n end",
"def qualified_to_name; end",
"def class\n `$q(this.__native__.className)`\n end",
"def provider_name(provider)\n I18n.t(provider, scope: 'account.provider_name')\n end",
"def service_key\n (is_a?(Module) ? name : self.class.name).demodulize.underscore.to_sym\n end",
"def service_key\n (is_a?(Module) ? name : self.class.name).demodulize.underscore.to_sym\n end",
"def get_module_name( className )\n\t\tif className =~ /\\w+#{self.factory_type}/\n\t\t\tmod_name = className.sub( /(?:.*::)?(\\w+)(?:#{self.factory_type})/, \"\\\\1\" )\n\t\telse\n\t\t\tmod_name = className\n\t\tend\n\n\t\treturn mod_name\n\tend",
"def get_name\n return \"#{name}\"\n end"
] |
[
"0.70328695",
"0.6860561",
"0.6818218",
"0.6748444",
"0.6748444",
"0.67236894",
"0.6694454",
"0.6684767",
"0.6684767",
"0.66553134",
"0.66353357",
"0.66215926",
"0.6589678",
"0.6589678",
"0.6564907",
"0.6564422",
"0.65578777",
"0.6556292",
"0.6549831",
"0.6542467",
"0.6503894",
"0.6496478",
"0.6439708",
"0.6438863",
"0.6423498",
"0.64171517",
"0.63979733",
"0.6392592",
"0.63890815",
"0.63866293",
"0.63864625",
"0.6342989",
"0.6342665",
"0.63357526",
"0.6332954",
"0.6329649",
"0.63210946",
"0.62981653",
"0.6287785",
"0.62841004",
"0.6281361",
"0.6274543",
"0.6267535",
"0.6244416",
"0.6225808",
"0.62094206",
"0.6201164",
"0.61919224",
"0.6183623",
"0.61743593",
"0.6169925",
"0.6131594",
"0.61146826",
"0.61121166",
"0.60928786",
"0.60907537",
"0.60878676",
"0.6084855",
"0.6084819",
"0.60815835",
"0.6073789",
"0.6069759",
"0.606869",
"0.6056278",
"0.60488766",
"0.60475886",
"0.60469675",
"0.60402143",
"0.6036532",
"0.6026635",
"0.6026229",
"0.60235035",
"0.6011221",
"0.6010758",
"0.60096043",
"0.60017943",
"0.59997135",
"0.59993756",
"0.59983057",
"0.59983057",
"0.59982955",
"0.59945786",
"0.59906244",
"0.59889483",
"0.59751326",
"0.59670514",
"0.596085",
"0.5957032",
"0.5956385",
"0.59488845",
"0.5945517",
"0.5944123",
"0.59426737",
"0.5940834",
"0.59399307",
"0.59343714",
"0.5922285",
"0.5922285",
"0.5920294",
"0.5916957"
] |
0.6152973
|
51
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.