text stringlengths 10 2.61M |
|---|
# frozen_string_literal: true
require 'time'
module Tikkie
module Api
module Resources
# Resource for a Payment Request.
class PaymentRequest < Base
STATUS_OPEN = 'OPEN'
STATUS_CLOSED = 'CLOSED'
STATUS_EXPIRED = 'EXPIRED'
STATUS_MAX_YIELDED_REACHED = 'MAX_YIELD_REACHE... |
class ApplicationController < ActionController::Base
helper_method :current_user
helper_method :logged_in?
def current_user
return nil unless session[:session_token] # unless session already ended / does not exist
@current_user ||= User.find_by(session_token: session[:session_token]) # finding the user ... |
class MatchingsController < ApplicationController
before_action :set_user, only: [:create]
skip_before_action :update_existing_user
def create
@matching = Matching.new(user_id: current_user.id, match_id: @user.id, status: 'pending')
respond_to do |format|
if @matching.save
format.html {... |
# frozen_string_literal: true
feature 'approve single booking' do
before do
DatabaseCleaner.clean_with(:truncation)
signup
fill_in_listing
logout
signup(username: 'bob', password: 'Bobrules')
click_button 'Book'
logout
login
click_link 'Booking Requests'
end
scenario 'a liste... |
require 'test_helper'
class InsuredUsersControllerTest < ActionController::TestCase
setup do
@insured_user = insured_users(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:insured_users)
end
test "should get new" do
get :new
assert_res... |
class AmazonGameGrazer < AmazonGrazer
def self.top_url
'http://www.amazon.co.uk/gp/new-releases/videogames/ref=sv_vg_h__13'
end
def self.get_summary_data(limit=0)
summary_data = []
section_links.each do |section_link|
summary_data += process_section(section_link)
end
summary_data
end... |
feature 'Send user to add page' do
scenario 'A user clicks a link that send them to the peep page' do
sign_in_and_chatter
expect(current_path).to eq '/peeps/new'
expect(page).to have_content 'Post a message onto Chitter'
end
end
|
class Room < ApplicationRecord
has_many :room_users, foreign_key: 'room_id'
has_many :users, through: :room_users
has_many :messages
accepts_nested_attributes_for :room_users, allow_destroy: true
accepts_nested_attributes_for :messages, allow_destroy: true
end
|
class Key < ActiveRecord::Base
has_and_belongs_to_many :tunes
end
|
namespace 'jsunittest' do
desc "Updates the jsunittest.js assets in generators"
task :update do
require "fileutils"
FileUtils.mkdir_p(cache = "/tmp/jsunittest")
target_folders =
`find * -name jsunittest.js | sed -e "s/jsunittest.js$//"`.split("\n")
path = "http://jsunittest.com/dist/jsunittes... |
require 'spec_helper'
require 'app/models/config/base'
require 'app/models/config/mdast'
describe Config::Mdast do
it_behaves_like 'a service based linter' do
let(:raw_config) do
<<-EOS.strip_heredoc
{
"heading-style": "setext"
}
EOS
end
let(:hound_config_content) d... |
object @taxon
attributes :id, :name, :description
node(:icon) do |taxon|
if taxon.icon.try(:attachment).present?
URI(request.url) + taxon.icon.try(:attachment).try(:url, :normal)
end
end
|
class ConcertsController < ApplicationController
def new
@concert = Concert.new
render 'new'
end
def create
@concert = Concert.new concert_params
if @concert.save == true
redirect_to concert_path(@concert)
else
render 'new'
end
end
def show
@display_concert = Concert.find(params[:id])
rend... |
# Author:: Paul Mooring <paul@opscode.com>
# Copyright:: Copyright (c) 2012 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:... |
class Post < ActiveRecord::Base
attr_accessible :description, :image, :title, :url, :likes, :user_id, :community_id
belongs_to :user
belongs_to :community
has_many :comments, :dependent => :destroy, order: 'created_at desc'
has_many :user_likes_posts, :dependent => :destroy, order: 'created_at desc'
def r... |
require 'rails_helper'
RSpec.describe Handicap, type: :model do
it "障がい名がある場合、有効な状態であること" do
expect(FactoryBot.build(:handicap)).to be_valid
end
it "障がい名がない場合、不正な状態であること" do
expect(FactoryBot.build(:handicap, name:nil)).not_to be_valid
end
end
|
class Category < ActiveRecord::Base
acts_as_nested_set
include TheSortableTree::Scopes
validates :name, presence: true
validates :name, uniqueness: true
has_many :posts, dependent: :destroy
def title
name
end
end
|
class User < ActiveRecord::Base
authenticates_with_sorcery! do |config|
config.authentications_class = Authentication
end
attr_accessible :username, :password, :password_confirmation,
:email, :remember_me, :authentications_attributes
validates_confirmation_of :password
validates :username, :presenc... |
require 'test_helper'
class ItemGroupsControllerTest < ActionController::TestCase
setup do
@item_group = item_groups(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:item_groups)
end
test "should get new" do
get :new
assert_response :s... |
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe SolidusGraphqlApi::Services::User::SignIn do
let(:email) { "john@example.com" }
let(:password) { "secret" }
let!(:user) { create(:user, email: "john@example.com", password: "secret") }
subject(:instance) { described_class.new }
describe "... |
class DropOfferValuesTables < ActiveRecord::Migration
def up
drop_table :offer_values
drop_table :offer_values_offers
end
def down
create_table "offer_values", :force => true do |t|
t.integer "donation_amount_cents", :default => 0, :null => false
t.integer "credit_amount_cents", :... |
class RegistrationMailer < ApplicationMailer
def welcome(admin_user, passwd)
@passwd = passwd
@admin_email = admin_user
@admin_login = "http://www.pearlwesthawaii.org/admin/sign_in"
mail(to: @admin_email, subject: "HCPW Admin Portal Login Instructions")
end
end |
class PhoneCall < ApplicationRecord
validates_presence_of :phone_number, :agent, :status
belongs_to :phone_number , -> { with_deleted }
belongs_to :agent , -> { with_deleted }
end
PhoneCall.includes(:agent).all
PhoneCall.includes(:phone_number).all
|
class Category < ActiveRecord::Base
attr_accessible :cat, :post_id
validates :cat, :presence => true
belongs_to :post
end
|
require "test_helper"
describe Rugged::Tree do
before do
@path = File.dirname(__FILE__) + '/fixtures/testrepo.git/'
@repo = Rugged::Repository.new(@path)
@oid = "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b"
@tree = @repo.lookup(@oid)
end
it "can read the tree data" do
assert_equal @oid, @tree.o... |
require 'pty'
require 'fileutils'
class Vigil
class System
def initialize()
@log = Logging.logger[self]
end
def run_command(command)
output = []
child = nil
p command
ENV['COLUMNS'] = '80' # FIXME workaround bug in progressbar gem used by veewee
Bundler.with_clea... |
require 'minitest/autorun'
require 'gizoogle'
class WebpageTest < Minitest::Test
def test_google_dot_com
assert Gizoogle::Webpage.translate('google.com').include? 'I be Feelin Lucky'
end
end
|
require_relative 'bike'
require_relative 'bike_container'
require_relative 'van'
class DockingStation
include BikeContainer
def release_bike
raise 'No bikes avalible' if empty?
raise 'No working bikes' unless any_working?
bikes.pop
end
def dock(bike)
add_bike(bike)
end
private
def any_w... |
class BirthAndApprovedToDateOnly < ActiveRecord::Migration
def self.up
change_column :docs, :birthdate, :date
change_column :docs, :approveddate, :date
end
def self.down
change_column :docs, :birthdate, :datetime
change_column :docs, :approveddate, :datetime
end
end
|
require "image_processing/mini_magick"
class UserImageUploader < Shrine
include ImageProcessing::MiniMagick
plugin :remove_attachment
plugin :remove_invalid
plugin :default_url
Attacher.default_url do
ActionController::Base.helpers.asset_path("default_avatar.png")
end
Attacher.validate do
vali... |
require 'rails_helper'
describe SitemapController, type: :controller do
describe "GET #index" do
it 'assigns recent tournaments as @tournaments' do
tournament = create :tournament
get :index
expect(assigns :tournaments).to eq [tournament]
end
it 'assigns recent pages as @pages' do
... |
class CreateSitters < ActiveRecord::Migration[5.0]
def change
create_table :sitters do |t|
t.string :name
t.string :address
t.string :city
t.string :state
t.string :zipcode
t.string :phone
t.string :email
t.float :lat
t.float :long
t.boolean :backyard
... |
class UserMailer < ApplicationMailer
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.user_mailer.new_misuration.subject
#
def new_misuration(misuration)
@misuration = misuration
@sensor = @misuration.sensor
mail to: @sensor.user.email,
... |
# require_dependency "usermanagement/application_controller"
#
# module Usermanagement
# class ConfirmationrightsController < ApplicationController
# before_action :set_confirmationright, only: [:show, :edit, :update, :destroy]
#
# # GET /confirmationrights
# def index
# @confirmationrights = Confir... |
class BusinessesController < ApplicationController
before_action :set_business, only: [:show, :edit, :update, :destroy]
before_filter :authenticate_admin!, only: [:index, :new, :create, :destroy, :edit]
respond_to :html
def index
@businesses = Business.all
respond_with(@businesses)
end
def sh... |
# This migration comes from mjweb (originally 20140614202943)
class CreateMjwebContents < ActiveRecord::Migration
def change
create_table :mjweb_contents do |t|
t.integer :company_id
t.integer :tile_id
t.integer :tile_ref
t.string :display, default: "All devices"
t.timestamps
en... |
FactoryGirl.define do
factory :examination do
title "MyString"
description "MyText"
status 1
total_questions 5
factory :invalid_examination do
title nil
total_questions nil
end
end
end
|
desc "Symlink every file"
task :default do
files = Dir.glob("*").reject { |file| file == "Rakefile" }
current_path = File.dirname(__FILE__) + "/"
# Print start message
p "Symlinking: #{files.join(", ")}"
files.each do |file|
sh "ln -vfs #{current_path}#{file} ~/.#{file}"
end
end
|
#
# Cookbook Name:: service_factory
# Library:: mixin_provider_unix
#
# Author:: BinaryBabel OSS (<projects@binarybabel.org>)
# Homepage:: http://www.binarybabel.org
# License:: Apache License, Version 2.0
#
# For bugs, docs, updates:
#
# http://code.binbab.org
#
# Copyright 2013 sha1(OWNER) = df334a7237f10846a0ca3... |
require_relative 'teller.rb'
require_relative 'account.rb'
class Bank
attr_reader :accounts, :tellers
def initialize
@accounts = []
@tellers = []
end
include Enumerable
def add_account(id)
@accounts << Account.new(id)
end
def add_teller(name,minutes)
@tellers << Teller.new(name,minutes... |
module Graphlib
module Helper
def create_pieces(x1, x2, divisions)
pieces = []
length = x2 - x1
divisions.times do |i|
pieces << (length * i).to_f / (divisions-1) + x1
end
pieces
end
def normalize_values(x1, x2, window_size, values)
values.map do |v|
((v - x1) * window_size).to_f / (x2 - x1).to_f
end
end
... |
class Blog
include MongoMapper::Document
safe
timestamps!
key :rdbms_id, Integer
key :title, String
many :posts, :class_name => 'Post'
end
|
class AddWinnerColumnToPlay < ActiveRecord::Migration
def change
add_column :plays, :winner, :integer, null: true
end
end
|
class Recipe < ActiveRecord::Base
belongs_to :user
has_many :ingredients
has_many :directions
accepts_nested_attributes_for :ingredients,
reject_if: proc { |attribute| attribute['name'].blank? },
allow_destroy: true
accepts_nested_attributes_for :directions,
rejec... |
# frozen_string_literal: true
class AddBoxberryOfficeIdToProfile < ActiveRecord::Migration[5.2]
def change
add_column :profiles, :boxberry_office_id, :string
end
end
|
class List
# ==================================================
# SET UP
# ==================================================
# add attribute readers for instance accesss
attr_reader :id, :title, :image, :description, :done, :likes
# CREATE TABLE lists (id SERIAL, title VARCHAR(50), descrip... |
module Antlr4::Runtime
class LexerChannelAction < LexerAction
attr_reader :channel
def initialize(channel)
@channel = channel
end
def action_type
LexerActionType::CHANNEL
end
def position_dependent?
false
end
def execute(lexer)
lexer._channel = @channel
... |
class Admin::ClientsController < ApplicationController
before_filter :authorize_admin
layout "admin"
# GET /clients
# GET /clients.json
def index
@clients = Client.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @clients }
end
end
# GET /clients... |
module PdfTempura
module Render
class FieldDataMapper
def self.map(fields, data)
data ||= {}
fields.each_with_object({}){ |field, memo|
memo[field] = data[field.name]
}
end
end
end
end
|
# lib/controllers/routing_controller.rb
require 'controllers/callback_controller'
require 'controllers/proxy_controller'
require 'controllers/session_controller'
require 'controllers/user_controller'
require 'controllers/mixins/callback_helpers'
require 'controllers/mixins/help_actions'
require 'controllers/mixins/mod... |
class SocialProfile < ActiveRecord::Base
belongs_to :user
def self.find_from_omniauth(auth)
where(auth.slice(:provider, :uid)).first
end
def self.create_from_omniauth(auth)
user = User.create_from_social(auth)
user.social_profiles.create(
provider: auth.provider,
uid: auth.uid,
o... |
require 'test_helper'
require 'model_test_helper'
class ChatbotSearchTest < ActiveSupport::TestCase
test 'Search chatbot empty' do
user = users(:admin)
s = ChatbotSearch.new(user)
assert_equal 3, s.options.size
assert_equal '', s.options[:query]
assert_not s.options[:filter_wip]
assert_equal... |
# frozen_string_literal: true
require 'jiji/configurations/mongoid_configuration'
require 'jiji/utils/value_object'
require 'jiji/web/transport/transportable'
require 'jiji/errors/errors'
module Jiji::Model::Trading
# 決済条件
class ClosingPolicy
include Mongoid::Document
include Jiji::Errors
include Jij... |
class NavBar < SitePrism::Section
element :brand, '.navbar-brand'
section :pathshala, '.dropdown.pathshala' do
element :link, 'a.dropdown-toggle'
element :classes, '.class-levels a'
end
section :membership, '.membership' do
element :link, 'a.dropdown-toggle'
element :search, '.search a'
end
... |
# Using the code from what_are_you.rb, add a parameter to #initialize that provides
# a name for the Cat object. Use an instance variable to print a greeting with
# the provided name. (You can remove the code that displays "I'm a cat!".)
class Cat
def initialize(name)
@name = name
puts "Hello, #{@name}!"
e... |
class BirdsUser < ApplicationRecord
belongs_to :bird
belongs_to :user
end
|
require "json"
require_relative "../lib/input_parser"
filepath = ARGV[0]
raise "No filepath was given to the script" if filepath.nil?
raise "File #{filepath} doesn't exists" if !File.exists?(filepath)
rental_repository = InputParser.new(filepath).rentals
rentrals = rental_repository.all.map do |rental|
{
id: ... |
# encoding: utf-8
class AccountLink < ActiveRecord::Base
attr_accessible :link_id, :politician_id
belongs_to :link, :class_name => "Politician"
end
|
class Article < ApplicationRecord
validates_presence_of :title, :text
end
|
# frozen_string_literal: true
module GraphQL
module Deprecation
def self.warn(message)
Kernel.warn(message)
end
end
end
|
require 'spec_helper'
require 'import/rels_ext_parser'
describe RelsExtParser do
let(:rels_ext) { fixture_file('files/air_race-RELS.xml').read }
subject { RelsExtParser.new(rels_ext) }
it 'parses rdf xml' do
expect(subject.doc.class).to eq Nokogiri::XML::Document
end
describe '#collection_member_ids' d... |
class UpdateUser < ActiveRecord::Migration[5.1]
def change
add_column :users, :admin, :boolean
add_column :users, :activation_digest, :string
add_column :users, :activated, :boolean
add_column :users, :activated_at, :datetime
remove_column :users, :name
remove_column :users, :date_of_birth
e... |
#Simple Icon Inventory v1.0
#----------#
#Features: Look, Icons! Instead of a list!
#
#Usage: Plug and play.
#
#----------#
#-- Script by: V.M of D.T
#
#- Questions or comments can be:
# given by email: sumptuaryspade@live.ca
# provided on facebook: http://www.facebook.com/DaimoniousTailsGames
# All my othe... |
require 'test_helper'
class UsersSignInTest < ActionDispatch::IntegrationTest
def setup
@user = users(:general_user)
@other_user = users(:other_user)
@admin_user = users(:admin_user)
end
# --- [devise gem] ユーザー登録(/users/sign_up) ---
test "ログインしていないとき、ユーザー登録ページにアクセス" do
get new_user_registratio... |
node(:status) { 'success'}
node(:comments) do
child @comments, :object_root => false do
attributes :content, :id
node(:created_at) { |post| post.created_at.utc.strftime("%Y-%m-%d %H:%M:%S") }
child(:user) do
attributes :username
node(:profile_pic_url) { |user| user.profile_image.url }
end... |
class CreateSnMemberships < ActiveRecord::Migration
def self.up
create_table :sn_memberships do |t|
t.column :faculty_id, :integer, :null => false
t.column :social_network_id, :integer, :null => false
t.column :created_at, :datetime
t.column :username, :string
end
end
def self.down
drop_table... |
class Achievement < ApplicationRecord
belongs_to :applicant
validates :title, presence: true
validates :date, presence: true
default_scope { order date: :desc }
end
|
# If you take a number like 735291, and rotate it to the left, you get 352917.
# If you now keep the first digit fixed in place, and rotate the remaining
# digits, you get 329175. Keep the first 2 digits fixed in place and rotate
# again to 321759. Keep the first 3 digits fixed in place and rotate again
# to get 321597... |
class BrewCaskCompletion < Formula
desc "Bash & Fish completion for brew-cask"
homepage "https://github.com/xyb/homebrew-cask-completion"
url "https://github.com/xyb/homebrew-cask-completion/archive/v2.1.tar.gz"
sha256 "27c7ea3b7f7c060f5b5676a419220c4ce6ebf384237e859a61c346f61c8f7a1b"
head "https://github.com... |
json.array!(@student_infos) do |student_info|
json.extract! student_info, :id, :branch_id, :child_id, :studentname
json.url student_info_url(student_info, format: :json)
end
|
class SerializableTroc < JSONAPI::Serializable::Resource
type 'trocs'
attributes :id, :caller_dish_id, :answer_dish_id, :caller_id, :answerer_id, :status, :created_at, :updated_at
meta do
{ answer_dish: @object.answer_dish.user_dish,
caller_dish: @object.caller_dish.user_dish,
answerer: @object.... |
module ConceptQL
# Scope coordinates the creation of any common table expressions that might
# be used when a Recall operator is present in the statement.
#
# Any time an operator is given a label, it becomes a candidate
# for a Recall operator to reuse the output of that operator
# somewhere else in the st... |
class ApplicationController < ActionController::Base
before_action :authenticate_user!
rescue_from DeviseLdapAuthenticatable::LdapException do |exception|
render :text => exception, :status => 500
end
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
... |
class OrderItems
include ActiveModel::Model
attr_accessor :post, :prefecture_id, :city, :address, :building,:phone_number, :token, :user_id, :item_id
with_options presence: true do
validates :post, format: {with: /\A[0-9]{3}-[0-9]{4}\z/, message: "is invalid. Include hyphen(-)"}
validates :prefecture_id
va... |
require 'test_helper'
class SessionsHelperTest < ActionView::TestCase
# app/helpers/sessions_helperのテスト
# 永続的セッションのテスト
def setup
@user = users(:michael)
remember(@user)
end
# sessionがnilのときcurrent_userは正しいユーザを返す
test "current_user returns right user when session is nil" do
# @userとcurrent_u... |
class Admin::UsersController < ApplicationController
before_action :set_user, only: %i[new create edit update show destroy]
before_action ->{authorize @user}, only: %i[new create edit update show destroy]
respond_to :html, :js, :json
def index
@users = User.all
authorize @users
respond_with @user... |
module Vcloud
module Core
class QueryRunner
def initialize
@fsi = Vcloud::Core::Fog::ServiceInterface.new
end
def run(type=nil, options={})
raise ArgumentError, "Query API :format option is not supported" if options[:format]
get_all_results(type, options)
end
... |
class User < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable
has_many :questions, dependent: :restrict_with_exception
has_many :answers, dependent: :restrict_with_exception
def author_of?(obj)
obj.user_id == id
end
end
|
FactoryGirl.define do
sequence(:email) { |n| "user#{n}@email.com" }
factory :user do
email
password "johndoe"
password_confirmation { |u| u.password }
first_name "John"
last_name "Doe"
admin false
end
factory :admin, class: User do
email
password "janedoe"
password_confirmati... |
require 'spec_helper'
describe PostalCodeValidator do
let(:described_class) { PostalCodeValidator }
describe :validate_each do
let(:validator) { described_class.new(options) }
let(:options) { { attributes: [attribute] } }
let(:record) { double('ActiveRecord::Base', errors: errors) }
let(:errors) {... |
class AddPredictions < ActiveRecord::Migration
def up
create_table :predictions do |t|
t.integer :game_id
t.string :win_home
t.string :win_quest
t.string :draw_result
t.string :goals_home
t.string :goals_quest
t.boolean :is_recommended, :boolean, :default => false
... |
class Chitter < Sinatra::Base
get '/sessions/new' do
redirect '/' if current_user
erb :'sessions/new'
end
post '/sessions' do
user_id = User.authenticate(params[:user_or_email], params[:password])
if user_id
session[:user_id] = user_id
redirect '/'
else
flash.now[:errors] = ... |
class Libffi < Package
desc 'A portable foreign-function interface library'
homepage 'https://github.com/libffi/libffi'
url 'https://github.com/libffi/libffi/archive/v${version}.tar.gz'
release version: '3.2.1', crystax_version: 2
build_copy 'LICENSE'
def build_for_abi(abi, _toolchain, release, _host_de... |
class Student
attr_accessor :first_name, :last_name, :courses
def initialize(first_name, last_name)
@first_name = first_name
@last_name = last_name
@courses = []
end
def name
"#{@first_name} #{@last_name}"
end
def enroll(course)
raise "conflicting courses" if @courses.any? do |other_... |
describe 'Add some valid text using encoded spaces' do
before(:all) { @text = 'Test%20me%20on%20the%20space' }
let(:get_text){ get "?text=#{@text}" }
it 'Returned value should be a String' do
get_text
expect_json_types(result: :string)
end
it 'Introduced text should match on response' do
get_te... |
#!/usr/bin/env ruby
# encoding: utf-8
# Sweden: [Robin Dorand](www.dorand.se/)
### CONFIG [ THESE VALUES OVERRIDE weatherparser.rb ]
# "City, State" or "City, Country" or ZIP Code
$mycity = 'Lulea, Sweden'
# f for fahrenheit, c for celsius
$f_or_c = 'c'
# folder where the weather icons are located, no trailing slash
$... |
class Queue
attr_reader :length
def initialize(size = 8)
@store = Array.new(size, nil)
@capacity = size
@length = 0
@start_idx = 0
end
def enqueue(element)
resize! if length >= capacity
@length += 1
self[length-1] = element
store
end
def dequeue
check_index
dequeue... |
class User < ApplicationRecord
validates :firstname, presence: true
validates :lastname, presence: true
validates :email, presence: true, uniqueness: true, format: /\w+@\w+\.{1}[a-zA-Z]{2,}/
end
|
require_relative 'registracion_error'
class EdadMaximaSuperaLimiteError < RegistracionError
def initialize(msg = 'supera el límite máximo de edad')
super
end
end
|
class Category < ActiveRecord::Base
extend FriendlyId
friendly_id :name, use: :slugged
has_many :apply_nows
has_many :awards
has_many :histories
has_many :committees
has_many :deadlines
has_many :faqs
has_many :home_galleries
has_many :overviews
has_many :pages
has_many :schedules
has_many :se... |
# typed: true
class CreateMakes < ActiveRecord::Migration[6.0]
def change
create_table :makes do |t|
t.text :what_will_i_make
t.timestamps
end
end
end
|
class LocationsController < ApplicationController
include RedirectCallback
before_action :authenticate_user!, only: [:index, :create, :udpate, :destroy, :user_default_address]
before_action :set_location, only: [:edit, :update, :destroy]
before_action :set_callback, only: [:index, :create]
def index
@lo... |
json.array!(@supplies) do |supply|
json.extract! supply, :id, :game_id, :supply_type, :card_pile_id
json.url supply_url(supply, format: :json)
end
|
require 'rest_client'
require 'base64'
require 'json'
# Global Plan Line Id volatile
planLineId = nil
def establish_user_server
@username = 'connor.horton'
@password = 'Welcome1'
@server = 'http://slc05kvt.us.oracle.com:7011/projectsManagement/rest/v1/pjlMyTasks'
end
def get_task_details(plan_line_id)
plan_line_... |
FactoryBot.define do
factory :address, parent: :dsc_address, class: Address do
# Create TRAIT to add Type for each possible Address Type
# ..e.g primary, secondary, etc
Address.address_types.each_key do |at|
trait :"#{at}" do
address_type at
end
end
trait :location_with_uprn d... |
class DropTeamsAndTeamBadges < ActiveRecord::Migration
def change
drop_table :teams_and_team_badges
end
end
|
require 'rails_helper'
RSpec.describe Item, type: :model do
before do
@item = FactoryBot.build(:item)
end
describe '商品出品機能' do
context '商品出品できるとき' do
it 'name、description、price、item_condition、delivery_charge、delivery_day、prefecture、categoryが存在すれば登録できる' do
expect(@item).to be_valid
en... |
require 'spec_helper'
require 'rails_helper'
feature "Creating users" do
let!(:admin) { FactoryGirl.create(:admin_user) }
before do
login_as!(admin)
visit "/"
click_link "Admin"
click_link "Users"
click_link "New User"
end
scenario "new user" do
fill_in "Username", with: "TestUser"
fill_in "Email"... |
# -*- encoding : utf-8 -*-
# The Last.fm backend for the content engine.
#
# Allows for searching and retrieving information (including images) on
# artists, albums, songs and events.
#
# This code is part of the Stoffi Music Player Project.
# Visit our website at: stoffiplayer.com
#
# Author:: Christoffer Brodd-Reije... |
control "M-7.8" do
title "7.8 Ensure node certificates are rotated as appropriate (Not Scored)"
desc "
Rotate swarm node certificates as appropriate.
Docker Swarm uses mutual TLS for clustering operations amongst its nodes.
Certificate
rotation ensures that in an event such as compromised node or key, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.