repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20130717084037_add_checkout_person_can_override_to_app_configs.rb | db/migrate/20130717084037_add_checkout_person_can_override_to_app_configs.rb | class AddCheckoutPersonCanOverrideToAppConfigs < ActiveRecord::Migration
def change
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20130310101908_remove_overdue_checkout_attriutes_from_app_configs.rb | db/migrate/20130310101908_remove_overdue_checkout_attriutes_from_app_configs.rb | class RemoveOverdueCheckoutAttriutesFromAppConfigs < ActiveRecord::Migration
def up
remove_column :app_configs, :overdue_checkout_email_active
remove_column :app_configs, :overdue_checkout_email_body
end
def down
add_column :app_configs, :overdue_checkout_email_active, :default => true
add_column... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120612164714_equipment_models_associated_equipment_models.rb | db/migrate/20120612164714_equipment_models_associated_equipment_models.rb | class EquipmentModelsAssociatedEquipmentModels < ActiveRecord::Migration
def self.up
create_table :equipment_models_associated_equipment_models, :id => false do |t|
t.references :equipment_model
t.references :associated_equipment_model
end
end
def self.down
drop_table :equipment_models_as... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120724184424_add_description_to_requirements.rb | db/migrate/20120724184424_add_description_to_requirements.rb | class AddDescriptionToRequirements < ActiveRecord::Migration
def change
add_column :requirements, :description, :string
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120626155902_add_app_config_table.rb | db/migrate/20120626155902_add_app_config_table.rb | class AddAppConfigTable < ActiveRecord::Migration
def up
create_table :app_configs do |t|
t.boolean :upcoming_checkin_email_active, :default => true
t.boolean :overdue_checkout_email_active, :default => true
t.boolean :overdue_checkout_email_active, :default => true
t.boolean :res... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150206002111_add_upcoming_checkout_email_active_to_app_config.rb | db/migrate/20150206002111_add_upcoming_checkout_email_active_to_app_config.rb | class AddUpcomingCheckoutEmailActiveToAppConfig < ActiveRecord::Migration
def change
add_column :app_configs, :upcoming_checkout_email_active, :boolean
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20091001234857_create_documents.rb | db/migrate/20091001234857_create_documents.rb | class CreateDocuments < ActiveRecord::Migration
def self.up
create_table :documents do |t|
t.string :name
t.string :data_file_name
t.string :data_content_type
t.integer :data_file_size
t.references :equipment_model
t.timestamps
end
end
def self.down
drop_table :d... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120528214306_create_settings.rb | db/migrate/20120528214306_create_settings.rb | class CreateSettings < ActiveRecord::Migration
def self.up
create_table :settings do |t|
t.string :var, :null => false
t.text :value, :null => true
t.integer :thing_id, :null => true
t.string :thing_type, :limit => 30, :null => true
t.timestamps
end
add_index :settings... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140403011914_add_csv_import_to_equipment_stuff.rb | db/migrate/20140403011914_add_csv_import_to_equipment_stuff.rb | class AddCsvImportToEquipmentStuff < ActiveRecord::Migration
def change
add_column :categories, :csv_import, :boolean, :default => false, :null => false
add_column :equipment_models, :csv_import, :boolean, :default => false, :null => false
add_column :equipment_objects, :csv_import, :boolean, :default => fal... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20141126061515_remove_delete_missed_reservations_from_app_configs.rb | db/migrate/20141126061515_remove_delete_missed_reservations_from_app_configs.rb | class RemoveDeleteMissedReservationsFromAppConfigs < ActiveRecord::Migration
def change
remove_column :app_configs, :delete_missed_reservations
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20090930234012_create_users.rb | db/migrate/20090930234012_create_users.rb | class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :login
t.string :first_name
t.string :last_name
t.string :nickname
t.string :phone
t.string :email
t.string :affiliation
t.boolean :is_banned, :default => false
t.boole... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120705210315_add_email_active_for_app_configs.rb | db/migrate/20120705210315_add_email_active_for_app_configs.rb | class AddEmailActiveForAppConfigs < ActiveRecord::Migration
def up
add_column :app_configs, :overdue_checkin_email_active, :boolean, :default => true
end
def down
remove_column :app_configs, :overdue_checkin_email_active
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140618173229_add_deactivation_reason_to_equipment_objects.rb | db/migrate/20140618173229_add_deactivation_reason_to_equipment_objects.rb | class AddDeactivationReasonToEquipmentObjects < ActiveRecord::Migration
def change
add_column :equipment_objects, :deactivation_reason, :string, default: nil
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20091002184322_create_sessions.rb | db/migrate/20091002184322_create_sessions.rb | class CreateSessions < ActiveRecord::Migration
def self.up
create_table :sessions do |t|
t.string :session_id, :null => false
t.text :data
t.timestamps
end
add_index :sessions, :session_id
add_index :sessions, :updated_at
end
def self.down
drop_table :sessions
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20130327193420_change_deleted_at_to_date_time.rb | db/migrate/20130327193420_change_deleted_at_to_date_time.rb | class ChangeDeletedAtToDateTime < ActiveRecord::Migration
def change
change_column :users, :deleted_at, :datetime
change_column :equipment_objects, :deleted_at, :datetime
change_column :equipment_models, :deleted_at, :datetime
change_column :categories, :deleted_at, :datetime
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120718004311_add_favicon_to_app_configs.rb | db/migrate/20120718004311_add_favicon_to_app_configs.rb | class AddFaviconToAppConfigs < ActiveRecord::Migration
def up
add_attachment :app_configs, :favicon
end
def down
remove_attachment :app_configs, :favicon
end
end | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20130617030854_create_announcements.rb | db/migrate/20130617030854_create_announcements.rb | class CreateAnnouncements < ActiveRecord::Migration
def change
create_table :announcements do |t|
t.text :message
t.datetime :starts_at
t.datetime :ends_at
t.timestamps
end
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20130310095143_add_delete_missed_reservations_to_app_configs.rb | db/migrate/20130310095143_add_delete_missed_reservations_to_app_configs.rb | class AddDeleteMissedReservationsToAppConfigs < ActiveRecord::Migration
def change
add_column :app_configs, :delete_missed_reservations, :boolean, default: true
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20141014041026_add_encrypted_password_to_users.rb | db/migrate/20141014041026_add_encrypted_password_to_users.rb | class AddEncryptedPasswordToUsers < ActiveRecord::Migration
def change
add_column :users, :encrypted_password, :string, :null => false, :default => '', :limit => 128
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150304042433_rename_equipment_objects.rb | db/migrate/20150304042433_rename_equipment_objects.rb | class RenameEquipmentObjects < ActiveRecord::Migration
def change
rename_table :equipment_objects, :equipment_items
rename_column :reservations, :equipment_object_id, :equipment_item_id
rename_column :equipment_models, :equipment_objects_count, :equipment_items_count
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140605230158_create_versions.rb | db/migrate/20140605230158_create_versions.rb | class CreateVersions < ActiveRecord::Migration
def self.up
create_table :versions do |t|
t.string :item_type, :null => false
t.integer :item_id, :null => false
t.string :event, :null => false
t.string :whodunnit
t.text :object
t.datetime :created_at
end
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150323000707_add_overdue_to_reservation.rb | db/migrate/20150323000707_add_overdue_to_reservation.rb | class AddOverdueToReservation < ActiveRecord::Migration
def change
add_column :reservations, :overdue, :boolean, default: false
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140610134345_add_approval_status_column_to_reservations.rb | db/migrate/20140610134345_add_approval_status_column_to_reservations.rb | class AddApprovalStatusColumnToReservations < ActiveRecord::Migration
def change
add_column :reservations, :approval_status, :string, :default => 'auto'
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20141125025619_add_enable_new_users_to_app_configs.rb | db/migrate/20141125025619_add_enable_new_users_to_app_configs.rb | class AddEnableNewUsersToAppConfigs < ActiveRecord::Migration
def change
add_column :app_configs, :enable_new_users, :boolean, default: true
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120627185735_add_settings_to_app_config.rb | db/migrate/20120627185735_add_settings_to_app_config.rb | class AddSettingsToAppConfig < ActiveRecord::Migration
def up
add_column :app_configs, :site_title, :string
add_column :app_configs, :admin_email, :string
add_column :app_configs, :department_name, :string
add_column :app_configs, :contact_link_text, :string
add_column :app_configs, :contact_link_... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20091023172207_add_checkin_and_checkout_procedures_to_equipment_model.rb | db/migrate/20091023172207_add_checkin_and_checkout_procedures_to_equipment_model.rb | class AddCheckinAndCheckoutProceduresToEquipmentModel < ActiveRecord::Migration
def self.up
add_column :equipment_models, :checkout_procedures, :string
add_column :equipment_models, :checkin_procedures, :string
end
def self.down
remove_column :equipment_models, :checkin_procedures
remove_column :... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120619213311_clean_up_check_in_out_procedures.rb | db/migrate/20120619213311_clean_up_check_in_out_procedures.rb | class CleanUpCheckInOutProcedures < ActiveRecord::Migration
def change
remove_column :equipment_models, :checkout_procedures
remove_column :equipment_models, :checkin_procedures
end
end | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20141001000934_add_notes_to_equipment_objects.rb | db/migrate/20141001000934_add_notes_to_equipment_objects.rb | class AddNotesToEquipmentObjects < ActiveRecord::Migration
def change
ActiveRecord::Base.transaction do
add_column :equipment_objects, :notes, :text, limit: 16_777_215, null: false
# store ActiveRecord connection to run queries
conn = ActiveRecord::Base.connection
# go through all equipm... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20191112210445_convert_to_active_storage.rb | db/migrate/20191112210445_convert_to_active_storage.rb | # Migration courtesy of Thoughtbot Migration Guide
# https://github.com/thoughtbot/paperclip/blob/master/MIGRATING.md
class ConvertToActiveStorage < ActiveRecord::Migration[5.2]
require 'open-uri'
def up
# mariadb
get_blob_id = 'LAST_INSERT_ID()'
active_storage_blob_statement = ActiveRecord::Base.con... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20111206171041_add_sort_to_categories.rb | db/migrate/20111206171041_add_sort_to_categories.rb | class AddSortToCategories < ActiveRecord::Migration
def self.up
add_column :categories, :sort_order, :integer
end
def self.down
remove_column :categories, :sort_order
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150719052612_add_late_fee_max_to_equipment_models.rb | db/migrate/20150719052612_add_late_fee_max_to_equipment_models.rb | class AddLateFeeMaxToEquipmentModels < ActiveRecord::Migration
def change
add_column :equipment_models, :late_fee_max, :decimal, precision: 10,
scale: 2, default: 0
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150223001537_add_default_to_upcoming_checkout_email.rb | db/migrate/20150223001537_add_default_to_upcoming_checkout_email.rb | class AddDefaultToUpcomingCheckoutEmail < ActiveRecord::Migration
def change
change_column_default :app_configs, :upcoming_checkout_email_active, true
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150206003233_add_upcoming_checkout_email_body_to_app_config.rb | db/migrate/20150206003233_add_upcoming_checkout_email_body_to_app_config.rb | class AddUpcomingCheckoutEmailBodyToAppConfig < ActiveRecord::Migration
def change
add_column :app_configs, :upcoming_checkout_email_body, :text
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140714135920_add_blackout_expire_time_to_app_configs.rb | db/migrate/20140714135920_add_blackout_expire_time_to_app_configs.rb | class AddBlackoutExpireTimeToAppConfigs < ActiveRecord::Migration
def change
add_column :app_configs, :blackout_exp_time, :integer
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150213001312_change_fields_to_dates.rb | db/migrate/20150213001312_change_fields_to_dates.rb | class ChangeFieldsToDates < ActiveRecord::Migration
def up
# changing all of these columns to :date types
change_column :announcements, :starts_at, :date
change_column :announcements, :ends_at, :date
change_column :reservations, :start_date, :date
change_column :reservations, :due_date, :date
en... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20160311070200_add_autodeactivate_on_archive_to_app_config.rb | db/migrate/20160311070200_add_autodeactivate_on_archive_to_app_config.rb | class AddAutodeactivateOnArchiveToAppConfig < ActiveRecord::Migration[4.2]
def change
add_column :app_configs, :autodeactivate_on_archive, :boolean, default: false
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140916025809_set_default_view_mode_to_normal.rb | db/migrate/20140916025809_set_default_view_mode_to_normal.rb | class SetDefaultViewModeToNormal < ActiveRecord::Migration
def change
change_column :users, :view_mode, :string, :default => 'normal'
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150323003850_add_flags_to_reservation.rb | db/migrate/20150323003850_add_flags_to_reservation.rb | class AddFlagsToReservation < ActiveRecord::Migration
def change
add_column :reservations, :flags, :integer, default: 1
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120711225430_add_tos_accepted_to_user.rb | db/migrate/20120711225430_add_tos_accepted_to_user.rb | class AddTosAcceptedToUser < ActiveRecord::Migration
def self.up
add_column :users, :terms_of_service_accepted, :boolean
end
def self.down
remove_column :users, :terms_of_service_accepted
end
end | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120604201512_add_view_as_attribute.rb | db/migrate/20120604201512_add_view_as_attribute.rb | class AddViewAsAttribute < ActiveRecord::Migration
def self.up
add_column :users, :adminmode, :boolean, :default => true
add_column :users, :checkoutpersonmode, :boolean, :default => false
add_column :users, :normalusermode, :boolean, :default => false
add_column :users, :bannedmode, :boolean, :defaul... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20141012145135_rename_login_to_username_for_users.rb | db/migrate/20141012145135_rename_login_to_username_for_users.rb | class RenameLoginToUsernameForUsers < ActiveRecord::Migration
def change
rename_column :users, :login, :username
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150405012126_remove_approval_status_from_reservation.rb | db/migrate/20150405012126_remove_approval_status_from_reservation.rb | class RemoveApprovalStatusFromReservation < ActiveRecord::Migration
# for use in the flag_res method, based off of Reservation model in v5.5.0
FLAGS = { request: (1 << 1), missed_email_sent: (1 << 5) }
# similarly, based off the Reservation model enums in v5.5.0
STATUSES =
%w(requested reserved denied chec... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20110401155438_change_checkin_checkout_procedures_to_text.rb | db/migrate/20110401155438_change_checkin_checkout_procedures_to_text.rb | class ChangeCheckinCheckoutProceduresToText < ActiveRecord::Migration
def self.up
change_column :equipment_models, :checkin_procedures, :text
change_column :equipment_models, :checkout_procedures, :text
end
def self.down
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20130628154151_remove_view_as_attributes_from_user.rb | db/migrate/20130628154151_remove_view_as_attributes_from_user.rb | class RemoveViewAsAttributesFromUser < ActiveRecord::Migration
def up
User.all.each do |user|
if user.bannedmode
user.view_mode = 'banned'
elsif user.checkoutpersonmode
user.view_mode = 'checkout'
elsif user.normalusermode
user.view_mode = 'normal'
else
user... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150719050013_add_disable_user_emails_to_app_configs.rb | db/migrate/20150719050013_add_disable_user_emails_to_app_configs.rb | class AddDisableUserEmailsToAppConfigs < ActiveRecord::Migration
def change
add_column :app_configs, :disable_user_emails, :boolean, default: false
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
require 'simplecov'
SimpleCov.start
# Rspec should submit the result to CodeClimate automatically with each Travis
# CI build (repo token is encrypted in .travis.yml)
require 'rubygems'
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/jobs/delete_old_blackouts_job_spec.rb | spec/jobs/delete_old_blackouts_job_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe DeleteOldBlackoutsJob, type: :job do
it "doesn't run when the res_exp_time parameter isn't set" do
mock_app_config(blackout_exp_time: nil)
allow(described_class).to receive(:run)
described_class.perform_now
expect(described_class).not_to ha... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/jobs/email_overdue_reminder_job_spec.rb | spec/jobs/email_overdue_reminder_job_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe EmailOverdueReminderJob, type: :job do
it_behaves_like 'email job', { overdue_checkin_email_active?: true }, :overdue
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/jobs/daily_tasks_job_spec.rb | spec/jobs/daily_tasks_job_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe DailyTasksJob, type: :job do
shared_examples 'enqueues' do |job|
it "the #{job}" do
expect(job).to receive(:perform_now)
described_class.perform_now
end
end
JOBS = [FlagOverdueJob, FlagMissedJob, DenyMissedRequestsJob,
Em... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/jobs/flag_overdue_job_spec.rb | spec/jobs/flag_overdue_job_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe FlagOverdueJob, type: :job do
it_behaves_like 'flag job', { overdue: true }, :newly_overdue
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/jobs/hourly_tasks_job_spec.rb | spec/jobs/hourly_tasks_job_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe HourlyTasksJob, type: :job do
it 'enqueues the email notes to admins job' do
expect(EmailNotesToAdminsJob).to receive(:perform_now)
described_class.perform_now
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/jobs/email_notes_to_admins_job_spec.rb | spec/jobs/email_notes_to_admins_job_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe EmailNotesToAdminsJob, type: :job do
def stub_scope_chain(res, *chain)
final = chain.pop
chain.each do |scope|
allow(Reservation).to receive(scope).and_return(Reservation)
end
allow(Reservation).to receive(final).and_return(res)
end... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/jobs/delete_missed_reservations_job_spec.rb | spec/jobs/delete_missed_reservations_job_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe DeleteMissedReservationsJob, type: :job do
it "doesn't run when the res_exp_time parameter isn't set" do
mock_app_config(res_exp_time: nil)
allow(described_class).to receive(:run)
described_class.perform_now
expect(described_class).not_to h... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/jobs/email_checkout_reminder_job_spec.rb | spec/jobs/email_checkout_reminder_job_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe EmailCheckoutReminderJob, type: :job do
it_behaves_like 'email job', { upcoming_checkout_email_active: true },
:upcoming
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/jobs/email_missed_reservations_job_spec.rb | spec/jobs/email_missed_reservations_job_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe EmailMissedReservationsJob, type: :job do
it_behaves_like 'email job',
{ send_notifications_for_deleted_missed_reservations: true },
:missed_not_emailed
it 'sets the missed_email_sent flag' do
mock_app_config(send_... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/jobs/deny_missed_requests_job_spec.rb | spec/jobs/deny_missed_requests_job_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe DenyMissedRequestsJob, type: :job do
it_behaves_like 'email job', {}, :missed_requests
it 'flags missed requests as denied and expired' do
res = ReservationMock.new
allow(Reservation).to receive(:missed_requests).and_return([res])
allow(UserM... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/jobs/email_checkin_reminder_job_spec.rb | spec/jobs/email_checkin_reminder_job_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe EmailCheckinReminderJob, type: :job do
it_behaves_like 'email job', { upcoming_checkin_email_active: true },
:due_today
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/jobs/flag_missed_job_spec.rb | spec/jobs/flag_missed_job_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe FlagMissedJob, type: :job do
it_behaves_like 'flag job', { status: 'missed' }, :newly_missed
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/app_config_helpers.rb | spec/support/app_config_helpers.rb | # frozen_string_literal: true
module AppConfigHelpers
def mock_app_config(**attrs)
ac = spy('AppConfig', require_phone: false, **attrs)
allow(AppConfig).to receive(:first).and_return(ac)
ac
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/chromedriver.rb | spec/support/chromedriver.rb | # frozen_string_literal: true
require 'selenium/webdriver'
Capybara.register_driver :selenium_chrome_headless_docker_friendly do |app|
Capybara::Selenium::Driver.load_selenium
browser_options = ::Selenium::WebDriver::Chrome::Options.new
browser_options.args << '--headless'
browser_options.args << '--disable-g... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/capybara_form_helper.rb | spec/support/capybara_form_helper.rb | # frozen_string_literal: true
## Load code after Capybara
# see http://minimul.com/submitting-a-form-without-a-button-using-capybara.html
module Capybara
module Driver
class Node
def submit_form!
raise NotImplementedError
end
end
end
module RackTest
class Node
def submit_for... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/controller_helpers.rb | spec/support/controller_helpers.rb | # frozen_string_literal: true
require Rails.root.join('spec/support/mockers/user_mock.rb')
module ControllerHelpers
def mock_user_sign_in(user = UserMock.new(traits: [:findable]))
pass_app_setup_check
allow(request.env['warden']).to receive(:authenticate!).and_return(user)
# necessary for permissions to ... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/factory_girl.rb | spec/support/factory_girl.rb | # frozen_string_literal: true
# Adds FactoryGirl methods to global context
RSpec.configure do |config|
config.include FactoryGirl::Syntax::Methods
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/feature_helpers.rb | spec/support/feature_helpers.rb | # frozen_string_literal: true
module FeatureHelpers
# make sure we have a working app
def app_setup
AppConfig.delete_all
@app_config = mock_app_config(**FactoryGirl.attributes_for(:app_config))
@category = FactoryGirl.create(:category)
@eq_model =
FactoryGirl.create(:equipment_model, category... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/capybara_silence_puma.rb | spec/support/capybara_silence_puma.rb | # frozen_string_literal: true
Capybara.server = :puma, { Silent: true }
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/calendarable.rb | spec/support/calendarable.rb | # frozen_string_literal: true
require 'spec_helper'
shared_examples_for 'calendarable' do |model|
before(:each) do
sign_in FactoryGirl.create(:admin)
@obj = FactoryGirl.create(model.to_s.underscore.to_sym)
@res = send("gen_#{model.to_s.underscore}_res".to_sym, @obj)
@res2 = send("gen_#{model.to_s.un... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/env_helpers.rb | spec/support/env_helpers.rb | # frozen_string_literal: true
module EnvHelpers
# wrapper for modifying the environment variables for specific code
# see: https://github.com/ScrappyAcademy/rock_candy
def env_wrapper(envs = {})
# store original environment variables and set new ones
orig_envs = ENV.select { |k, _| envs.key? k }
envs.... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/warden_setup.rb | spec/support/warden_setup.rb | # frozen_string_literal: true
# Warden test mode for authentication
Warden.test_mode!
# allows us to modify the session before the following request
module InjectSession
def inject_session(hash)
Warden.on_next_request do |proxy|
hash.each do |key, value|
proxy.raw_session[key] = value
end
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/mockers/user_mock.rb | spec/support/mockers/user_mock.rb | # frozen_string_literal: true
require Rails.root.join('spec/support/mockers/mocker.rb')
class UserMock < Mocker
def initialize(role = :user, traits: [], **attrs)
attrs = FactoryGirl.attributes_for(role).merge attrs
traits = [:findable] if traits.empty?
super(traits: traits, **attrs)
end
def self.kla... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/mockers/reservation_mock.rb | spec/support/mockers/reservation_mock.rb | # frozen_string_literal: true
require Rails.root.join('spec/support/mockers/mocker.rb')
class ReservationMock < Mocker
def self.klass
Reservation
end
def self.klass_name
'Reservation'
end
private
def for_user(user:)
child_of_has_many(mocked_parent: user, parent_sym: :reserver,
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/mockers/equipment_model_mock.rb | spec/support/mockers/equipment_model_mock.rb | # frozen_string_literal: true
require Rails.root.join('spec/support/mockers/mocker.rb')
require Rails.root.join('spec/support/mockers/category_mock.rb')
require Rails.root.join('spec/support/mockers/equipment_item_mock.rb')
class EquipmentModelMock < Mocker
def self.klass
EquipmentModel
end
def self.klass_n... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/mockers/equipment_item_mock.rb | spec/support/mockers/equipment_item_mock.rb | # frozen_string_literal: true
require Rails.root.join('spec/support/mockers/mocker.rb')
require Rails.root.join('spec/support/mockers/equipment_model_mock.rb')
class EquipmentItemMock < Mocker
def self.klass
EquipmentItem
end
def self.klass_name
'EquipmentItem'
end
private
def with_model(model: ... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/mockers/category_mock.rb | spec/support/mockers/category_mock.rb | # frozen_string_literal: true
require Rails.root.join('spec/support/mockers/mocker.rb')
require Rails.root.join('spec/support/mockers/equipment_model_mock.rb')
class CategoryMock < Mocker
def self.klass
Category
end
def self.klass_name
'Category'
end
private
def with_equipment_models(models: nil... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/mockers/mocker.rb | spec/support/mockers/mocker.rb | # frozen_string_literal: true
require 'rspec/mocks/standalone'
# This class behaves as an extension of rspec-mocks' instance_spy.
# It is intended to be extended and used to make mocking models much simpler!
#
# To create a new subclass, the following methods must be overridden:
# - self.klass must return the class ... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/shared_examples/flag_job.rb | spec/support/shared_examples/flag_job.rb | # frozen_string_literal: true
require 'spec_helper'
shared_examples_for 'flag job' do |attr, scope|
it 'updates the reservations status' do
res = ReservationMock.new
allow(Reservation).to receive(scope).and_return([res])
described_class.perform_now
expect(res).to have_received(:update).with(attr)
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/shared_examples/email_job.rb | spec/support/shared_examples/email_job.rb | # frozen_string_literal: true
require 'spec_helper'
shared_examples_for 'email job' do |ac_setting, scope|
it 'sends emails' do
mock_app_config(ac_setting)
res = ReservationMock.new
allow(Reservation).to receive(scope).and_return([res])
expect(UserMailer).to \
receive_message_chain(:reservation... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/shared_examples/controller_examples.rb | spec/support/shared_examples/controller_examples.rb | # frozen_string_literal: true
require 'spec_helper'
shared_examples_for 'successful request' do |template|
it { is_expected.to respond_with(:success) }
it { is_expected.to render_template(template) }
it { is_expected.not_to set_flash }
end
shared_examples_for 'redirected request' do
it { expect(response).to b... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/shared_examples/concerns/soft_deletable.rb | spec/support/shared_examples/concerns/soft_deletable.rb | # frozen_string_literal: true
require 'spec_helper'
shared_examples_for 'soft deletable' do
let(:model) { described_class }
describe '#deleted?' do
it 'returns true if the deleted_at attribute is present' do
obj = model.new(deleted_at: Time.zone.now)
expect(obj).to be_deleted
end
it 'ret... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/shared_examples/concerns/linkable.rb | spec/support/shared_examples/concerns/linkable.rb | # frozen_string_literal: true
# based on http://stackoverflow.com/a/20010923/2187922
require 'spec_helper'
shared_examples_for 'linkable' do
let(:model) { described_class } # the class that includes the concern
context 'with no parameter' do
it 'generates a markdown link with name as text when object exists'... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/support/shared_contexts/rake.rb | spec/support/shared_contexts/rake.rb | # frozen_string_literal: true
# see http://robots.thoughtbot.com/test-rake-tasks-like-a-boss
require 'rake'
shared_context 'rake' do
let(:rake) { Rake::Application.new }
let(:task_name) { self.class.top_level_description }
let(:task_path) { "lib/tasks/#{task_name.split(':').first}" }
subject { rak... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/helpers/reservations_helper_spec.rb | spec/helpers/reservations_helper_spec.rb | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe ReservationsHelper, type: :helper do
describe '.manage_reservations_btn' do
let!(:reservation) { create(:valid_reservation) }
context 'when reservation is a request' do
before { reservation.update!(status: 'requested') }
contex... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/helpers/email_helper_spec.rb | spec/helpers/email_helper_spec.rb | # frozen_string_literal: true
require 'spec_helper.rb'
def expect_email(email)
delivered = ActionMailer::Base.deliveries.last
expected = email.deliver_now
expect(delivered.multipart?).to eq(expected.multipart?)
expect(delivered.headers.except('Message-Id')).to\
eq(expected.headers.except('Message-Id'))
e... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/helpers/announcements_helper_spec.rb | spec/helpers/announcements_helper_spec.rb | # frozen_string_literal: true
require 'spec_helper'
# Specs in this file have access to a helper object that includes
# the AnnouncementsHelper. For example:
#
# describe AnnouncementsHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# helper.concat_strings("this","that").sh... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/helpers/user_mailer_helper_spec.rb | spec/helpers/user_mailer_helper_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe UserMailerHelper, type: :helper do
before(:each) do
@app_configs = double(department_name: 'dept', terms_of_service: 'tos')
@reservation = double(id: 1, reserver: double(name: 'name'),
equipment_model: double(name: 'em', l... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/helpers/equipment_model_helper_spec.rb | spec/helpers/equipment_model_helper_spec.rb | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe EquipmentModelsHelper do
describe '.available_item_select_options' do
it 'makes a string listing the available items' do
model = FactoryGirl.create(:equipment_model)
FactoryGirl.create(:checked_out_reservation, equipment_model: model... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/helpers/users_helper_spec.rb | spec/helpers/users_helper_spec.rb | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe UsersHelper, type: :helper do
describe '.tos_attestation' do
let(:user1) { FactoryGirl.build_stubbed :user }
let(:user2) { FactoryGirl.build_stubbed :user }
it 'returns "I accept" when the user is acting on their own behalf' do
re... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/helpers/application_helper_spec.rb | spec/helpers/application_helper_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe ApplicationHelper, type: :helper do
pending 'specs for methods'
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/helpers/requirements_helper_spec.rb | spec/helpers/requirements_helper_spec.rb | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe RequirementsHelper do
describe '#list_requirement_admins' do
before(:each) do
@requirement = FactoryGirl.create(:requirement)
@another_requirement = FactoryGirl.create(:another_requirement)
@equipment_model =
FactoryGir... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/factories/users.rb | spec/factories/users.rb | # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
sequence :username do |n|
"abc#{n}"
end
factory :user, aliases: %i[reserver checkout_handler checkin_handler] do
sequence(:cas_login) { |n| "netid#{n}" }
first_name 'First'
l... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/factories/carts.rb | spec/factories/carts.rb | # frozen_string_literal: true
FactoryGirl.define do
factory :cart do
reserver_id { FactoryGirl.create(:user).id }
start_date { Time.zone.today }
due_date { Time.zone.today + 1.day }
items {}
factory :cart_with_items do
items do
e = FactoryGirl.create(:equipment_model)
Factor... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/factories/blackouts.rb | spec/factories/blackouts.rb | # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :blackout do
notice 'MyText'
blackout_type 'hard'
start_date Time.zone.today
end_date { Time.zone.today + 7.days }
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/factories/equipment_models.rb | spec/factories/equipment_models.rb | # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
sequence(:unique_id) { |n| n }
factory :equipment_model do
name
description 'This is a model'
late_fee '37.50'
replacement_fee '20'
max_per_user 10
category
max_ren... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/factories/app_configs.rb | spec/factories/app_configs.rb | # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :app_config do
upcoming_checkin_email_active true
upcoming_checkout_email_active true
reservation_confirmation_email_active true
site_title 'Reservations Specs'
admin_... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/factories/checkout_procedures.rb | spec/factories/checkout_procedures.rb | # frozen_string_literal: true
FactoryGirl.define do
factory :checkout_procedure do
equipment_model_id { FactoryGirl.create(:equipment_model).id }
step 'This is a step of the check-out procedure.'
created_at { Time.zone.today - 1.day }
updated_at { Time.zone.today }
trait :deleted do
deleted... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/factories/reservations.rb | spec/factories/reservations.rb | # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :reservation do
start_date { Time.zone.today }
due_date { Time.zone.today + 1.day }
reserver
equipment_model
status { 'reserved' }
trait :valid do
after(:bui... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/factories/checkin_procedures.rb | spec/factories/checkin_procedures.rb | # frozen_string_literal: true
FactoryGirl.define do
factory :checkin_procedure do
equipment_model_id { FactoryGirl.create(:equipment_model).id }
step 'This is a step of the check-in procedure.'
created_at { Time.zone.today - 1.day }
updated_at { Time.zone.today }
trait :deleted do
deleted_a... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/factories/equipment_items.rb | spec/factories/equipment_items.rb | # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
# Sequences defined in _sequences.rb
factory :equipment_item do
name 'name'
serial
equipment_model factory: :equipment_model
deactivation_reason nil
notes ''
factory :d... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/factories/announcements.rb | spec/factories/announcements.rb | # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :announcement do
message 'MyText'
starts_at Time.zone.today
ends_at Time.zone.today + 1.day
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/factories/messages.rb | spec/factories/messages.rb | # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :message do
name { generate(:name) }
email { "#{name}@yale.edu".downcase }
subject 'Message'
body 'Typewriter tumblr actually, locavore tofu Etsy kitsch pug next '\
'... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/spec/factories/categories.rb | spec/factories/categories.rb | # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :category do
name
sort_order
max_per_user 5
max_checkout_length 10
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.