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/app/models/equipment_model.rb | app/models/equipment_model.rb | # frozen_string_literal: true
# rubocop:disable ClassLength
class EquipmentModel < ApplicationRecord
include ApplicationHelper
include SoftDeletable
include Linkable
include Searchable
searchable_on(:name, :description)
nilify_blanks only: [:deleted_at]
# table_name is needed to resolve ambiguity for ... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/ability.rb | app/models/ability.rb | # frozen_string_literal: true
class Ability
include CanCan::Ability
def initialize(user)
@user = user
if user.nil?
guest
return
end
send(user.view_mode.to_sym)
case user.role
when 'superuser'
can :change, :views
can :view_as, :superuser
when 'admin'
can :... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/blackout.rb | app/models/blackout.rb | # frozen_string_literal: true
class Blackout < ApplicationRecord
attr_accessor :days # needed for days of the week checkboxes in new_recurring
validates :notice,
:start_date,
:blackout_type,
:end_date, presence: true
validate :validate_end_date_before_start_date
# this onl... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/cart.rb | app/models/cart.rb | # frozen_string_literal: true
class Cart # rubocop:disable ClassLength
include ActiveModel::Validations
include CartValidations
validates :reserver_id, :start_date, :due_date, presence: true
attr_accessor :items, :start_date, :due_date, :reserver_id
def initialize
@errors = ActiveModel::Errors.new(self)... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/category.rb | app/models/category.rb | # frozen_string_literal: true
class Category < ApplicationRecord
include SoftDeletable
include Searchable
searchable_on(:name)
has_many :equipment_models, dependent: :destroy
validates :name, presence: true, uniqueness: { case_sensitive: false }
validates :max_per_user, :max_checkout_length, :max_renewa... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/message.rb | app/models/message.rb | # frozen_string_literal: true
class Message
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
attr_accessor :name, :email, :subject, :body
validates :name, :email, :subject, :body, presence: true
validates :email,
format: { with: /\A([\w\.%\+\-]+)@([\w... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/application_record.rb | app/models/application_record.rb | # frozen_string_literal: true
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/cart_validations.rb | app/models/cart_validations.rb | # frozen_string_literal: true
# rubocop:disable ModuleLength
module CartValidations
# These validation methods were carefully written to use as few database
# queries as possible. Often it seems that a scope could be used but
# it is important to remember that Rails lazy-loads the database calls
def validate_a... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/checkin_procedure.rb | app/models/checkin_procedure.rb | # frozen_string_literal: true
class CheckinProcedure < ApplicationRecord
include SoftDeletable
belongs_to :equipment_model
private
# No associated records for soft deletion
def associated_records
[]
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/equipment_item.rb | app/models/equipment_item.rb | # frozen_string_literal: true
class EquipmentItem < ApplicationRecord # rubocop:disable Metrics/ClassLength
include SoftDeletable
include Linkable
include Searchable
belongs_to :equipment_model, counter_cache: true
has_one :category, through: :equipment_model
has_many :reservations
validates :name,
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/reservation.rb | app/models/reservation.rb | # frozen_string_literal: true
# rubocop:disable Metrics/ClassLength
class Reservation < ApplicationRecord
include Linkable
include ReservationValidations
belongs_to :equipment_model
belongs_to :equipment_item
belongs_to :reserver, class_name: 'User'
belongs_to :checkout_handler, class_name: 'User'
belon... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/reservation_validations.rb | app/models/reservation_validations.rb | # frozen_string_literal: true
module ReservationValidations
## Validations ##
# Catch-all validation methods #
def validate
# Convert reservation to a cart object and run validations on it
# For hard validations, use reservation.valid
to_cart.validate_all
end
def validate_renew
to_cart.vali... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/checkout_procedure.rb | app/models/checkout_procedure.rb | # frozen_string_literal: true
class CheckoutProcedure < ApplicationRecord
include SoftDeletable
belongs_to :equipment_model
private
# No associated records for soft deletion
def associated_records
[]
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/app_config.rb | app/models/app_config.rb | # frozen_string_literal: true
class AppConfig < ApplicationRecord
has_one_attached :favicon
validates :favicon,
content_type: { in: 'image/vnd.microsoft.icon',
message: 'must be .ico' }
validates :site_title, presence: true,
length: { maximum... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/announcement.rb | app/models/announcement.rb | # frozen_string_literal: true
class Announcement < ActiveRecord::Base
validates :message,
:ends_at,
:starts_at, presence: true
validate :validate_end_date_before_start_date
def self.current(hidden_ids = nil)
result = where('starts_at <= :now and ends_at >= :now',
no... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/user.rb | app/models/user.rb | # frozen_string_literal: true
require 'net/ldap'
class User < ApplicationRecord
include Linkable
# Include authentication modules
# If the CAS_AUTH environment variable is set, we simply include the
# :cas_authenticatable module. If not, we implement password authentcation
# using the :database_authenticat... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/concerns/soft_deletable.rb | app/models/concerns/soft_deletable.rb | # frozen_string_literal: true
module SoftDeletable
extend ActiveSupport::Concern
included do
# "Soft delete" - set deleted_at if it is nil, actually destroy the record
# if forced.
#
# @param force [Boolean]
def destroy(force = nil)
return force_destroy_record if force == :force
re... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/concerns/linkable.rb | app/models/concerns/linkable.rb | # frozen_string_literal: true
module Linkable
extend ActiveSupport::Concern
include Rails.application.routes.url_helpers
included do
def default_url_options
ActionMailer::Base.default_url_options
end
def md_link(text = name)
url_method = "#{self.class.to_s.underscore}_url"
id ? "[#... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/queries/query_base.rb | app/queries/query_base.rb | # frozen_string_literal: true
class QueryBase
class << self
delegate :call, to: :new
end
def initialize
raise NotImplementedError
end
def call
raise NotImplementedError
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/queries/reservations/upcoming_query.rb | app/queries/reservations/upcoming_query.rb | # frozen_string_literal: true
module Reservations
class UpcomingQuery < Reservations::ReservationsQueryBase
def call
@relation.unscoped.where(start_date: Time.zone.today).reserved
.order('reserver_id')
end
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/queries/reservations/consecutive_with_query.rb | app/queries/reservations/consecutive_with_query.rb | # frozen_string_literal: true
module Reservations
class ConsecutiveWithQuery < Reservations::ReservationsQueryBase
def call(start_date, due_date)
@relation.where('start_date = ? OR due_date = ?', due_date + 1.day,
start_date - 1.day).active
end
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/queries/reservations/reservations_query_base.rb | app/queries/reservations/reservations_query_base.rb | # frozen_string_literal: true
module Reservations
class ReservationsQueryBase < QueryBase
def initialize(relation = Reservation.all)
@relation = relation
end
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/queries/reservations/future_query.rb | app/queries/reservations/future_query.rb | # frozen_string_literal: true
module Reservations
class FutureQuery < Reservations::ReservationsQueryBase
def call
@relation.where('start_date > ?', Time.zone.today.beginning_of_day)
.reserved
end
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/queries/reservations/notes_unsent_query.rb | app/queries/reservations/notes_unsent_query.rb | # frozen_string_literal: true
module Reservations
class NotesUnsentQuery < Reservations::ReservationsQueryBase
def call
@relation.where(notes_unsent: true).where.not(notes: nil)
end
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/queries/reservations/for_cat_query.rb | app/queries/reservations/for_cat_query.rb | # frozen_string_literal: true
module Reservations
class ForCatQuery < Reservations::ReservationsQueryBase
def call(cat_id)
ems = EquipmentModel.where('category_id = ?', cat_id).map(&:id)
@relation.where(equipment_model_id: ems)
end
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/queries/reservations/overlaps_with_date_range_query.rb | app/queries/reservations/overlaps_with_date_range_query.rb | # frozen_string_literal: true
module Reservations
class OverlapsWithDateRangeQuery < Reservations::ReservationsQueryBase
def call(start_date, end_date)
@relation
.where('start_date <= ? and due_date >= ?', end_date, start_date)
end
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/queries/reservations/affected_by_recurring_blackout_query.rb | app/queries/reservations/affected_by_recurring_blackout_query.rb | # frozen_string_literal: true
module Reservations
class AffectedByRecurringBlackoutQuery < ReservationsQueryBase
def call(res_dates)
@relation.where(due_date: res_dates)
.or(Reservation.where(start_date: res_dates)).active
end
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/queries/reservations/affected_by_blackout_query.rb | app/queries/reservations/affected_by_blackout_query.rb | # frozen_string_literal: true
module Reservations
class AffectedByBlackoutQuery < Reservations::ReservationsQueryBase
def call(blackout)
date_range = blackout.start_date..blackout.end_date
@relation.unscoped.where(start_date: date_range)
.or(@relation.unscoped.where(due_date: date_rang... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/queries/reservations/checkoutable_query.rb | app/queries/reservations/checkoutable_query.rb | # frozen_string_literal: true
module Reservations
class CheckoutableQuery < Reservations::ReservationsQueryBase
def call
@relation.where('start_date <= ?', Time.zone.today).reserved
end
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/queries/reservations/starts_on_days_query.rb | app/queries/reservations/starts_on_days_query.rb | # frozen_string_literal: true
module Reservations
class StartsOnDaysQuery < Reservations::ReservationsQueryBase
def call(start_date, end_date)
@relation.where(start_date: start_date..end_date)
end
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/inputs/deleted_input.rb | app/inputs/deleted_input.rb | # frozen_string_literal: true
class DeletedInput < SimpleForm::Inputs::BooleanInput
def input(_wrapper_options)
build_check_box
end
def build_check_box(_unchecked_value = '')
box_val =
@builder.object.deleted_at.blank? ? { checked: false } : { checked: true }
@builder.check_box(attribute_name,... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/mailers/notifications_mailer.rb | app/mailers/notifications_mailer.rb | # frozen_string_literal: true
class NotificationsMailer < ActionMailer::Base
def new_message(message)
@message = message
mail(to: AppConfig.contact_email,
subject: "[#{AppConfig.get(:site_title)}] #{message.subject}",
from: @message.email)
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/mailers/admin_mailer.rb | app/mailers/admin_mailer.rb | # frozen_string_literal: true
class AdminMailer < ActionMailer::Base
add_template_helper(ApplicationHelper)
default from: "no-reply@#{ActionMailer::Base.default_url_options[:host]}"
def notes_reservation_notification(notes_reservations_out,
notes_reservations_in)
@notes_r... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/mailers/devise_mailer.rb | app/mailers/devise_mailer.rb | # frozen_string_literal: true
class DeviseMailer < Devise::Mailer
# gives access to all helpers defined within `application_helper`.
helper :application
include Devise::Controllers::UrlHelpers # Optional. eg. `confirmation_url`
# to make sure that your mailer uses the devise views
default sender: ->() { devi... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/mailers/user_mailer.rb | app/mailers/user_mailer.rb | # frozen_string_literal: true
class UserMailer < ActionMailer::Base
# Workaround so that RSpec start-up doesn't fail.
# TODO: Have RSpec initialize AppConfig with configuration.
add_template_helper(ApplicationHelper)
if AppConfig.check :admin_email
default from: AppConfig.get(:admin_email), cc: AppConfig.ge... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/seeds.rb | db/seeds.rb | # frozen_string_literal: true
include AutomaticSeed
include PromptedSeed
# rubocop:disable Rails/Output
# RESET PUBLIC DIR IF WE'VE RESET THE DATABASE
if EquipmentModel.all.empty?
location_models = Rails.root.to_s + '/public/attachments/equipment_models'
if File.directory?(location_models) # if the directory exi... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/schema.rb | db/schema.rb | # 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 `rails
#... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140909230819_set_sane_config_defaults.rb | db/migrate/20140909230819_set_sane_config_defaults.rb | class SetSaneConfigDefaults < ActiveRecord::Migration
def change
columns(:app_configs).each do |col|
if (col.type == :string || col.type == :text) && !(col.name.include? 'favicon')
# prevent nil strings/text and replace with empty string
change_column_null(:app_configs, col.name.to_s, false,... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20091001181809_create_categories.rb | db/migrate/20091001181809_create_categories.rb | class CreateCategories < ActiveRecord::Migration
def self.up
create_table :categories do |t|
t.string :name
t.integer :max_per_user
t.integer :max_checkout_length
t.timestamps
end
end
def self.down
drop_table :categories
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20130627211001_rename_blackout_attributes.rb | db/migrate/20130627211001_rename_blackout_attributes.rb | class RenameBlackoutAttributes < ActiveRecord::Migration
def change
rename_table :black_outs, :blackouts
rename_column :blackouts, :black_out_type, :blackout_type
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140727232238_add_request_text_to_app_configs.rb | db/migrate/20140727232238_add_request_text_to_app_configs.rb | class AddRequestTextToAppConfigs < ActiveRecord::Migration
def change
add_column :app_configs, :request_text, :text
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120710135541_create_users_requirements.rb | db/migrate/20120710135541_create_users_requirements.rb | class CreateUsersRequirements < ActiveRecord::Migration
def change
create_table :users_requirements, :id => false do |t|
t.integer :user_id
t.integer :requirement_id
end
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140306014551_add_default_value_to_users_nickname.rb | db/migrate/20140306014551_add_default_value_to_users_nickname.rb | class AddDefaultValueToUsersNickname < ActiveRecord::Migration
def up
User.all.each do |user|
if user.nickname.nil?
user.nickname = ''
user.save!
end
end
change_column :users, :nickname, :string, :default => '', :null => false
end
def down
change_column :users, :nickn... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140718170250_add_user_login_index_to_users.rb | db/migrate/20140718170250_add_user_login_index_to_users.rb | class AddUserLoginIndexToUsers < ActiveRecord::Migration
def change
add_index :users, :login, unique: true
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140724194636_drop_active_admin_comments.rb | db/migrate/20140724194636_drop_active_admin_comments.rb | class DropActiveAdminComments < ActiveRecord::Migration
def up
drop_table :active_admin_comments
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120711204254_add_terms_of_service_to_app_configs.rb | db/migrate/20120711204254_add_terms_of_service_to_app_configs.rb | class AddTermsOfServiceToAppConfigs < ActiveRecord::Migration
def self.up
add_column :app_configs, :terms_of_service, :text
end
def self.down
remove_column :app_configs, :terms_of_service
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120612170727_create_requirements.rb | db/migrate/20120612170727_create_requirements.rb | class CreateRequirements < ActiveRecord::Migration
def self.up
create_table :requirements do |t|
t.integer :equipment_model_id
t.string :contact_name
t.string :contact_info
t.datetime :deleted_at
t.text :notes
t.timestamps
end
end
def self.down
drop_table :requirem... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140715164121_remove_deleted_at_from_users.rb | db/migrate/20140715164121_remove_deleted_at_from_users.rb | class RemoveDeletedAtFromUsers < ActiveRecord::Migration
def up
remove_column :users, :deleted_at
end
def down
add_column :users, :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/20120724144133_add_multiple_models_to_each_requirement.rb | db/migrate/20120724144133_add_multiple_models_to_each_requirement.rb | class AddMultipleModelsToEachRequirement < ActiveRecord::Migration
def change
create_table :equipment_models_requirements, :id => false do |t|
t.references :requirement, :null => false
t.references :equipment_model, :null => false
end
end
end | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120605165432_add_deleted_date_to_users.rb | db/migrate/20120605165432_add_deleted_date_to_users.rb | class AddDeletedDateToUsers < ActiveRecord::Migration
def self.up
add_column :users, :deleted_at, :string
add_column :equipment_objects, :deleted_at, :string
add_column :equipment_models, :deleted_at, :string
add_column :categories, :deleted_at, :string
end
def self.down
remove_column :users,... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150323013431_add_cas_login_to_users.rb | db/migrate/20150323013431_add_cas_login_to_users.rb | class AddCasLoginToUsers < ActiveRecord::Migration
def change
add_column :users, :cas_login, :string
# copy username to cas_login if you use CAS already
if ENV['CAS_AUTH']
ActiveRecord::Base.connection
.execute('update users set cas_login=username')
end
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120528174217_add_equipment_references_to_reservations.rb | db/migrate/20120528174217_add_equipment_references_to_reservations.rb | class AddEquipmentReferencesToReservations < ActiveRecord::Migration
def self.up
change_table :reservations do |t|
t.references :equipment_model
t.references :equipment_object
end
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/20130310095507_add_missed_reservation_deleted_email_body_to_app_configs.rb | db/migrate/20130310095507_add_missed_reservation_deleted_email_body_to_app_configs.rb | class AddMissedReservationDeletedEmailBodyToAppConfigs < ActiveRecord::Migration
def change
add_column :app_configs, :deleted_missed_reservation_email_body, :text
app_config = AppConfig.first
if app_config
app_config.deleted_missed_reservation_email_body = "Dear @user@,
Equipment reserved... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20091006222033_create_accessories_equipment_models.rb | db/migrate/20091006222033_create_accessories_equipment_models.rb | class CreateAccessoriesEquipmentModels < ActiveRecord::Migration
def self.up
create_table :accessories_equipment_models do |t|
t.references :accessory
t.references :equipment_model
t.timestamps
end
end
def self.down
drop_table :accessories_equipment_models
end
end | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20130628152148_combine_type_columns_in_users_table.rb | db/migrate/20130628152148_combine_type_columns_in_users_table.rb | class CombineTypeColumnsInUsersTable < ActiveRecord::Migration
def up
add_column :users, :role, :string, :default => 'normal'
User.all.each do |user|
if user.is_banned
user.role = 'banned'
elsif user.is_admin
user.role = 'admin'
elsif user.is_checkout_person
user.rol... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20160610135455_add_requests_affect_availability_to_app_config.rb | db/migrate/20160610135455_add_requests_affect_availability_to_app_config.rb | class AddRequestsAffectAvailabilityToAppConfig < ActiveRecord::Migration[4.2]
def change
add_column :app_configs, :requests_affect_availability, :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/20091001205833_create_equipment_models.rb | db/migrate/20091001205833_create_equipment_models.rb | class CreateEquipmentModels < ActiveRecord::Migration
def self.up
create_table :equipment_models do |t|
t.string :name
t.text :description
t.decimal :late_fee, :precision => 10, :scale => 2
t.decimal :replacement_fee, :precision => 10, :scale => 2
t.integer :max_per_user
t.bool... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20130708215903_add_viewed_to_app_configs.rb | db/migrate/20130708215903_add_viewed_to_app_configs.rb | class AddViewedToAppConfigs < ActiveRecord::Migration
def up
end
def down
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140611142208_create_admin_notes.rb | db/migrate/20140611142208_create_admin_notes.rb | class CreateAdminNotes < ActiveRecord::Migration
def self.up
create_table :admin_notes do |t|
t.string :resource_id, :null => false
t.string :resource_type, :null => false
t.references :admin_user, :polymorphic => true
t.text :body
t.timestamps
end
add_index :admin_notes, [:r... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150322234652_add_status_to_reservation.rb | db/migrate/20150322234652_add_status_to_reservation.rb | class AddStatusToReservation < ActiveRecord::Migration
def change
add_column :reservations, :status, :integer, 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/20140617164155_set_user_viewmode_to_role.rb | db/migrate/20140617164155_set_user_viewmode_to_role.rb | class SetUserViewmodeToRole < ActiveRecord::Migration
def up
User.connection.execute("update users set view_mode=role")
end
def down
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120717204910_drop_accessories_table.rb | db/migrate/20120717204910_drop_accessories_table.rb | class DropAccessoriesTable < ActiveRecord::Migration
def up
drop_table :accessories_equipment_models
end
def down
create_table :accessories_equipment_models do |t|
t.references :accessory
t.references :equipment_model
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/20120627124555_create_black_outs.rb | db/migrate/20120627124555_create_black_outs.rb | class CreateBlackOuts < ActiveRecord::Migration
def change
create_table :black_outs do |t|
t.integer :equipment_model_id
t.date :start_date
t.date :end_date
t.text :notice
t.integer :created_by
t.text :black_out_type
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/20120614202421_add_attachment_documentation_to_equipment_models.rb | db/migrate/20120614202421_add_attachment_documentation_to_equipment_models.rb | class AddAttachmentDocumentationToEquipmentModels < ActiveRecord::Migration
def self.up
add_column :equipment_models, :documentation_file_name, :string
add_column :equipment_models, :documentation_content_type, :string
add_column :equipment_models, :documentation_file_size, :integer
add_column :equipm... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120613153342_add_notes_sent_status_to_reservation.rb | db/migrate/20120613153342_add_notes_sent_status_to_reservation.rb | class AddNotesSentStatusToReservation < ActiveRecord::Migration
def self.up
add_column :reservations, :notes_unsent, :boolean, :default => true
end
def self.down
remove_column :reservations, :notes_unsent
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140702014415_remove_cart_reservations.rb | db/migrate/20140702014415_remove_cart_reservations.rb | class RemoveCartReservations < ActiveRecord::Migration
def up
drop_table :cart_reservations
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20141126050547_add_res_exp_time_to_app_configs.rb | db/migrate/20141126050547_add_res_exp_time_to_app_configs.rb | class AddResExpTimeToAppConfigs < ActiveRecord::Migration
def change
add_column :app_configs, :res_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/20120613150246_create_checkout_procedures.rb | db/migrate/20120613150246_create_checkout_procedures.rb | class CreateCheckoutProcedures < ActiveRecord::Migration
def up
create_table :checkout_procedures do |t|
t.references :equipment_model
t.string :step
t.timestamps
end
end
def down
drop_table :checkout_procedures
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20130310101907_add_send_notifications_for_deleted_missed_reservations_to_app_configs.rb | db/migrate/20130310101907_add_send_notifications_for_deleted_missed_reservations_to_app_configs.rb | class AddSendNotificationsForDeletedMissedReservationsToAppConfigs < ActiveRecord::Migration
def change
add_column :app_configs, :send_notifications_for_deleted_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/20120607175319_add_notes_to_reservation_table.rb | db/migrate/20120607175319_add_notes_to_reservation_table.rb | class AddNotesToReservationTable < ActiveRecord::Migration
def self.up
add_column :reservations, :notes, :text
end
def self.down
remove_column :reservations, :notes
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140904235608_default_notes_unsent_to_false.rb | db/migrate/20140904235608_default_notes_unsent_to_false.rb | class DefaultNotesUnsentToFalse < ActiveRecord::Migration
def change
change_column :reservations, :notes_unsent, :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/20120613150237_create_checkin_procedures.rb | db/migrate/20120613150237_create_checkin_procedures.rb | class CreateCheckinProcedures < ActiveRecord::Migration
def up
create_table :checkin_procedures do |t|
t.references :equipment_model
t.string :step
t.timestamps
end
end
def down
drop_table :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/20141026050048_add_recoverable_to_user.rb | db/migrate/20141026050048_add_recoverable_to_user.rb | class AddRecoverableToUser < ActiveRecord::Migration
def change
change_table :users do |t|
t.string :reset_password_token
t.datetime :reset_password_sent_at
end
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120621174747_add_renewal_prefs_categories.rb | db/migrate/20120621174747_add_renewal_prefs_categories.rb | class AddRenewalPrefsCategories < ActiveRecord::Migration
def up
add_column :categories, :max_renewal_times, :integer
add_column :categories, :max_renewal_length, :integer
add_column :categories, :renewal_days_before_due, :integer
end
def down
remove_column :categories, :max_renewal_times, :int... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20130815225046_add_deleted_at_to_checkin_and_checkout_procedures.rb | db/migrate/20130815225046_add_deleted_at_to_checkin_and_checkout_procedures.rb | class AddDeletedAtToCheckinAndCheckoutProcedures < 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/20191111190101_create_active_storage_tables.active_storage.rb | db/migrate/20191111190101_create_active_storage_tables.active_storage.rb | # This migration comes from active_storage (originally 20170806125915)
class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
def change
create_table :active_storage_blobs do |t|
t.string :key, null: false
t.string :filename, null: false
t.string :content_type
t.text... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140826040900_add_enable_renewals_to_app_config.rb | db/migrate/20140826040900_add_enable_renewals_to_app_config.rb | class AddEnableRenewalsToAppConfig < ActiveRecord::Migration
def change
add_column :app_configs, :enable_renewals, :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/20160304025530_add_overdue_count_to_equipment_models.rb | db/migrate/20160304025530_add_overdue_count_to_equipment_models.rb | class AddOverdueCountToEquipmentModels < ActiveRecord::Migration[4.2]
def self.up
add_column :equipment_models, :overdue_count, :integer, :null => false, :default => 0
conn = ActiveRecord::Base.connection
conn.exec_query('SELECT * from equipment_models').each do |e|
overdue = conn.exec_query('SEL... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140718195128_add_max_checkout_length_to_equipment_models.rb | db/migrate/20140718195128_add_max_checkout_length_to_equipment_models.rb | class AddMaxCheckoutLengthToEquipmentModels < ActiveRecord::Migration
def change
add_column :equipment_models, :max_checkout_length, :integer
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120621140258_add_times_renewed_to_reservations.rb | db/migrate/20120621140258_add_times_renewed_to_reservations.rb | class AddTimesRenewedToReservations < ActiveRecord::Migration
def change
add_column :reservations, :times_renewed, :integer
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20200123142405_remove_paperclip_columns.rb | db/migrate/20200123142405_remove_paperclip_columns.rb | class RemovePaperclipColumns < ActiveRecord::Migration[6.0]
def change
# Remove Paperclip columns from EquipmentModel table
remove_column :equipment_models, :photo_file_name, :string
remove_column :equipment_models, :photo_content_type, :string
remove_column :equipment_models, :photo_file_size, :integ... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150227032011_add_equipment_objects_count_to_equipment_models.rb | db/migrate/20150227032011_add_equipment_objects_count_to_equipment_models.rb | class AddEquipmentObjectsCountToEquipmentModels < ActiveRecord::Migration
def change
add_column :equipment_models, :equipment_objects_count, :integer, default: 0, null: false
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120705204903_drop_settings_table.rb | db/migrate/20120705204903_drop_settings_table.rb | class DropSettingsTable < ActiveRecord::Migration
def up
drop_table :settings
end
def down
create_table "settings", :force => true do |t|
t.string "var", :null => false
t.text "value"
t.integer "thing_id"
t.string "thing_type", :limit => 30
t.da... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140611142209_move_admin_notes_to_comments.rb | db/migrate/20140611142209_move_admin_notes_to_comments.rb | class MoveAdminNotesToComments < ActiveRecord::Migration
def self.up
remove_index :admin_notes, [:admin_user_type, :admin_user_id]
rename_table :admin_notes, :active_admin_comments
rename_column :active_admin_comments, :admin_user_type, :author_type
rename_column :active_admin_comments, :admin_user_... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150719040438_add_notify_admin_on_create_to_app_config.rb | db/migrate/20150719040438_add_notify_admin_on_create_to_app_config.rb | class AddNotifyAdminOnCreateToAppConfig < ActiveRecord::Migration
def change
add_column :app_configs, :notify_admin_on_create, :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/20180624231458_fix_overdue_count.rb | db/migrate/20180624231458_fix_overdue_count.rb | class FixOverdueCount < ActiveRecord::Migration[5.1]
def change
reversible do |dir|
dir.up do
conn = ActiveRecord::Base.connection
conn.exec_query('SELECT * FROM equipment_models').each do |em|
overdue = conn.exec_query('SELECT * FROM reservations WHERE '\
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120717205310_create_cart_reservation.rb | db/migrate/20120717205310_create_cart_reservation.rb | class CreateCartReservation < ActiveRecord::Migration
def up
create_table :cart_reservations do |t|
t.references :reserver
t.datetime :start_date
t.datetime :due_date
t.references :equipment_model
t.timestamps
end
end
def down
drop_table :cart_reservations
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120614183257_add_attachment_photo_to_equipment_models.rb | db/migrate/20120614183257_add_attachment_photo_to_equipment_models.rb | class AddAttachmentPhotoToEquipmentModels < ActiveRecord::Migration
def self.up
add_column :equipment_models, :photo_file_name, :string
add_column :equipment_models, :photo_content_type, :string
add_column :equipment_models, :photo_file_size, :integer
add_column :equipment_models, :photo_updated_at, :... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120717140824_add_set_id_to_blackouts.rb | db/migrate/20120717140824_add_set_id_to_blackouts.rb | class AddSetIdToBlackouts < ActiveRecord::Migration
def self.up
add_column :black_outs, :set_id, :integer
end
def self.down
remove_column :black_outs, :set_id
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20091001215110_create_equipment_objects.rb | db/migrate/20091001215110_create_equipment_objects.rb | class CreateEquipmentObjects < ActiveRecord::Migration
def self.up
create_table :equipment_objects do |t|
t.string :name
t.string :serial
t.boolean :active, :default => true
t.references :equipment_model
t.timestamps
end
end
def self.down
drop_table :equipment_objects
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120621161037_add_renewal_prefs.rb | db/migrate/20120621161037_add_renewal_prefs.rb | class AddRenewalPrefs < ActiveRecord::Migration
def up
add_column :equipment_models, :max_renewal_times, :integer
add_column :equipment_models, :max_renewal_length, :integer
add_column :equipment_models, :renewal_days_before_due, :integer
end
def down
remove_column :equipment_models, :max_renew... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20141219172429_add_enable_guests_to_app_configs.rb | db/migrate/20141219172429_add_enable_guests_to_app_configs.rb | class AddEnableGuestsToAppConfigs < ActiveRecord::Migration
def change
add_column :app_configs, :enable_guests, :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/20120712202128_add_contact_link_email_to_app_configs.rb | db/migrate/20120712202128_add_contact_link_email_to_app_configs.rb | class AddContactLinkEmailToAppConfigs < ActiveRecord::Migration
def change
remove_column :app_configs, :contact_link_text
end
end | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20130310101909_add_checkout_persons_can_edit_to_app_configs.rb | db/migrate/20130310101909_add_checkout_persons_can_edit_to_app_configs.rb | class AddCheckoutPersonsCanEditToAppConfigs < ActiveRecord::Migration
def change
add_column :app_configs, :checkout_persons_can_edit, :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/20091002165901_create_reservations.rb | db/migrate/20091002165901_create_reservations.rb | class CreateReservations < ActiveRecord::Migration
def self.up
create_table :reservations do |t|
t.references :reserver
t.references :checkout_handler
t.references :checkin_handler
t.datetime :start_date
t.datetime :due_date
t.datetime :checked_out
t.datetime :checked_in
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140710205359_remove_equipment_model_id_from_blackouts.rb | db/migrate/20140710205359_remove_equipment_model_id_from_blackouts.rb | class RemoveEquipmentModelIdFromBlackouts < ActiveRecord::Migration
def up
remove_column :blackouts, :equipment_model_id
end
def down
add_column :blackouts, :equipment_model_id, :integer
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20120629190015_drop_documents_table.rb | db/migrate/20120629190015_drop_documents_table.rb | class DropDocumentsTable < ActiveRecord::Migration
def up
drop_table :documents
end
def down
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
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20140930233633_add_missing_phone_to_users.rb | db/migrate/20140930233633_add_missing_phone_to_users.rb | class AddMissingPhoneToUsers < ActiveRecord::Migration
def change
add_column :users, :missing_phone, :boolean, default: false
# go through existing users if require_phone is set to true and set
# missing_phone appropriately
if AppConfig.first && AppConfig.first.require_phone
User.no_phone.updat... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20130628000001_add_new_columns.rb | db/migrate/20130628000001_add_new_columns.rb | # Note, this migration was moved forward in time (timestamp) to fix bug with
# next migration (combine_type_columns_in_users_table) which referenced this
# attr through the user model.
class AddNewColumns < ActiveRecord::Migration
def up
add_column :app_configs, :require_phone, :boolean, :default => false
add... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/db/migrate/20150327012721_add_rememberable_to_users.rb | db/migrate/20150327012721_add_rememberable_to_users.rb | class AddRememberableToUsers < ActiveRecord::Migration
def change
add_column :users, :remember_created_at, :datetime
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.