text stringlengths 10 2.61M |
|---|
module V1
class GamesController < MainController
before_action :set_game, only: %i[show update destroy]
def index
@games = Game.includes(:board, :plays).all
json_response @games
end
def create
@game = Game.create!(game_params)
json_response @game, :created
end
def sh... |
require 'test_helper'
class SaqueControllerTest < ActionController::TestCase
setup do
@saque = saque(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:saque)
end
test "should get new" do
get :new
assert_response :success
end
test "... |
class ApplicationController < ActionController::API
include DeviseTokenAuth::Concerns::SetUserByToken
# before_action :current_user, :cors_preflight_check
# after_action :cors_set_access_control_headers
# skip_before_action :verify_authenticity_token
# From https://www.airpair.com/ruby-on-rails/pos... |
SimpleForm.setup do |config|
config.error_notification_class = 'alert alert-error'
config.label_class = 'col-sm-2 control-label'
config.input_class = 'form-control'
config.wrappers :bootstrap, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.use :placeholder
b.use :l... |
require 'spec_helper'
describe "sessions", type: :feature do
context "logged in user" do
before(:each) do
log_in
end
it "can log out" do
visit admin_path
click_link "Log out"
end
end
context "NOT logged in user" do
it "can log if password provided is valid" do
log_in... |
class PublicFoldersController < ApplicationController
before_filter :authenticate_user!, :except => ['index', 'show']
def index
@public_folders = PublicFolder.find(:all)
@public_view = true
end
def show
@current_folder = Folder.find(params[:id])
@is_this_folder_public = true if @current_f... |
class Project < ActiveRecord::Base
PLATFORM_TYPES = {'raspberry_pi' => "RaspberryPi", 'beagle_bone' => "Beaglebone", 'arduino' => "Arduino"}
has_attached_file :jar_file
has_attached_file :instructions_manual
validates_attachment_content_type :jar_file, :content_type => %w(application/java-archive)
validates... |
require './ui/ui_helper'
def welcome
puts "\n\nWelcome to the Mailgun command-line email client."
menu
end
def menu
choice = nil
until choice == 'e'
puts "\n\nWhat would you like to do?"
puts "Press 's' to send and email or 'm' to manage subscriptions"
puts "Press 'e' to exit"
case choice = g... |
rails new Todo
rails g scaffold todo_list title:string description:text
rails db:migrate
rails g model todo_item content:string todo_list:references
rails db:migrate
in routes
nest todo_items under todo_lists
check rails routes for full path
rails g controller todo_items
rails g migration add_completed_at_to_tod... |
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Validators::ReservationTicketsQuantity do
describe 'validate' do
let(:tickets_quantity) do
{
even: ordered_even,
all_together: ordered_all_together,
avoid_one: ordered_avoid_one
}
end
let(:... |
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_action :configure_permitted_parameters, if: :devise_controller?
before_action :set_notifications
protected
... |
require 'rails_helper'
RSpec.describe 'Manage Gym', js: true do
let!(:gym) { create(:gym) }
let!(:user) { create(:user, gym: gym) }
let!(:disabled_user) { create(:user, gym: gym, account_disabled: true) }
let!(:gym_admin) { create(:gym_admin, gym: gym, user_id: user.id) }
let!(:category) { create(:category, ... |
FactoryBot.define do
factory :tweet do
user { nil }
twitter_account { nil }
body { "MyText" }
publish_at { "2021-01-29 10:54:09" }
tweet_id { "MyString" }
end
end
|
class RemoveConomeFromVisitors < ActiveRecord::Migration
def change
remove_column :visitors, :conome
end
end
|
relative_require 'travis_api'
class Redistribute
def initialize(yaml)
@yaml = yaml
end
def write_yaml
@yaml.rewrite_matrix()
end
def fuzz_times(seed:, spec_list:)
srand(seed)
spec_list.map do |spec|
new_spec = spec.clone
new_spec[:duration] = rand_duration(new_spec[:duration]... |
name 'inifile_chef_gem'
maintainer 'Dmitry Shestoperov'
maintainer_email 'dmitry@shestoperov.info'
license 'All rights reserved'
description 'Installs/Configures inifile gem for chef'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
issues_url 'https://githu... |
class Orbiter
def initialize
@orbiting = nil
@orbiters = []
end
def set_orbit(other)
@orbiting = other
other.add_orbiter(self)
end
def add_orbiter(other)
@orbiters << other
end
def count_of_orbits
if @orbiting
@orbiting.count_of_orbits + 1
else
0
end
end
... |
class Like < ActiveRecord::Base
belongs_to :prototype, counter_cache: true
belongs_to :user
validates :prototype_id,
uniqueness: { scope: [:user_id] }
end
|
class SlackService
def self.perform(message, error)
begin
client = Slack::Web::Client.new
results = client.files_upload(
as_user: true,
content: {
:message => message.data.body,
:error_type => error.class,
:error_message => error.message,
... |
class Reporter < ActiveRecord::Base
outpost_model public_route_key: "reporter"
belongs_to :user
has_many :attributions
has_many :posts, through: :attributions
validates :name, presence: true
validates :slug, presence: true
after_save -> { self.touch }
class << self
def select_collection
s... |
require "rails_helper"
feature "Admin deletes a trip" do
scenario "successfully" do
trip = create(:trip)
message = I18n.t("flash.actions.destroy.notice", resource_name: "Trip")
visit trips_path
page.driver.submit :delete, "/trips/#{trip.id}", {}
expect(page).to have_text(message)
end
end
|
require_relative '../app/helpers/TimeLeft'
describe "TimeCalculations" do
include TimeCalculations
# let(:dummyClass){Class.new{include TimeCalculations}}
let(:time_now){Time.new(2007,11,3)}
let(:time_start){Time.new(2007,11,1)}
let(:time_deadline){Time.new(2007,11,9)}
before(:each) do
Time.stub(:now).and_... |
class SenateSeat < ApplicationRecord
belongs_to :state
belongs_to :politician
end
|
module UserConcerns
module ProfileTypes
extend ActiveSupport::Concern
VALID_MULTIPLIER_PROFILES_TYPES = {
:mentor => "mentor",
:librarian => "librarian",
:social_educator => "social_educator",
:teacher => "teacher"
}.freeze
VALID_PROFILES_TYPES = {
... |
class Trundle::NamespaceList
def initialize
@namespaces = {}
end
def include?(name)
@namespaces.has_key? name.to_sym
end
def key(name)
@namespaces[name.to_sym]
end
def all
@namespaces
end
def method_missing(name, *args, &block)
@namespaces[name.to_sym] = args[0]
end
end
|
# https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/
# 448. Find All Numbers Disappeared in an Array
# Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.
# Find all the elements of [1, n] inclusive that do not appear in this arra... |
class RehearsalsController < ApplicationController
before_action :set_rehearsal, only: [:show, :edit, :update, :destroy]
def index
if params[:event_id]
@event = current_user.events.find(params[:event_id])
@rehearsals = @event.rehearsals
else
@rehearsals = current_user.rehearsals
@... |
FactoryGirl.define do
factory :author_role, class: 'Role' do
name :author
end
factory :guest_role, class: 'Role' do
name :guest
end
factory :censor_role, class: 'Role' do
name :censor
end
factory :admin_role, class: 'Role' do
name :admin
end
factory :user do |user|
user.sequence(:n... |
class EmailValidity < ActiveRecord::Migration
def change
add_column :users, :email_valid, :boolean, :default => true
add_column :leads, :email_valid, :boolean, :default => true
add_column :users, :email_subscribed, :boolean, :default => true
add_column :leads, :email_subscribed, :boolean, :default => true... |
class Order < ApplicationRecord
belongs_to :user
belongs_to :item
after_create :att_user_coins
after_create :att_item_quantity
enum status: [ :pendente, :entregue ]
def att_user_coins
self.user.coins -= self.item.value
self.user.save
end
def att_item_quantity
self.item.quantity -= 1
i... |
require 'rexml/document'
require 'open-uri'
require 'csv'
require 'yaml'
class Namazu
def initialize
yml = YAML::load(File.open('config/namazu.yml'))
@file_name = yml["csv"]["file_name"]
end
def show
url = 'http://nmz.mogken.com/api?c=10&f=xml'
result = open(url)
doc = REXML::Document.new(... |
class Stars
MAX_NUM = 100
MAX_GUESSES = 7
def start
print "Do you want instructions? (Y/N) "
response = gets.chomp!
if response.upcase[0] == "Y"
print_instructions()
end
still_playing = true
while still_playing
secret_number = rand(1..MAX_NUM)
puts "\n\nOK, I am thinki... |
class StoreController < ApplicationController
before_action :authenticate_user!, only: [:edit, :update]
load_and_authorize_resource :product, parent: false
skip_load_resource :product, only: :show_by_category
def index
@products = Product.includes(:prices).page params[:page]
end
def show
@produc... |
require_relative "../challenges/duplicates"
RSpec.describe "Duplicates Method" do
it "should return 0" do
expect(removeDuplicates("abcde")).to eq 0
end
it "should return 2" do
expect(removeDuplicates("aabbcde")).to eq 2
end
it "Should return 1" do
expect(removeDuplicates("indivisibility")).to e... |
=begin
My Transpose
To represent a matrix, or two-dimensional grid of numbers, we can write an array containing arrays which represent rows:
rows = [
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
row1 = rows[0]
row2 = rows[1]
row3 = rows[2]
We could equivalently have stored the matrix as an array of columns:
cols... |
class RemoveColumnAuthUrlOnFeeds < ActiveRecord::Migration[5.2]
def change
remove_column :feeds, :auth_url, :string
end
end
|
class CustomersPage < SitePrism::Page
set_url '/customers'
section :nav, Sections::NavBar, '#navbar'
element :insert_button, 'button[id=dataview-insert-button]'
element :search_field, 'input[id=dataview-search-input]'
element :search_button, 'button[id=dataview-search-button]'
element :na... |
require 'spec_helper'
describe User, 'password' do
subject(:user) { create(:user, :paul) }
it 'cleans password after saving user' do
user.save!
expect(user.password).to be_nil
end
it 'cleans password confirmation after saving user' do
user.save!
expect(user.password_confirmation).to be_nil
... |
months = 12
year = 2007
x=10
puts x.class
puts x.kind_of? Integer # => true
puts x.to_f
#Variable instanciada, se debe poner un @
hello="hola"
@hello = hello
puts @hello
#Variables de classes se escriben con @@
#@@times = 0
#Variables locales se escriben con un $ al principio
puts $amount = "0.00"
#Constantes
Ma... |
#
# Cookbook Name:: veeam
# Recipe:: prerequisites
#
# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved.
error_message = 'This recipe requires a Windows 2012 or higher host!'
# If this host is not Windows, then abort
raise ArgumentError, error_message unless node['platform'] == 'windows'
# If this host is ... |
class BikeWorkout < Workout
belongs_to :user
validates_numericality_of :distance, :avg_rpms
def calbikepace
tot_minutes = self.getworkouttotalminutes
base = (tot_minutes.to_f / 60.to_f).to_f.round(2)
pace = (self.distance.to_f / base).round(2)
end
end |
require_relative 'subs'
module AsciidoctorGrammar
# Text
class Text < ::Treetop::Runtime::SyntaxNode
def node_name
'text'
end
end
class Sentence < ::Treetop::Runtime::SyntaxNode
end
# Expression
class Expression < ::Treetop::Runtime::SyntaxNode
def node_name
'inline'
end
e... |
require 'test_helper'
class UserTest < ActiveSupport::TestCase
test "users should have a name and an email" do
u = User.new(username: nil, email: nil)
u.valid?
assert u.errors[:username].any?, "users need a username"
assert u.errors[:email].any?, "users need an email"
u.username = "a-valid-user... |
require 'spec_helper'
describe "StaticPages" do
subject { page }
describe "Home page" do
before { visit root_path }
it { should have_selector('h1', text: 'Calendaring Application') }
it { should have_selector('title', text: 'GrebeCalendarApp') }
it { should have_link('Sign... |
require "test_helper"
class FakeAdapterTest < ActiveSupport::TestCase
include PaymentGatewayContractTest
test "running a hook before the first charge" do
payment_gateway = PaymentGateway::FakeAdapter.new
callback_ran_count = 0
payment_gateway.before_charge_callback = proc {
callback_ran_count +... |
require 'acts_as_graph_vertex'
require 'call_me_ruby'
require 'shanty/config_mixin'
require 'shanty/logger'
module Shanty
# Public: Represents a project in the current repository.
class Project
include ActsAsGraphVertex
include ConfigMixin
include Logger
attr_accessor :path, :env, :name, :artifact... |
# Author:: Joel Friedman and Patrick Farley
#
# This module is used to simplify concurrency
# in your application. JVM threads and JRetlang are
# used to provide Actor model style asynchronous
# message passing via method calls. Named channel based
# message passing is also supported via +register_channel+ and
# the <... |
class ArticlesController < ApplicationController
before_action :set_article, only: [:show, :edit, :update, :destroy]
include Pagy::Backend
# GET /articles
# GET /articles.json
def index
authorize Article
@q = Article.ransack(params[:q])
@all_articles = @q.result
@pagy, @articles = pagy(@all_... |
###########################################################################
##
## stream_consumer
##
## Multi-threaded HTTP stream consumer, with asynchronous spooling
## and multi-threaded production.
##
## David Tompkins -- 05/30/2013
## tompkins@adobe_dot_com
##
######################################################... |
require "fog/core/model"
module Fog
module Compute
class Brkt
class BaseListener < Fog::Model
identity :id
attribute :instance_protocol
attribute :instance_port, :type => :integer
attribute :listener_protocol
attribute :listener_port, :type => :integer
attri... |
FactoryBot.define do
factory :user do
sequence(:name) { |n| "user_#{n}" }
sequence(:line_id) { |n| "line_id#{n}" }
end
end
|
class AddParticipateToInformation < ActiveRecord::Migration
def change
add_column :information, :participate, :boolean
add_reference :information, :user, :default => 1, index: true
end
end
|
def valid_number?(number_string)
number_string.to_i.to_s == number_string && number_string.to_i != 0
end
loop do
puts ">> Please enter a positive or negative integer: "
numerator = gets.chomp
puts ">> Please enter a positive or negative integer: "
denominator = gets.chomp
if denominator == '0'
puts ">> Inva... |
require 'test_helper'
class GoodsControllerTest < ActionDispatch::IntegrationTest
def setup
@user = users(:mysize1)
@kickspost = kicksposts(:orange)
@comment = comments(:apple)
end
test "should redirect create when no logged in" do
assert_no_difference 'Good.count' do
post goods_path
... |
require 'rails_helper'
RSpec.describe Address, type: :model do
it{ should validate_presence_of :addressable }
it{ should ensure_inclusion_of( :state ).in_array( Address::STATES.keys ) }
it{ should normalize_attribute( :title ).from(' the CRAZY address Title ').to('The Crazy Address Title') }
it{ should ... |
require 'game'
describe Game do
let(:player1) { double :player }
let(:player2) { double :player }
subject(:game) { described_class.new(player1, player2) }
it 'attack should call receive damage on player passed in as argument' do
expect(player2).to receive(:receive_damage)
game.attack(player2)
end
... |
class AddOomycetesDiameterToSamples < ActiveRecord::Migration[5.0]
def change
add_column :samples, :oomycetes_diameter, :integer
end
end
|
class Api::V1::FollowersController < ApplicationController
def index
follows = FollowJoin.all
render json: follows
end
def create
follow = FollowJoin.create!(followJoinParams)
render json: follow
end
def destroy
followJoin = FollowJoin.fi... |
class AddAddressToWithdrwals < ActiveRecord::Migration[5.0]
def change
add_column :withdrawals,:address, :string
end
end
|
# frozen_string_literal: true
class Scripture < ApplicationRecord
extend FriendlyId
friendly_id :name, use: :slugged
has_many :connection_scriptures, class_name: 'Resource::Connection::Scripture', dependent: :destroy
has_many :resources, through: :connection_scriptures
validates :name, presence: true, uniq... |
# index.rss.builder
xml.instruct! :xml, :version => "1.0"
xml.rss :version => "2.0" do
xml.channel do
xml.title @video.name
xml.description @video.description
xml.link("http://" + request.env["HTTP_HOST"] + formatted_videos_path(:rss))
xml.author @video.user.login
xml.item do
xml.title @vid... |
require 'spec_helper'
describe Api::V1::OrganizationsController do
render_views
describe "#index" do
let(:resource_list) { FactoryGirl.create_list :organization, 3 }
let(:action) { get :index }
requires_authorization :agent, :admin
returns_resource_list_in_json_payload
returns_http_stat... |
class NewChatMailer < ApplicationMailer
def new_chat(user)
@user = user
mail(to: @user.email, subject: "Hey #{user.name} you have new Chat in Chat Engine")
end
end
|
class ListingsController < ApplicationController
def index
@listings=Listing.all
end
def show
@listing=Listing.find(params[:id])
end
def new
@listing=Listing.new
end
def create
@listing=Listing.create(list_params)
if @listing.save
flash[:notice]="Listing has been created"
else
flash[:no... |
class CreateChars < ActiveRecord::Migration[5.2]
def change
create_table :chars do |t|
t.string :user
t.string :charname
t.integer :power
t.integer :dex
t.integer :wiz
t.integer :hp
t.string :uniname
t.string :charimg
t.references :post, foreign_key: true
... |
class ServiceCombination
def initialize(params)
@start_day = Date.parse(params[:start_date])
@end_day = Date.parse(params[:end_date])
end
def calculate
Order.new do |order|
order.start_date = @start_day
order.end_date = @end_day
order.days_amount = order_days_amount
order.ord... |
class AddStatusToApplicationAndJob < ActiveRecord::Migration[5.1]
def change
add_column :jobs, :status, :string, default: 'open'
add_column :applications, :status, :string, default: 'pending'
end
end
|
require_relative 'demo_app_page'
class ArticlePage < DemoAppPage
path '/articles{/id}'
validate :url, %r{/articles/\d+/?\z}
element :comment_field, :fillable_field, 'comment_body'
element :add_comment_button, :button, 'Create comment'
element :commenter_name, :xpath, ".//p[contains(.,'Commenter:')]"
elemen... |
require 'time'
require 'securerandom'
require 'uri'
require 'rest_client'
require 'base64'
require 'openssl'
require 'json'
module Aliyun
class ECS
def initialize(options={})
Aliyun[:access_key_id] = options[:access_key_id] || Aliyun[:access_key_id] || ENV['ALIYUN_ACCESS_KEY_ID']
A... |
class Admin::ReviewsController < Admin::AdminController
before_filter :lookup_review, only: [:edit, :show, :update, :destroy]
def index
end
def new
@candidate = Candidate.find(params[:candidate_id])
@review = Review.new
@reviewer = current_user.reviewer
end
def create
@candidate = Candida... |
namespace :passenger do
desc "Install the latest release of passenger"
task :install do
on roles(:app) do
repo = 'deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main'
# add keys
execute :sudo, "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7"
execute :s... |
require "csv"
require "pry"
def parse_args
if ARGV.count < 2
puts """
Usage: zooniverse_upload_pdf.rb SUBJECT_SET_ID PDF_FILE
This script uploads a PDF document to Zooniverse. PDFs are not natively supported,
so this script breaks the PDF up into JPEG images and uploads those.
""".strip
exit 1
e... |
#!/user/bin/env rake
require 'rake/clean'
require 'fileutils'
# PROJECT_ROOT = File.dirname(File.expand_path(__FILE__))
task :compile do
FileUtils.remove_dir('src', true)
Dir::mkdir('src')
files_to_merge = [
'lib/initialize.js',
'lib/logging.js',
'lib/generate_hash_code.js',
'lib/cache.js',
... |
class UsersController < ApplicationController
def show
@user = User.find(params[:id])
@posts = @user.posts
likes = Like.where(user_id: current_user.id).pluck(:post_id)
@like_list = Post.find(likes)
end
end
|
# frozen_string_literal: true
require 'time'
# Merchant class
class Merchant
attr_reader :id,
:created_at
attr_accessor :name,
:updated_at
def initialize(params)
@id = params[:id].to_i
@name = params[:name]
params[:created_at] = Time.now if params[:c... |
class CategoriesController < ApplicationController
before_action :require_login
def show
@category = Category.find(params[:id])
end
end |
class SpotsController < ApplicationController
before_action :authenticate_user!, only: [:new, :create, :edit, :update, :destroy]
def index
@spots = Spot.all.paginate(page: params[:page], per_page: 3)
end
def new
@spot = Spot.new
end
def create
@spot = current_user.spots.create(spot_params)
if ... |
FactoryBot.define do
factory :whitelist do
name { "My Whitelist" }
end
end
|
require_relative 'player'
require_relative 'board'
# Represents a game of Tic Tac Toe
class Game
attr_reader :board
def initialize
@player_one = Player.new('Player 1', 'X')
@player_two = Player.new('Player 2', 'O')
@board = Board.new
@restart = false
end
# Allows the users to play/restart the... |
class AuthenticationsController < ApplicationController
skip_before_action :authenticate_request
def authenticate
@token = authenticate_user(auth_params[:attributes][:email], auth_params[:attributes][:password])
if !@token.nil?
render json: { auth_token: @token }, status: 200
else
render js... |
# Your code goes here!
class Anagram
attr_accessor :word
def initialize(word)
@word = word
end
def match(anagrams)
match = []
i = 0
split = []
split = @word.split("")
anagrams.each do |item|
if (item.split("").sort == split.sort)
match[i] = item
i+=1
... |
class Walmart_You_Just_Added < AppBase
def await(opts = nil)
# wait until product details page is loaded
Watir::Wait.until {$browser.div(:class => "Modal-outer js-pac-modal").exist? }
Watir::Wait.until {$browser.h3(:class => "m-margin-ends").text.include? "You just added" }
sleep(2)
self
end
... |
Rails.application.routes.draw do
resources :rooms, except: [:show]
root to: "rooms#index"
end
|
require 'thomas'
require_relative 'dangerous'
class DangerousThrower < Thomas::Thing
def initialize(seconds_per_throw = 1, max_speed=1)
super([[Thomas::Space.new('')]])
@elapsed_since_last_throw = 0
@seconds_per_throw = seconds_per_throw
@max_speed = max_speed
@tickable = true
end
def handle... |
Kaavi::Application.routes.draw do
resources :significados
resources :palabras do
resources :variantes, only: [:index, :new, :create]
end
root :to => 'palabras#index'
end
|
class User < ActiveRecord::Base
has_many :comments
has_many :locations
has_secure_password
#restricts users from attemting signup without completing the form
#password is validated thru "has_secure_password"
validates :handle, :email, presence: true
#restricts users from signing up with an e... |
require 'bcrypt'
class User < ActiveRecord::Base
attr_accessible :email, :name, :password
has_many :chirps
validates :email, :presence => true, :uniqueness => true
validates :password, :presence => true
validates :name, :presence => true, :length => {:minimum => 4}
# Helps encrypt new password
def sel... |
require 'spec_helper'
describe Buckaroo::Ideal::Config do
before do
Buckaroo::Ideal::Config.configure(
:merchant_key => 'merchant_key',
:secret_key => 'secret_key',
:test_mode => true,
:success_url => 'http://example.com/transaction/success',
:reject_url => 'h... |
class Factura < ActiveRecord::Base
has_many :linea_facturas, dependent: :destroy
end
|
require 'spec_helper'
describe User do
before(:each) do
@attr = { :username => "fake_username", :password => "1234", :password_confirmation => "1234" }
end
it "should create a new instance given valid attributes" do
User.create!(@attr)
end
it "should have a username" do
no_username_user = User... |
class TreesController < ApplicationController
before_action :set_tree, only: [:show, :edit, :update, :destroy]
before_filter :require_user
# GET /trees
# GET /trees.json
def index
store_listing_referer
@trees = Tree.all.order( "common_name" )
end
# GET /trees/1
# GET /trees/1.json
def show
... |
module Antlr4::Runtime
class ATNType
LEXER = 0
PARSER = 1
VALUES = [LEXER, PARSER]
end
end |
# frozen_string_literal: true
require 'test_helper'
class ViewLayersControllerTest < ActionDispatch::IntegrationTest
setup do
@workspace = workspaces(:one)
@view_layer = view_layers(:one)
@view = @view_layer.view
end
test "should get index" do
get workspace_view_view_layers_url(@workspace, @vie... |
require "swow/client/realm"
require "swow/client/character"
require "swow/client/data"
require "swow/client/auction"
require "swow/client/item"
require "swow/client/guild"
require "swow/client/mount"
module Swow
class Client
include Swow::Constants
include Swow::Client::Realm
include Swow::Client::Char... |
class BookerManageController < ApplicationController
layout 'booker_manage'
before_action :get_booker, :only => [:index, :booking_record, :feedback]
def index
@page_title ='DingBa 訂吧 訂位者訂位管理'
@books = BookerManage.get_books(@booker.id)
end
def booking_record
@books = BookerManage.get_books(@book... |
class TopicsController < ApplicationController
def show
@topic = Topic.find(params[:id])
end
def new
@board = Board.find(params[:board_id])
end
def create
topic = Board.find(params[:board_id]).topics.new(topic_params)
topic.user_id = current_user.id
if topic.save
redirect_to topi... |
# frozen_string_literal: true
require "spec_helper"
module Decidim
module Opinions
module Admin
describe ValuationAssignmentForm do
subject { form }
let(:organization) { component.participatory_space.organization }
let(:opinions) { create_list(:opinion, 2, component: component) }
... |
class ResourceType < ApplicationRecord
has_many :collection_resource_type_joins, dependent: :destroy
has_many :collections, through: :collection_resource_type_joins
validates :name, presence: true
end |
class Thing
# -------------------------------------------------------------------
# Instance Thing
# -------------------------------------------------------------------
attr_reader :parent, :sparent, :ptype, :pid, :sptype, :spid
@id = nil # Identifiant unique de la Thing. Utiliser la méthode
... |
Rails.application.routes.draw do
devise_for :users, :controllers => {:registrations => "registrations", :omniauth_callbacks => "callbacks"}
root to: 'application#home'
devise_scope :user do
get 'login', to: 'devise/sessions#new'
get 'signup', to: 'devise/registrations#new'
end
resources :restaur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.