source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
roar-rails.gemspec
Ruby
mit
234
master
1,507
# -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) require "roar/rails/version" Gem::Specification.new do |s| s.name = "roar-rails" s.version = Roar::Rails::VERSION s.authors = ["Nick Sutterer"] s.email = ["apotonick@gmail.com"] s.homepage = "https://github.com/apo...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
Gemfile
Ruby
mit
234
master
457
source "http://rubygems.org" # Specify your gem's dependencies in roar-rails.gemspec gemspec group :test do # gem 'roar', path: "../roar" #">= 0.11.17" # gem 'representable', path: "../representable" gem 'rake', '10.1.0' end respond_to?(:install_if) and install_if -> { RUBY_VERSION < '2.2.2' } do gem 'acti...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
lib/roar-rails.rb
Ruby
mit
234
master
1,352
require "roar/rails/version" require "roar/representer" require "roar/decorator" require "roar/rails/railtie" module Roar autoload("XML", "roar/xml") autoload("JSON", "roar/json") module JSON autoload("HAL", "roar/rails/hal") autoload("JSONAPI", "roar/rails/json_api") end autoload("Hypermedia", "ro...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
lib/generators/rails/representer_generator.rb
Ruby
mit
234
master
1,671
module Rails module Generators class RepresenterGenerator < Rails::Generators::NamedBase source_root File.expand_path("../templates", __FILE__) argument :properties, :type => :array, :default => [], :banner => "property[:class[:extend]] property[:class[:extend]]" class_option :format, ...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
lib/roar/rails/responder.rb
Ruby
mit
234
master
2,360
module Roar module Rails class Responder < ActionController::Responder def display(model, *args) if represent_format? handle_lonely_collection!(model) and return super # :represent_items_with model = prepare_model_for(format, model, options) end super(create_res...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
lib/roar/rails/rails5_0_strategy.rb
Ruby
mit
234
master
347
require 'action_controller/responder' module Roar::Rails class Responder < ActionController::Responder module VersionStrategy end end module TestCase module VersionStrategy def process_args(action, http_method, document="", params={}) [action, { method: http_method, params: params }] ...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
lib/roar/rails/test_case.rb
Ruby
mit
234
master
1,303
require 'minitest' module Roar module Rails module TestCase include TestXml::Assertions # FIXME: including from test_xml in MiniTest::Test doesn't work with rails 4. def get(action, *args) process(action, "GET", *args) end def post(action, *args) process(action, "POST", ...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
lib/roar/rails/formats.rb
Ruby
mit
234
master
2,151
module Roar::Rails class Formats < Hash def add(format, opts) # FIXME: use controller_path here as well! # by pre-computing the representer name we allow "one-step inheritance": if B doesn't call ::represents it "inherits" A's settings. unless opts.is_a?(Hash) model_name = opts.name.unde...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
lib/roar/rails/json_api.rb
Ruby
mit
234
master
243
require 'roar/json/json_api' # FIXME: Hack. Add another module to Roar JSON API to hook into. Roar::JSON::JSONAPI::Document.class_eval do def to_json_api(*args); to_json(*args); end def from_json_api(*args); from_json(*args); end end
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
lib/roar/rails/rails3_1_strategy.rb
Ruby
mit
234
master
298
module Roar::Rails class Responder < ActionController::Responder module VersionStrategy end end module TestCase module VersionStrategy def process_args(action, http_method, document="", params={}) [action, params, nil, nil, http_method] end end end end
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
lib/roar/rails/controller_additions.rb
Ruby
mit
234
master
2,648
require 'responders' require 'uber/inheritable_attr' require 'roar/rails/responder' require 'roar/rails/formats' module Roar::Rails module ControllerAdditions extend ActiveSupport::Concern included do extend Uber::InheritableAttr inheritable_attr :represents_options self.represents_options...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
lib/roar/rails/railtie.rb
Ruby
mit
234
master
819
require "rails/railtie" require "roar/rails/url_methods" module Roar module Rails class Railtie < ::Rails::Railtie config.representer = ActiveSupport::OrderedOptions.new rescue_responses = config.action_dispatch.rescue_responses || ActionDispatch::ShowExceptions.rescue_responses #newer or fallback t...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
lib/roar/rails/rails3_0_strategy.rb
Ruby
mit
234
master
631
module Roar::Rails class Responder < ActionController::Responder module VersionStrategy def prepare_model_for(format, model, *args) # rails <= 3.1 compatibility. #display gets called for empty responses # >= 3.2 fixes by calling #head, not #display for all empty bodies (PUT, DELETE) ...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
lib/roar/rails/validations_representer.rb
Ruby
mit
234
master
656
require 'representable/json/collection' require 'representable/json/hash' # Represents a validators hash for a model. module ValidatorsRepresenter class ValidatorClient attr_accessor :kind, :options end # Represents a single Validator instance. module ValidatorRepresenter include Roar::JSON proper...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
lib/roar/rails/rails4_2_strategy.rb
Ruby
mit
234
master
211
require 'action_controller/responder' module Roar::Rails class Responder < ActionController::Responder module VersionStrategy end end module TestCase module VersionStrategy end end end
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/json_hal_renderer_test.rb
Ruby
mit
234
master
898
require 'test_helper' class HalRendererTest < ActionController::TestCase include Roar::Rails::TestCase class SingersController < ActionController::Base module HalSingerRepresenter include Roar::JSON::HAL property :name link(:self) { "http://#{name}" } end include Roar::Rails::Contr...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/responder_test.rb
Ruby
mit
234
master
12,013
require 'test_helper' module SingersRepresenter include Roar::JSON collection :singers, :extend => SingerRepresenter def singers each end end class ResponderTest < ActionController::TestCase include Roar::Rails::TestCase class BaseController < ActionController::Base include Roar::Rails::Control...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/json_api_renderer_test.rb
Ruby
mit
234
master
1,947
require 'test_helper' class JsonApiRendererTest < ActionController::TestCase include Roar::Rails::TestCase Band = Struct.new(:name, :id) Singer = Struct.new(:name, :id) Musician = Struct.new(:name, :id) class SingersController < ActionController::Base class SingerRepresenter < Roar::Decorator ...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/formats_test.rb
Ruby
mit
234
master
4,032
require 'test_helper' module ObjectRepresenter end module ObjectsRepresenter end module V1 module SingerRepresenter end module BassistRepresenter end module SingersRepresenter end end class Bassist end class FormatsTest < MiniTest::Spec let (:subject) { Roar::Rails::Formats.new } describe "nothing ...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/representer_test.rb
Ruby
mit
234
master
1,161
require 'test_helper' class RepresenterTest < ActionController::TestCase include Roar::Rails::TestCase tests SingersController test "representers can use URL helpers" do get :show, :id => "bumi" assert_body "{\"name\":\"Bumi\",\"links\":[{\"rel\":\"self\",\"href\":\"http://roar.apotomo.de/singers/Bumi\...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/test_case_test.rb
Ruby
mit
234
master
1,375
require 'test_helper' class TestCaseTest < ActionController::TestCase include Roar::Rails::TestCase class BandController < ActionController::Base def show render :text => "#{request.body.string}#{params[:id]}" end end tests BandController test "allows POST without body" do post :show ...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/validations_test.rb
Ruby
mit
234
master
1,298
require 'test_helper' require 'active_model' require 'roar/rails/validations_representer' class ValidationsTest < MiniTest::Spec class Comment include ActiveModel::Validations validates :name, :presence => true end describe "ValidatorRepresenter" do it "renders a representation in #to_json" do ...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/representer_generator_test.rb
Ruby
mit
234
master
1,817
require 'test_helper' require 'rails/generators' require 'generators/rails/representer_generator' class RepresentetGeneratorTest < Rails::Generators::TestCase destination File.join(Rails.root, "tmp") setup :prepare_destination tests Rails::Generators::RepresenterGenerator test "create a representer with corr...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/consume_test.rb
Ruby
mit
234
master
5,995
require 'test_helper' class UnnamespaceSingersController < ActionController::Base include Roar::Rails::ControllerAdditions respond_to :json, :xml def consume_json singer = consume!(Singer.new) render :text => singer.inspect end end class ConsumeTest < ActionController::TestCase include Roar::Rails:...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/test_helper.rb
Ruby
mit
234
master
726
ENV['RAILS_ENV'] = 'test' require "dummy/config/environment" require "rails/test_help" # adds stuff like @routes, etc. require 'minitest/rails' require 'test_xml/mini_test' require "roar/rails/test_case" Singer = Struct.new(:name) # Rails.backtrace_cleaner.remove_silencers! Mime::Type.register 'application/hal+json...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/render_test.rb
Ruby
mit
234
master
1,236
require 'test_helper' class RenderTest < ActionController::TestCase include Roar::Rails::TestCase class SingersController < ActionController::Base module SingerRepresenter include Roar::JSON property :name, :as => :title end module SingersRepresenter include Representable::JSON::Co...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/dummy/app/controllers/bands_controller.rb
Ruby
mit
234
master
200
Band = Struct.new(:name) class BandsController < ActionController::Base include Roar::Rails::ControllerAdditions represents :json, Band def show respond_with Band.new("Bodyjar") end end
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/dummy/config/routes.rb
Ruby
mit
234
master
266
Dummy::Application.routes.draw do get ':controller(/:action(/:id(.:format)))' post ':controller(/:action(/:id(.:format)))' put ':controller(/:action(/:id(.:format)))' delete ':controller(/:action(/:id(.:format)))' resources :singers resources :bands end
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/dummy/config/application.rb
Ruby
mit
234
master
461
require File.expand_path('../boot', __FILE__) require "action_controller/railtie" require "action_view/railtie" require "active_record/railtie" Bundler.require module Dummy class Application < Rails::Application config.encoding = "utf-8" # Configure sensitive parameters which will be filtered from the lo...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/dummy/config/environments/test.rb
Ruby
mit
234
master
1,609
Dummy::Application.configure do # Settings specified here will take precedence over those in config/environment.rb # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test su...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/dummy/config/environments/production.rb
Ruby
mit
234
master
1,654
Dummy::Application.configure do # Settings specified here will take precedence over those in config/environment.rb # The production environment is meant for finished, "live" apps. # Code is not reloaded between requests config.cache_classes = true # Full error reports are disabled and caching is turned on ...
github
trailblazer/roar-rails
https://github.com/trailblazer/roar-rails
test/dummy/config/environments/development.rb
Ruby
mit
234
master
680
Dummy::Application.configure do # Settings specified here will take precedence over those in config/environment.rb # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the webserv...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
Rakefile
Ruby
mit
234
main
416
# Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) CfpApp::Application.load_tasks # A monkey-patch for annotate 2.6.5 task :monkey_patch_annotate do ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
Gemfile
Ruby
mit
234
main
1,226
# frozen_string_literal: true source 'https://rubygems.org' ruby file: '.ruby-version' gem 'puma' gem 'rails', '~> 8.1.3' gem 'turbo-rails' gem 'solid_queue' gem 'rexml' gem 'propshaft' gem 'jsbundling-rails' gem 'cssbundling-rails' gem 'honeybadger', '~> 6.5' gem 'csv' gem 'pg' gem 'haml-rails' gem 'devise',...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
Guardfile
Ruby
mit
234
main
1,465
# A sample Guardfile # More info at https://github.com/guard/guard#readme guard :rspec, cmd: 'bin/rspec' do watch(%r{^spec/.+_spec\.rb$}) watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } watch('spec/spec_helper.rb') { "spec" } # Rails example watch(%r{^app/(.+)\.rb$}) ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/seeds.rb
Ruby
mit
234
main
25,658
def run perform_deliveries_orig = ActionMailer::Base.perform_deliveries begin # Disable sending emails during seeding. ActionMailer::Base.perform_deliveries = false puts "Mail delivery disabled" if perform_deliveries_orig puts "Creating seed data..." create_seed_data puts "Seeding complete...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/schema.rb
Ruby
mit
234
main
21,403
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # This file is the source Rails uses to define your schema when running `bin/rai...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20130922231603_create_invitations.rb
Ruby
mit
234
main
433
class CreateInvitations < ActiveRecord::Migration[5.1] def change create_table :invitations do |t| t.references :proposal, index: true t.references :user, index: true t.string :email t.string :state, default: 'pending' t.string :slug t.timestamps null: true end add_in...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20130920231655_create_speakers.rb
Ruby
mit
234
main
412
class CreateSpeakers < ActiveRecord::Migration[5.1] def change create_table :speakers do |t| t.references :user, index: true t.references :event, index: true t.references :proposal, index: true t.references :program_session, index: true t.string :speaker_name t.string :speaker_...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20220512134224_add_caching_fields_to_websites.rb
Ruby
mit
234
main
208
class AddCachingFieldsToWebsites < ActiveRecord::Migration[6.1] def change add_column :websites, :caching, :string, default: 'off', null: false add_column :websites, :purged_at, :datetime end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20220507081350_create_website_contents.rb
Ruby
mit
234
main
276
class CreateWebsiteContents < ActiveRecord::Migration[6.1] def change create_table :website_contents do |t| t.text :html t.string :placement, default: "head", null: false t.string :name t.belongs_to :website t.timestamps end end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20220427194236_add_header_footer_flags_to_pages.rb
Ruby
mit
234
main
238
class AddHeaderFooterFlagsToPages < ActiveRecord::Migration[6.1] def change add_column :pages, :hide_header, :boolean, default: false, null: false add_column :pages, :hide_footer, :boolean, default: false, null: false end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20130920225539_create_users.rb
Ruby
mit
234
main
1,231
class CreateUsers < ActiveRecord::Migration[5.1] def change create_table :users do |t| t.string :name t.string :email, null: false, default: "" t.text :bio t.boolean :admin, default: false ## Omniauth Single Service Authentication t.string :provider t.string :uid ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20260106000001_create_solid_queue_tables.rb
Ruby
mit
234
main
6,541
class CreateSolidQueueTables < ActiveRecord::Migration[7.1] def change create_table "solid_queue_blocked_executions", force: :cascade do |t| t.bigint "job_id", null: false t.string "queue_name", null: false t.integer "priority", default: 0, null: false t.string "concurrency_key", null: fal...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20220504213512_add_navigation_links_to_websites.rb
Ruby
mit
234
main
333
class AddNavigationLinksToWebsites < ActiveRecord::Migration[6.1] def change add_column :websites, :navigation_links, :string, array: true, default: [] change_column :websites, :footer_categories, :string, array: true, default: [] remove_column :pages, :hide_navigation, :boolean, default: false, null: fal...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20200223215131_create_versions.rb
Ruby
mit
234
main
1,514
# This migration creates the `versions` table, the only schema PT requires. # All other migrations PT provides are optional. class CreateVersions < ActiveRecord::Migration[5.2] # The largest text column available in all supported RDBMS is # 1024^3 - 1 bytes, roughly one gibibyte. We specify a size # so that MyS...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20130920230737_create_ratings.rb
Ruby
mit
234
main
249
class CreateRatings < ActiveRecord::Migration[5.1] def change create_table :ratings do |t| t.references :proposal, index: true t.references :user, index: true t.integer :score t.timestamps null: true end end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20220503085207_add_hiding_fields_to_pages.rb
Ruby
mit
234
main
235
class AddHidingFieldsToPages < ActiveRecord::Migration[6.1] def change add_column :pages, :hide_page, :boolean, default: false, null: false add_column :pages, :hide_navigation, :boolean, default: false, null: false end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20220428160329_add_detail_fields_to_websites.rb
Ruby
mit
234
main
320
class AddDetailFieldsToWebsites < ActiveRecord::Migration[6.1] def change add_column :websites, :city, :string add_column :websites, :location, :text add_column :websites, :prospectus_link, :string add_column :websites, :twitter_handle, :string add_column :websites, :directions, :string end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20210524020710_add_demographics_to_speakers.rb
Ruby
mit
234
main
279
class AddDemographicsToSpeakers < ActiveRecord::Migration[6.0] def change add_column :speakers, :age_range, :string add_column :speakers, :ethnicity, :string add_column :speakers, :first_time_speaker, :boolean add_column :speakers, :pronouns, :string end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20140131170125_create_rooms.rb
Ruby
mit
234
main
333
class CreateRooms < ActiveRecord::Migration[5.1] def change create_table :rooms do |t| t.references :event, index: true t.string :name t.string :room_number t.string :level t.string :address t.integer :capacity t.integer :grid_position t.timestamps null: true e...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20220413201907_create_sponsors.rb
Ruby
mit
234
main
300
class CreateSponsors < ActiveRecord::Migration[6.1] def change create_table :sponsors do |t| t.belongs_to :event, foreign_key: true t.string :name t.string :tier t.boolean :published t.string :url t.string :other_title t.timestamps end end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20220508071747_create_website_meta_data.rb
Ruby
mit
234
main
271
class CreateWebsiteMetaData < ActiveRecord::Migration[6.1] def change create_table :website_meta_data do |t| t.string :title t.string :author t.text :description t.belongs_to :website, foreign_key: true t.timestamps end end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20220420063357_add_description_to_sponsor.rb
Ruby
mit
234
main
272
class AddDescriptionToSponsor < ActiveRecord::Migration[6.1] def change add_column :sponsors, :description, :text add_column :sponsors, :offer_headline, :string add_column :sponsors, :offer_text, :text add_column :sponsors, :offer_url, :string end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20130920230159_create_taggings.rb
Ruby
mit
234
main
252
class CreateTaggings < ActiveRecord::Migration[5.1] def change create_table :taggings do |t| t.references :proposal, index: true t.string :tag t.boolean :internal, default: false t.timestamps null: true end end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20130920230819_create_comments.rb
Ruby
mit
234
main
295
class CreateComments < ActiveRecord::Migration[5.1] def change create_table :comments do |t| t.references :proposal, index: true t.references :user, index: true t.integer :parent_id t.text :body t.string :type t.timestamps null: true end end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20130920225910_create_teammates.rb
Ruby
mit
234
main
451
class CreateTeammates < ActiveRecord::Migration[5.1] def change create_table :teammates do |t| t.references :event, index: true t.references :user, index: true t.string :role t.string :email t.string :state t.string :token t.boolean :notifications, default: true t.t...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20160614162404_create_session_formats.rb
Ruby
mit
234
main
361
class CreateSessionFormats < ActiveRecord::Migration[5.1] def change create_table :session_formats do |t| t.references :event, index: true t.string :name t.string :description t.integer :duration t.boolean :public, default: true t.timestamps null: false end add_foreign...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20220506044703_create_table_website_fonts.rb
Ruby
mit
234
main
252
class CreateTableWebsiteFonts < ActiveRecord::Migration[6.1] def change create_table :website_fonts do |t| t.string :name t.boolean :primary t.boolean :secondary t.belongs_to :website t.timestamps end end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20140131174158_create_time_slots.rb
Ruby
mit
234
main
440
class CreateTimeSlots < ActiveRecord::Migration[5.1] def change create_table :time_slots do |t| t.references :program_session, index: true t.references :room, index: true t.references :event, index: true t.integer :conference_day, index: true t.time :start_time t.time :end_time...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20140312163812_create_notifications.rb
Ruby
mit
234
main
275
class CreateNotifications < ActiveRecord::Migration[5.1] def change create_table :notifications do |t| t.references :user, index: true t.string :message t.string :target_path t.timestamp :read_at t.timestamps null: true end end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20160713174249_create_program_sessions.rb
Ruby
mit
234
main
427
class CreateProgramSessions < ActiveRecord::Migration[5.1] def change create_table :program_sessions do |t| t.references :event, index: true t.references :proposal, index: true t.text :title t.text :abstract t.references :track, index: true t.references :session_format, index: ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20220412153740_create_pages.rb
Ruby
mit
234
main
306
class CreatePages < ActiveRecord::Migration[6.1] def change create_table :pages do |t| t.string :name, null: false t.string :slug, null: false t.belongs_to :website, foreign_key: true t.text :published_body t.text :unpublished_body t.timestamps end end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20130920220456_create_events.rb
Ruby
mit
234
main
591
class CreateEvents < ActiveRecord::Migration[5.1] def change create_table :events do |t| t.string :name, :slug t.string :url, :contact_email t.string :state, default: 'draft' t.boolean :archived, default: false t.timestamp :opens_at, :closes_at t.timestamp :start_date, :end_dat...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20180106144145_add_notification_preference_to_teammates.rb
Ruby
mit
234
main
237
class AddNotificationPreferenceToTeammates < ActiveRecord::Migration[5.1] def change add_column :teammates, :notification_preference, :string, default: Teammate::ALL remove_column :teammates, :notifications, :boolean end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20220503152658_create_session_format_configs.rb
Ruby
mit
234
main
336
class CreateSessionFormatConfigs < ActiveRecord::Migration[6.1] def change create_table :session_format_configs do |t| t.belongs_to :website, foreign_key: true t.belongs_to :session_format, foreign_key: true t.integer :position t.string :name t.boolean :display t.timestamps ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20220504045808_add_footer_fields_to_websites.rb
Ruby
mit
234
main
293
class AddFooterFieldsToWebsites < ActiveRecord::Migration[6.1] def change add_column :websites, :footer_about_content, :text add_column :websites, :footer_copyright, :string add_column :websites, :facebook_url, :string add_column :websites, :instagram_url, :string end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20251219061613_create_identities.rb
Ruby
mit
234
main
329
class CreateIdentities < ActiveRecord::Migration[8.1] def change create_table :identities do |t| t.references :user, null: false, foreign_key: true t.string :provider, null: false t.string :uid, null: false t.timestamps end add_index :identities, [:provider, :uid], unique: true ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20200223215132_add_object_changes_to_versions.rb
Ruby
mit
234
main
454
# This migration adds the optional `object_changes` column, in which PaperTrail # will store the `changes` diff for each update event. See the readme for # details. class AddObjectChangesToVersions < ActiveRecord::Migration[5.2] # The largest text column available in all supported RDBMS. # See `create_versions.rb` ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20130920230118_create_proposals.rb
Ruby
mit
234
main
659
class CreateProposals < ActiveRecord::Migration[5.1] def change create_table :proposals do |t| t.references :event, index: true t.string :state, default: 'submitted' t.string :uuid t.string :title t.references :session_format, index: true t.references :track, index: true ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20140131183945_create_tracks.rb
Ruby
mit
234
main
269
class CreateTracks < ActiveRecord::Migration[5.1] def change create_table :tracks do |t| t.references :event, index: true t.string :name t.string :description, limit: 250 t.text :guidelines t.timestamps null: true end end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
db/migrate/20160804194731_create_non_unique_user_indexes.rb
Ruby
mit
234
main
384
class CreateNonUniqueUserIndexes < ActiveRecord::Migration[5.1] def change remove_index :users, :email remove_index :users, :reset_password_token remove_index :users, :confirmation_token remove_index :users, :uid add_index :users, :email add_index :users, :reset_password_token add_index :...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/spec_helper.rb
Ruby
mit
234
main
4,806
# This file was generated by the `rails generate rspec:install` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause # this file to always be loaded, without a need to explicitly require ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/rails_helper.rb
Ruby
mit
234
main
4,740
# This file is copied to spec/ when you run 'rails generate rspec:install' require 'spec_helper' ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' # Prevent database truncation if the environment is production abort("The Rails environment is running in production mode!") if Rails.env.production? # Un...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/controllers/notifications_controller_spec.rb
Ruby
mit
234
main
1,150
require 'rails_helper' describe NotificationsController, type: :controller do let(:user) { create(:user) } before { sign_in(user) } describe "GET 'index'" do it "returns http success" do get 'index' expect(response).to be_successful end it "redirects an unauthenticated user" do si...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/controllers/comments_controller_spec.rb
Ruby
mit
234
main
3,054
require 'rails_helper' describe CommentsController, type: :controller do describe "POST #create" do let(:proposal) { create(:proposal_with_track, uuid: 'abc123') } let(:user) { create(:user) } let(:referer_path) { event_proposal_path(proposal.event, proposal) } let(:mailer) { double("CommentNotificat...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/controllers/proposals_controller_spec.rb
Ruby
mit
234
main
6,222
require 'rails_helper' describe ProposalsController, type: :controller do let(:event) { create(:event) } describe 'GET #new' do let(:user) { create :user } let(:action) { :new } let(:params) do { event_slug: event.slug } end before { sign_in user } context 'user profile is complete...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/controllers/profiles_controller_spec.rb
Ruby
mit
234
main
1,049
require 'rails_helper' describe ProfilesController, type: :controller do describe 'GET #edit' do let(:user) { create :user } let(:action) { :edit } let(:params) { {} } before { sign_in user } context 'user profile is complete' do it 'should succeed' do get :edit expect(res...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/controllers/events_controller_spec.rb
Ruby
mit
234
main
466
require 'rails_helper' describe EventsController, type: :controller do describe 'GET #index' do it 'should succeed' do get :index expect(response.status).to eq(200) end end describe 'GET #show' do let(:proposal) { build(:proposal_with_track) } let(:event) { create(:event, proposals: ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/controllers/teammates_controller_spec.rb
Ruby
mit
234
main
861
require 'rails_helper' describe TeammatesController, type: :controller do let(:invitation) { create(:teammate, :has_been_invited) } describe "GET 'accept'" do let(:user) { create(:user) } before { sign_in(user) } it "creates an accepted teammate for current user" do expect(invitation).to be_pe...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/controllers/admin/events_controller_spec.rb
Ruby
mit
234
main
557
require 'rails_helper' describe Admin::EventsController, type: :controller do describe "GET #index" do render_views it "should succeed" do sign_in(create(:admin)) get :index expect(response.body).to include('<h1>Events Admin</h1>') end end describe "POST #archive" do before :e...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/controllers/staff/rooms_controller_spec.rb
Ruby
mit
234
main
483
require 'rails_helper' describe Staff::RoomsController, type: :controller do let(:event) { create(:event) } before { sign_in(create(:organizer, event: event)) } describe "DELETE 'destroy'" do it "destroys the room with turbo_stream" do room = create(:room, event: event) expect { delete :...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/controllers/staff/tracks_controller_spec.rb
Ruby
mit
234
main
311
require 'rails_helper' describe Staff::TracksController, type: :controller do let(:event) { create(:event) } before { sign_in(create(:organizer, event: event)) } describe "Delete 'destroy'" do it "destroys the track" do pending('Fix once flows are more settled.') fail end end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/controllers/staff/time_slots_controller_spec.rb
Ruby
mit
234
main
1,316
require 'rails_helper' describe Staff::TimeSlotsController, type: :controller do let(:event) { create(:event) } before { sign_in(create(:organizer, event: event)) } describe "DELETE 'destroy'" do it "destroys the time slot" do conf_time_slot = create(:time_slot, event: event) expect { de...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/controllers/staff/ratings_controller_spec.rb
Ruby
mit
234
main
729
require 'rails_helper' describe Staff::RatingsController, type: :controller do let(:proposal) { create(:proposal_with_track) } let(:event) { proposal.event } let(:reviewer) { create(:user, :reviewer) } let!(:speaker) { create(:speaker, proposal: proposal) } before { sign_in(reviewer) } context "reviewer ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/controllers/staff/proposals_controller_spec.rb
Ruby
mit
234
main
3,579
require 'rails_helper' describe Staff::ProposalsController, type: :controller do let(:event) { create(:event) } let(:user) do create(:user, organizer_teammates: [ create(:teammate, role: 'organizer', event: event) ], ) end let(:proposal) { create(:proposal_with_track, eve...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/controllers/users/omniauth_callbacks_controller_spec.rb
Ruby
mit
234
main
4,150
require 'rails_helper' describe Users::OmniauthCallbacksController, type: :controller do before do Rails.application.reload_routes_unless_loaded end let(:twitter_auth_hash) { OmniAuth.config.mock_auth[:twitter] } let(:github_auth_hash) { OmniAuth.config.mock_auth[:github] } describe '#twitter' do l...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/mailers/teammate_invitation_mailer_spec.rb
Ruby
mit
234
main
823
require "rails_helper" describe TeammateInvitationMailer, type: :mailer do describe "create" do let(:invitation) { create(:teammate, :has_been_invited) } let(:mail) { TeammateInvitationMailer.create(invitation) } it "renders the headers" do event = Event.find_by(id: invitation.event_id) e...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/mailers/comment_notification_mailer_spec.rb
Ruby
mit
234
main
4,315
require "rails_helper" describe CommentNotificationMailer do describe "speaker_notification" do let(:proposal) { create(:proposal_with_track, :with_reviewer_public_comment) } let(:reviewer) { create(:user, :reviewer) } let(:comment) { create(:comment, user: reviewer, proposal: proposal) } let(:mail) ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/mailers/staff/proposal_mailer_template_spec.rb
Ruby
mit
234
main
1,519
require "rails_helper" describe Staff::ProposalMailerTemplate do include Rails.application.routes.url_helpers let(:event) { create(:event) } let(:proposal) { create(:proposal_with_track, event: event) } describe "render" do it "passes unknown tags as themselves" do template = "::no_tag:: and ::fake...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/mailers/staff/proposal_mailer_spec.rb
Ruby
mit
234
main
4,867
require "rails_helper" describe Staff::ProposalMailer do let(:event) { create(:event) } let(:speaker) { create(:speaker) } let(:proposal) { create(:proposal_with_track, event: event, speakers: [speaker]) } after(:each) do ActionMailer::Base.deliveries.clear end describe "accept_email" do let(:mai...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/factories/ethnicities.rb
Ruby
mit
234
main
266
FactoryBot.define do factory :ethnicity do name { 'Other' } trait :white do name { 'Non-Hispanic White' } description { "A person having origins in any of the original peoples of Europe, the Middle East, or North Africa." } end end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/factories/program_sessions.rb
Ruby
mit
234
main
846
FactoryBot.define do factory :program_session do sequence(:title) { |i| "Default Session #{i}" } abstract { "Just some abstract" } state { :live } session_format event factory :program_session_with_proposal do proposal { create(:proposal_with_track, state: :accepted, event: event) } ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/factories/events.rb
Ruby
mit
234
main
328
FactoryBot.define do factory :event do sequence(:name) { |i| "Fine Event#{i}" } url { "http://fineevent.com/" } guidelines { "We want all the good talks!" } contact_email { "admin@example.com" } start_date { 25.days.from_now } end_date { 30.days.from_now } closes_at { 3.weeks.from_now } ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/factories/sponsors.rb
Ruby
mit
234
main
790
FactoryBot.define do factory :sponsor do event { Event.first || create(:event) } url { "https://www.fakeurl.com/" } name { Faker::Company.name } published { true } tier { 'platinum' } description { Faker::Hipster.paragraph } primary_logo_path = Rails.root.join('spec/fixtures/files/ruby1.p...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/factories/session_format_configs.rb
Ruby
mit
234
main
304
FactoryBot.define do factory :session_format_config do website { Website.first || FactoryBot.create(:website) } session_format { FactoryBot.create(:session_format) } display { true } name { session_format.name } trait :custom_name do name { "Custom Name" } end end end
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/factories/proposals.rb
Ruby
mit
234
main
1,997
FactoryBot.define do factory :proposal do event sequence(:title) { |i| "A fine proposal#{i}" } abstract { "This and that" } details { "Various other things" } pitch { "Baseball." } session_format { SessionFormat.first || FactoryBot.create(:session_format) } factory :proposal_with_track do...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/factories/speakers.rb
Ruby
mit
234
main
334
FactoryBot.define do sequence :speaker_name do |n| "Speaker Name #{n}" end sequence :speaker_email do |n| "email#{n}@factory.com" end factory :speaker do user event bio { "Speaker bio" } trait :with_name do speaker_name end trait :with_email do speaker_email ...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/factories/websites.rb
Ruby
mit
234
main
571
FactoryBot.define do factory :website do event trait :with_details do city { Faker::Address.city } location { Faker::Address.full_address } prospectus_link { Faker::Internet.url } twitter_handle { Faker::Internet.username } directions { Faker::Internet.url } after :create d...
github
rubycentral/cfp-app
https://github.com/rubycentral/cfp-app
spec/factories/session_formats.rb
Ruby
mit
234
main
774
FactoryBot.define do factory :session_format do event { Event.first || FactoryBot.create(:event) } sequence(:name) { |i| "Session Format#{i}" } description { Faker::Company.catch_phrase } duration { 30 } # add_attribute :public, true public { true } factory :session_format_workshop do ...