text
stringlengths
10
2.61M
class Game attr_accessor :words_array, :word, :guess, :tries def initialize(words_array) @words_array = words_array @tries = 5 end def choose_word @word = Word.new(words_array.sample) end ## Start Guess Method def guess(letters_array) art = Art.new bad_guesses = [] while @tries ...
class CreateSplits < ActiveRecord::Migration def self.up create_table :splits do |t| t.decimal :distance t.integer :distance_units t.decimal :duration t.text :notes t.integer :position t.references :aerobic_workout, :null => false t.timestamps end end def self.d...
class Story < ActiveRecord::Base attr_accessible :author_id, :description, :performer_id, :state, :title, :author, :performer belongs_to :author, class_name: :User belongs_to :performer, class_name: :User has_many :comments validates :author, presence:true validates :performer, presence:true validates ...
require 'active_support/inflector' require 'betfair_api_ng_rails/api/concerns/errorable' module BetfairApiNgRails module Api class Provider include Api::Concerns::Errorable include Api::Constants attr_reader :ssoid def initialize(ssoid) @ssoid = ssoid end def fetch(...
class AddPlayer1IdToGames < ActiveRecord::Migration[5.2] def change add_column :games, :player1_id, :integer end end
require 'socket' class Response HTTP_VERSION = 1.1 attr_accessor :status, :body, :header def initialize(opts = {}) @status ||= opts[:status] || 200 @body ||= opts[:body] || '' @header = default_header opts[:header].each { |k, v| @header[k] = v } if opts[:header] === Hash yield self if ...
class CheckInSymptom < ApplicationRecord belongs_to :check_in belongs_to :symptom end
class DnsRecordsController < ApplicationController include Pagy::Backend skip_before_action :verify_authenticity_token # TODO This action got really big, if I had more time, I would create a # service to deal with most of the logic implemented here. # TODO Another thing that I would do is to validate both ...
class AddQuoteToSuits < ActiveRecord::Migration def change add_column :suits, :quote, :text end end
class Card attr_accessor :num, :suit def initialize(num, suit) @num = num @suit = suit end def value num.is_a?(Integer) ? num : (ace? ? 11 : 10) end def ace? num == 'A' end def to_s "#{num}#{suit}" end end
require_relative '../test_helper' class UserCanEditExistingTaskTest < Minitest::Test include Capybara::DSL include TestHelpers def test_user_can_edit_a_skill create_skills(1) visit '/skills/1/edit' assert_equal '/skills/1/edit', current_path fill_in "skill[name]", :with => "Freaking Skill" ...
# == Informacion de la tabla # # Nombre de la tabla: *dbm_prefectos* # # idPrefecto :integer(11) not null, primary key # idDepartamento :integer(11) not null # nombre :string(100) default(""), not null # telefono :string(50) # celular :string(50) # fax :...
class PageContentAssignment < ActiveRecord::Migration def self.up add_column :pages, :content_id, :integer add_column :pages, :content_type, :string end def self.down remove_column :pages, :content_id remove_column :pages, :content_type end end
require 'rails_helper' feature 'user adds idea from root', js: true do scenario 'sees it without the page reloading' do visit root_path fill_in 'idea_title', with: 'The new idea' fill_in 'idea_body', with: 'the body of the new idea' click_button 'Save' within('#ideas') do expect(page).to...
# version of this gem class PuppetPotGenerator VERSION ||= '0.1.0'.freeze end
require File.expand_path('../test_helper', __FILE__) require 'config_parser' class ConfigParserTest < Test::Unit::TestCase Option = ConfigParser::Option attr_reader :c def setup @c = ConfigParser.new end # # initialize test # def test_initialize c = ConfigParser.new assert_equal({}, c.o...
require_relative 'tile.rb' class Board attr_reader :grid, :width, :height, :bombs def initialize(width = 9, height = 9, bombs = 10) @width = width @height = height @bombs = bombs populate_grid place_bombs end def [](pos) row, col = pos @grid[row][col] end def []=(pos, value) ...
class CreateSwitches < ActiveRecord::Migration def self.up create_table :switches do |t| t.integer :device_id t.integer :port t.integer :layer t.integer :speed t.integer :back_speed t.text :memo t.timestamps end end def self.down drop_table :switches end e...
module Rails module Sequel module Railties class LogSubscriber < ActiveSupport::LogSubscriber def sql(event) name = '%s (%.1fms)' % [event.payload[:name], event.payload[:duration]] sql = event.payload[:sql].squeeze(' ') if odd? name = color(name, :cyan, tr...
require 'minitest/autorun' require 'option_date' class OptionDateTest < Minitest::Test def test_full_date assert_equal "April 20, 2018", OptionDate.new("2018-04-20").formatted[:formatted] end def test_no_day assert_equal "April, 2018", OptionDate.new("2018-04").formatted[:formatted] end def test_no...
class OrdersController < ApplicationController layout 'auth' def new @order = Order.new end def create @order = Order.new(params_order) if @order.save flash[:notice] = "Bạn đã order thành công" end end private def order_params params.required(:order).permit(:product_id, :transaction_id, :qty, :amo...
Taskdeck::Application.routes.draw do resources :users resources :sessions, only: [:create, :new, :destroy] resources :organizations resources :teams resources :tasks resources :task_notes resources :reminders resources :projects resources :project_tasks root to: 'static_pages#home' match '/si...
# Creating a File test_file = File.new("test.txt","w+") test_file.puts ("this is text file created by Ruby code") test_file.close # You can also write text to the existing file using a code block. # You don’t need to worry about closing the file here since Ruby will automatically close the file for you. File.open(...
class ClientMailer < ApplicationMailer default from:'registration@rentalcars.com.br' def welcome_email(client_id) @client = IndividualClient.find(client_id) mail(to: @client.email, subject: "Caro #{@client.name} seu registro foi concluído com sucesso") end end
require 'minitest/pride' require 'minitest/autorun' require 'pry' require './lib/deck' class DeckTest < Minitest::Test def test_it_exists card_1 = Card.new("10", "Hearts") card_2 = Card.new("Queen", "Spades") card_3 = Card.new("Jack", "Hearts") deck = Deck.new([card_1, card_2, card_3]) assert_in...
class Mech::PathLoader attr_accessor :paths def initialize(config) @paths = [] @config = config find_paths filter_paths_by_env end protected def find_paths Find.find(@config.src_path) { |f| @paths.push(f) if f.match(/\.yml\Z/) } end def filter_paths_by_env ...
module DiceFactory OFFICIAL_DICE_LETTER_COMBINATIONS = [ 'AAEEGN', 'ELRTTY', 'AOOTTW', 'ABBJOO', 'EHRTVW', 'CIMOTU', 'DISTTY', 'EIOSST', 'DELRVY', 'ACHOPS', 'HIMNQU', 'EEINSU', 'EEGHNW', 'AFFKPS', 'HLNNRZ', 'DEILRX' ] def self.official_boggle_dice ...
class NationWonder < ActiveRecord::Base belongs_to :nation belongs_to :wonder end
class AddDetailsToOngs < ActiveRecord::Migration def change add_column :ongs, :description, :text, :after => :name add_column :ongs, :link, :string, :limit => 2000, :after => :description add_column :ongs, :address, :text, :after => :link end end
class MessagesController < ApplicationController def new @message = Message.new end def create @message = Message.new(message_params) if @message.save redirect_to root_path ContactMailer.message_patrick(@message).deliver flash[:notice] = "Thank you for your message. I will get back to you shortl...
require 'rails_helper' RSpec.describe Orgadmin::DashboardController, type: :controller do let(:org) { FactoryGirl.create(:organization) } before(:each) { login_user } describe 'index > ' do context 'users who are not admins of this org > ' do it 'will be denied access' do expect do g...
require 'helper' require 'rr' class TestCanHasLolcat < Test::Unit::TestCase include RR::Adapters::TestUnit context "Lolcat" do context "#can_has" do LOLCAT_URL = "http://icanhascheezburger.com/?random" LOLDOG_URL = "http://dogs.icanhascheezburger.com/?random" LOLCAT_REGEX = /http:\/\/icanha...
require 'spec_helper' require 'pry-byebug' require_relative '../../models/order.rb' RSpec.describe Order do before(:all) do book = Good.new(1, 'book', 12.49) food = Good.new(1, 'chocolate bar', 0.85) music_cd = Good.new(1, 'music cd', 14.99) @order = Order.new([book, food, music_cd]) @order.invok...
# Create licenses class CreateLicenses < ActiveRecord::Migration def change create_table :licenses do |t| t.string :name t.integer :licensing_type, default: 0 t.integer :status, default: 0 t.references :licensor, index: true, foreign_key: true end end end
class UserSub < ActiveRecord::Base validates :user, :sub, :rank, :presence => true validates_uniqueness_of :sub, :scope => [:user] validates_uniqueness_of :rank, :scope => [:user] belongs_to :user, :inverse_of => :user_subs belongs_to :sub, class_name: "SubReddit", :inverse_of => :user_subs, counter_cach...
class Customer < ActiveRecord::Base attr_accessible :birthdate, :gender, :name has_many :transaction #validation validates_presence_of :birthdate, :gender validates :name, :uniqueness => true, :length => {:minimum => 5} end
# frozen_string_literal: true require 'pry' require 'colorize' module Command # info - get bitmarkd info class Base def info parse_info(rpc.info.to_h) end private def parse_info (hsh) err = hsh['error'] if err.nil? result = hsh['result'] version = result['versio...
module Envconfig class Smtp include Service def self.providers [ Generic, Mailgun, Mandrill, Postmark, Sendgrid, ] end # A custom configuration, for local or self-managed SMTP servers. class Generic include Provider def valid? ...
class RoomsController < ApplicationController skip_before_action :authenticate_user!, only: [:index] before_action :set_room, only: %i[show edit update destroy] def new @room = current_user.rooms.new authorize @room end def create @room = current_user.rooms.new(room_params) authorize @room ...
require 'test_helper' require 'model_test_helper' class AgentArcTest < ActiveSupport::TestCase test "basic agents association" do agent_a = create_agent("Agent A") agent_b = create_agent("Agent B") assert AgentArc.create(source: agent_a, target: agent_b) # A # / # B force_reset_mode...
# ensure節の実行順 begin 1 / 0 rescue p 1 rescue ZeroDivisionError # この例外処理は実行されません。 p 2 end
#!/usr/bin/ruby # encoding: utf-8 class Cigar class << self def alignchunks(cigarstring) type = [] count = [] leftover = String.new(cigarstring) while matches = leftover.match(/^(\d+)([MSID])(.*)/) count.push matches[1].to_i type.push matches[2] leftover = matches[3] end unless leftov...
class Api::BrandNamesController < ApplicationController def index if params[:category_id] category = Category.find(params[:category_id]) brand_groups = category.get_brand_groups return @brand_names = category.get_brand_names(brand_groups) end @brand_names = BrandName.all.pluck(:name) ...
module Ncr class WorkOrderValueNormalizer def initialize(work_order) @work_order = work_order end def run normalize_cl_number normalize_function_code normalize_soc_code end private attr_accessor :work_order def normalize_cl_number if work_order.cl_number.p...
class Billitems < ActiveRecord::Migration[6.0] def change create_table :billitems do |t| t.string :item_name t.bigint :item_cost t.datetime :ordertime t.bigint :user_id t.bigint :quantity end end end
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 require 'set' module TwitterCldr module Utils # An integer set, implemented under the hood with ranges. The idea is # that it's more efficient to store sequential data in ranges rather # than as single element...
require "spec_helper" feature do let(:proposal) { create(:proposal,title: "This is the old title") } it "Users can edit a previously-submitted proposal" do visit edit_proposal_url(proposal) fill_in "proposal[title]", with: "A brand-new title" click_button "Save" expect(Dom::Proposal.find_by_title(...
require "nokogiri" require "bundler" Bundler.require module Corenlp class Treebank attr_accessor :raw_text, :filenames, :output_directory, :summary_file, :threads_to_use, :java_max_memory, :sentences, :deps_dir def initialize(attrs = {}) self.raw_text = attrs[:raw_text] || "" self.filenames = []...
class University < ApplicationRecord has_many :libraries, dependent: :restrict_with_error has_many :students, dependent: :restrict_with_error validates :name, presence: true, uniqueness: true end
class CreateConfigConversations < ActiveRecord::Migration[5.2] def change create_table :config_conversations do |t| t.integer :conversation_id t.integer :user_id t.string :user_email t.boolean :pin t.boolean :archived t.timestamps end end end
require 'spec_helper' require 'ar_helper' describe ArHelper do subject { ArHelper.new } context "#find_ids_with_single_column" do context "for three spellings" do let(:words) { %w(foo bar bash) } it "should find no existing spellings" do subject.find_ids_with_single_column(Spelling, :label, words). ...
# Parser for Markdown require 'singleton' class MarkdownService include Singleton def initialize @redcarpet_instance = begin renderer = Redcarpet::Render::HTML.new(REDCARPET_OPTIONS) Redcarpet::Markdown.new(renderer, REDCARPET_EXTENSIONS) end end # markdown - Markdown String # # Retur...
require 'slop' require "git-rollback/version" class GitRollback attr_reader :config def initialize @config = {} end def run(opts, argv) process_argv(argv) command = ['git', 'reset'] command << (opts.hard? ? '--hard' : '--soft') command << "HEAD~#{config[:n]}" system(*command) end...
# frozen_string_literal: true require "spec_helper" describe "Support Opinion", type: :system, slow: true do include_context "with a component" let(:manifest_name) { "opinions" } let!(:opinions) { create_list(:opinion, 3, component: component) } let!(:opinion) { Decidim::Opinions::Opinion.find_by(component: ...
=begin #=============================================================================== Title: Attack Element Modifiers Author: Hime Date: Oct 9, 2014 URL: http://himeworks.com/2014/01/03/attack-element-modifiers/ -------------------------------------------------------------------------------- ** Change log Oct 9...
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). # # Examples: # # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) # Ch...
class CreateSentEmails < ActiveRecord::Migration def self.up create_table :sent_emails do |t| t.column :subject, :string t.column :content, :text t.column :is_html, :boolean t.column :classable_type, :string t.column :classable_id, :integer ...
require "test/unit/doctest/parser" require "test/unit/doctest/runner" require "test/unit/doctest/generator" require "test/unit/doctest/version" module Test::Unit module Doctest def self.run(files, require_file=true) Array(files).each { |file| Runner.new(file).run(require_file) } end def self.genera...
require 'fileutils' class Submission < ActiveRecord::Base after_save :save_file after_update :save_file belongs_to :user belongs_to :problem belongs_to :contest validates :languageUsed, presence: true, inclusion: {in: [".cpp", ".java", ".py", ".c"]} validates :submissionFile, presence: true validate ...
# == Schema Information # # Table name: survey_responses # # id :bigint(8) not null, primary key # survey_id :bigint(8) # created_at :datetime not null # updated_at :datetime not null # class SurveyResponse < ApplicationRecord belongs_to :survey has_many :answers, dependent: :d...
require 'rails_helper' RSpec.describe ColorsController, type: :controller do describe "ColorsController" do let(:user){create :mangement} let(:year){create :year} let(:maker){create :maker,{year_id: year.id}} let(:bike){create :roadbike,{maker_id: maker.id}} let(:color){create :color,{roadbike_id...
module JsonTableSchema class Constraints module Maximum def check_maximum if @value > parse_constraint(@constraints['maximum']) raise JsonTableSchema::ConstraintError.new("The field `#{@field['name']}` must not be more than #{@constraints['maximum']}") end true end ...
require 'pdf-reader' class ReplyData attr_accessor :reply, :username, :time def initialize(reply, username, time) # local variables shadow the reader methods @reply = reply @username = username @time = time end end class MarkupSummaryData attr_accessor :type, :comments, :username, :time, :r...
class RemoveSegmentIdFromSegments < ActiveRecord::Migration def change remove_column :segments, :segment_id, :integer end end
class Product < ActiveRecord::Base attr_accessible :allocated_qty, :category_id, :current_level, :description, :featured_product, :image_url, :name, :on_order_qty, :qty_per_unit, :reorder_level, :special_offer, :unit_price, :unit_type_id belongs_to :category belongs_to :unit_type has_many :line_items has_man...
class PhoneNumberService def self.search(q) client.get_available_numbers('US', pattern: "^1#{q}", size: 20) end def self.buy(account, number) ActiveRecord::Base.transaction do PhoneNumber.create!(account: account, number: number) Contact.create!(label: "", phone_number: number) client.b...
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'postamt/version' Gem::Specification.new do |spec| spec.name = "postamt" spec.version = Postamt::VERSION spec.authors = ["Martin Schürrer", "Martin Kavalar"] spec.emai...
class SubscriptDependenciesController < ApplicationController before_action :set_subscript_dependency, only: [:edit, :update, :destroy] def create @subscript_dependency = SubscriptDependency.new(subscript_dependency_params) @subscript_dependency.save redirect_to @subscript_dependency.algorithm, notice: 'D...
class Teacher::RecordsController < ApplicationController layout 'teacher' before_filter :get_teacher_and_course, :get_exam # GET /teacher/courses/1/exams/1/records # GET /teacher/courses/1/exams/1/records.json def index @records = Record.where(:exam_id => @exam.id).order('ended_at DESC').page(params[:page])...
class BaumWelch def initialize end def baum_welch_step(trans, emiss, init, observation_sequences) hmm = HMM.new(trans, emiss, init).forward_backward fb_results = observation_sequences.map { |os| hmm.forward_backward os } {updated_initial_probs: updated_initial_probs(init, fb_results), updated_t...
class Document < ActiveRecord::Base belongs_to :folder belongs_to :user #for created user information has_many :document_users has_many :users, :through => :document_users #for marking documents favorite has_and_belongs_to_many :linked_users, :class_name => 'User' has_...
require_relative "secret_messages/cipher.rb" module SecretMessages class App def initialize(input_file) file = File.open(input_file) @key = file.gets.chop file.gets @text = file.read end def decrypt results = [] ('A'..'Z').to_a.each do |k| key = SecretMessages...
require 'atchu/connection' require 'atchu/model_file_maker' require 'atchu/model' module Atchu extend self def for_db(db_config) Connection.connect db_config self end def generate_models_at(output_folder) Pathname.new(output_folder).children.each { |p| p.unlink } tables = Connection.get.table...
Rails.application.routes.draw do resources :contacts devise_for :users root 'sessions#index' resources :users do member do get :follow get :unfollow end end end
class GroupItem < ActiveRecord::Base def self.extract_item_info(group_items) """ gon経由でJSに変数を渡すための変換 group_itemからアイテムのID, itemのジオコード, group_itemのid, vote_num, アイテムのジャンルを抽出してハッシュで返す """ item_ids = [] item_geocodes = [] group_item_ids = [] vote_nums = [] item_genre = [] group_i...
# frozen_string_literal: true require 'rails_helper' RSpec.describe CustomerDetailPresenter do subject { CustomerDetailPresenter.new(customer_detail, customer_detail) } describe '#first_name' do let(:customer_detail) { double(first_name: 'Olaoluwa') } it 'returns First Name' do expect(subject.firs...
# encoding: utf-8 title 'Nginx Installation' control 'Nginx-01' do impact 1.0 title 'Nginx should be installed' desc 'Nginx is installed using the package manager.' describe package('nginx') do it { should be_installed } end end
require "spec_helper" RSpec.describe "Day 13: A Maze of Twisty Little Cubicles" do let(:runner) { Runner.new("2016/13") } let(:input) { "10" } describe "Part One" do let(:solution) { runner.execute!(input, part: 1, TARGET: [7, 4]) } it "computes the minimum number of steps to the target" do expec...
class CreateApplications < ActiveRecord::Migration def change create_table :applications do |t| t.references :dwelling t.references :user t.timestamp end end end
# Tuxedo main module module Tuxedo VERSION = '0.5.0'.freeze end
require 'spec_helper' feature 'User logs in with omniauth' do scenario 'using Twitter' do visit root_path click_on 'Inicia sesión' Rails.application.env_config['devise.mapping'] = Devise.mappings[:user] Rails.application.env_config['omniauth.auth'] = OmniAuth.config.mock_auth[:twitter] Rails.appl...
Gem::Specification.new do |s| s.name = 'mixpanel_ruby' s.version = '0.1' s.platform = Gem::Platform::RUBY s.homepage = 'https://github.com/Matchbook/mixpanel_ruby' s.summary = 'Mixpanel API' s.author = 'Matchbook' s.email = 'proxy@matchbook.co' s.files = Dir.glob('lib/*') + %w(README....
class Cart < ActiveRecord::Base has_many :cart_details has_many :products, through: :cart_details validates :name, presence: true validates :address, presence: true validates :phone, presence: true VALID_EMAIL_REGEX = /\A[\w+\-.+\d]+@[a-z\d\-.]+\.[a-z]+\z/i validates :email, presence: true, length: { maximum: 2...
class AddToProfile < ActiveRecord::Migration[5.1] def change add_column :profiles, :phone, :string add_column :profiles, :skill, :text end end
require 'rails_helper' describe 'User creates a new category' do describe 'user visits category index' do scenario 'a user can create a new category' do visit categories_path click_link 'Create New Category' expect(current_path).to eq(new_category_path) fill_in 'category[name]', with: ...
class EditCategoryDataTypeInListings < ActiveRecord::Migration def change remove_column :listings, :category, :integer add_column :listings, :produce_category, :string end end
# frozen_string_literal: true require_relative "company_view_tool/version" require_relative "company_view_tool/renderer " module CompanyViewTool class Error < StandardError; end # Your code goes here... end
class Resource < ActiveRecord::Base attr_accessible :categ_a, :categ_b, :cost, :description, :keywords, :level, :link, :rating, :source, :title, :medium, :user_id, :year, :category_id, :pdf, :image has_many :likes belongs_to :user belongs_to :category has_many :comments, dependent: :destroy ...
class Workstation < ActiveRecord::Base has_many :barcodes end
require 'net/http' class ExerciseWraper < ParentClass attr_reader :base_url, :language, :options def initialize(base_url, language, options) @base_url = 'https://wger.de/api/v2/exercise/?format=json&limit=all&language=2' end end
# # Cookbook Name::php-fpm # Recipe:: default # # Copyright (c) 2016 The Authors, All Rights Reserved. [ "php", "php-fpm", "php-devel", "php-bcmath", "php-cli", "php-common", "php-dba", "php-dbg", "php-gd", "php-intl", "php-ldap", "php-mbstring", "php-mcrypt", "php-mysqlnd", "php-pdo", "php-pecl-igbinary", "php-pecl-m...
require 'poms/timestamp' module Poms module Fields # modeule to retrieve scheduling/timtable related information from # poms items. module Schedule extend self # Returns an array of odi stream types. # Note: this code is copied from Broadcast # and it is assumed it was working th...
class TaskgroupsController < ApplicationController before_filter :load_model, :only => [:show, :edit, :update, :destroy] def index @taskgroup = Taskgroup.new @taskgroups = Taskgroup.all @resources = Resource.all(:conditions => {:enabled => true}) end def new end def create @taskgroup = ...
require 'net/http' module XmlUtilities WL1_URL = 'https://kbhandbook.indiana.edu/worklist' # WL1_URL = "https://paprika.uits.indiana.edu/~jorahood/cgi-bin/doclists/cgi-bin/worklist.cgi" WL1ListIndex = WL1_URL + "/listids" @@rest_login = { :username_production => 'kbdevtest', :password_production ...
class User attr_accessor :name, :email #the principal importance of instance variables is that they are automatically available in the views, but in general they are used for variables that need to be available throughout a Ruby class. def initialize(attributes = {})#it’s the method called when we execute User.new ...
class ChangeFormatTypeColumnName < ActiveRecord::Migration[5.0] def self.up rename_column :test_scenarios, :formatType, :format_type end def self.down rename_column :test_scenarios, :format_type, :formatType end end
class CreateSearches < ActiveRecord::Migration def change create_table :searches do |t| t.string :text, index: true t.references :searcher, polymorphic: true, index: true t.text :result, array: true, default: [] t.references :school_branch, index: true t.timestamps end end end...
# # Cookbook Name:: frog # Recipe:: _packages.rb # # Copyright (C) 2014 Nick Downs # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the ri...
# frozen_string_literal: true module GithubTokenAuth SECRET_GITHUB_TOKEN = Rails.env['SECRET_GITHUB_TOKEN'] || Rails.application.secrets.secret_github_token def verify_github_webhook_token unless Rack::Utils.secure_compare(app_sha1_key, github_sha1_key) raise SecurityError end end private de...
class Employment < ApplicationRecord has_attached_file :resume validates_attachment :resume, :content_type => { :content_type => %w(application/pdf application/msword application/vnd.openxmlformats-officedocument.wordprocessingml.document) } validates_presence_of :name, :current_company,:ctc,:ectc,:total_experien...