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 |
|---|---|---|---|---|---|---|---|---|
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/restricted_team.rb | spec/dummy_app/app/active_record/restricted_team.rb | # frozen_string_literal: true
class RestrictedTeam < Team
has_many :players, foreign_key: :team_id, dependent: :restrict_with_error
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/deeply_nested_field_test.rb | spec/dummy_app/app/active_record/deeply_nested_field_test.rb | # frozen_string_literal: true
class DeeplyNestedFieldTest < ActiveRecord::Base
belongs_to :nested_field_test, inverse_of: :deeply_nested_field_tests
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/managed_team.rb | spec/dummy_app/app/active_record/managed_team.rb | # frozen_string_literal: true
class ManagedTeam < Team
belongs_to :user, class_name: 'ManagingUser', foreign_key: :manager, primary_key: :email, optional: true, inverse_of: :teams
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/read_only_comment.rb | spec/dummy_app/app/active_record/read_only_comment.rb | # frozen_string_literal: true
class ReadOnlyComment < Comment
def readonly?
true
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/managing_user.rb | spec/dummy_app/app/active_record/managing_user.rb | # frozen_string_literal: true
class ManagingUser < User
has_one :team, class_name: 'ManagedTeam', foreign_key: :manager, primary_key: :email, inverse_of: :user
has_many :teams, class_name: 'ManagedTeam', foreign_key: :manager, primary_key: :email, inverse_of: :user
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/nested_fan.rb | spec/dummy_app/app/active_record/nested_fan.rb | # frozen_string_literal: true
if ActiveRecord.gem_version >= Gem::Version.new('7.1') || defined?(CompositePrimaryKeys)
class NestedFan < Fan
accepts_nested_attributes_for :fanships
accepts_nested_attributes_for :fanship
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/division.rb | spec/dummy_app/app/active_record/division.rb | # frozen_string_literal: true
class Division < ActiveRecord::Base
self.primary_key = :custom_id
belongs_to :league, foreign_key: 'custom_league_id', optional: true
has_many :teams
validates_numericality_of(:custom_league_id, only_integer: true)
validates_presence_of(:name)
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/carrierwave_uploader.rb | spec/dummy_app/app/active_record/carrierwave_uploader.rb | # frozen_string_literal: true
require 'mini_magick'
class CarrierwaveUploader < CarrierWave::Uploader::Base
# Include RMagick or ImageScience support:
# include CarrierWave::RMagick
include CarrierWave::MiniMagick
# include CarrierWave::ImageScience
# Choose what kind of storage to use for this uploader:
storage :file
# storage :fog
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
version :thumb do
process resize_to_fill: [100, 100]
end
# Provide a default URL as a default if there hasn't been a file uploaded:
# def default_url
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
# end
# Process files as they are uploaded:
# process scale: [200, 300]
#
# def scale(width, height)
# # do something
# end
# Create different versions of your uploaded files:
# version :thumb do
# process scale: [50, 50]
# end
# Add an allowlist of extensions which are allowed to be uploaded.
# For images you might use something like this:
# def extension_allowlist
# %w(jpg jpeg gif png)
# end
# Override the filename of the uploaded files:
# Avoid using model.id or version_name here, see uploader/store.rb for details.
# def filename
# "something.jpg" if original_filename
# end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/league.rb | spec/dummy_app/app/active_record/league.rb | # frozen_string_literal: true
class League < ActiveRecord::Base
has_many :divisions, foreign_key: 'custom_league_id'
has_many :teams, -> { readonly }, through: :divisions
has_many :players, through: :teams
has_one :division, foreign_key: 'custom_league_id'
validates_presence_of(:name)
def custom_name
"League '#{name}'"
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/category.rb | spec/dummy_app/app/active_record/category.rb | # frozen_string_literal: true
class Category < ActiveRecord::Base
belongs_to :parent_category, class_name: 'Category', optional: true
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/player.rb | spec/dummy_app/app/active_record/player.rb | # frozen_string_literal: true
class Player < ActiveRecord::Base
belongs_to :team, optional: true, inverse_of: :players
has_one :draft, dependent: :destroy
has_many :comments, as: :commentable
validates_presence_of(:name)
validates_numericality_of(:number, only_integer: true)
validates_uniqueness_of(:number, scope: :team_id, message: 'There is already a player with that number on this team')
validates_each :name do |record, _attr, value|
record.errors.add(:base, 'Player is cheating') if /on steroids/.match?(value.to_s)
end
if ActiveRecord.gem_version >= Gem::Version.new('7.0')
enum :formation, {start: 'start', substitute: 'substitute'}
else
enum formation: {start: 'start', substitute: 'substitute'}
end
before_destroy :destroy_hook
scope :rails_admin_search, ->(query) { where(name: query.reverse) }
def destroy_hook; end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/trail.rb | spec/dummy_app/app/active_record/trail.rb | # frozen_string_literal: true
class Trail < PaperTrail::Version
self.table_name = :custom_versions
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/hardball.rb | spec/dummy_app/app/active_record/hardball.rb | # frozen_string_literal: true
class Hardball < Ball
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/comment.rb | spec/dummy_app/app/active_record/comment.rb | # frozen_string_literal: true
class Comment < ActiveRecord::Base
include Taggable
belongs_to :commentable, polymorphic: true, optional: true
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/paper_trail_test_subclass.rb | spec/dummy_app/app/active_record/paper_trail_test_subclass.rb | # frozen_string_literal: true
class PaperTrailTestSubclass < PaperTrailTest
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/without_table.rb | spec/dummy_app/app/active_record/without_table.rb | # frozen_string_literal: true
class WithoutTable < ActiveRecord::Base
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/favorite_player.rb | spec/dummy_app/app/active_record/favorite_player.rb | # frozen_string_literal: true
if ActiveRecord.gem_version >= Gem::Version.new('7.1') || defined?(CompositePrimaryKeys)
class FavoritePlayer < ActiveRecord::Base
if defined?(CompositePrimaryKeys)
self.primary_keys = :fan_id, :team_id, :player_id
else
self.primary_key = :fan_id, :team_id, :player_id
end
if defined?(CompositePrimaryKeys) || ActiveRecord.gem_version >= Gem::Version.new('7.2')
belongs_to :fanship, foreign_key: %i[fan_id team_id], inverse_of: :favorite_players
else
belongs_to :fanship, query_constraints: %i[fan_id team_id], inverse_of: :favorite_players
end
belongs_to :player
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/draft.rb | spec/dummy_app/app/active_record/draft.rb | # frozen_string_literal: true
class Draft < ActiveRecord::Base
belongs_to :team
belongs_to :player
validates_numericality_of(:player_id, only_integer: true)
validates_numericality_of(:team_id, only_integer: true)
validates_presence_of(:date)
validates_numericality_of(:round, only_integer: true)
validates_numericality_of(:pick, only_integer: true)
validates_numericality_of(:overall, only_integer: true)
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/fan.rb | spec/dummy_app/app/active_record/fan.rb | # frozen_string_literal: true
class Fan < ActiveRecord::Base
has_and_belongs_to_many :teams
if ActiveRecord.gem_version >= Gem::Version.new('7.1') || defined?(CompositePrimaryKeys)
has_many :fanships, inverse_of: :fan
has_one :fanship, inverse_of: :fan
end
validates_presence_of(:name)
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/shrine_uploader.rb | spec/dummy_app/app/active_record/shrine_uploader.rb | # frozen_string_literal: true
class ShrineUploader < Shrine
plugin :activerecord
plugin :cached_attachment_data
plugin :determine_mime_type
plugin :pretty_location
plugin :remove_attachment
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/team.rb | spec/dummy_app/app/active_record/team.rb | # frozen_string_literal: true
class Team < ActiveRecord::Base
has_many :players, -> { order :id }, inverse_of: :team
has_and_belongs_to_many :fans
has_many :comments, as: :commentable
validates_numericality_of :division_id, only_integer: true
validates_presence_of :manager
validates_numericality_of :founded, only_integer: true, allow_blank: true
validates_numericality_of :wins, only_integer: true
validates_numericality_of :losses, only_integer: true
validates_numericality_of :win_percentage
validates_numericality_of :revenue, allow_nil: true
belongs_to :division, optional: true
if ActiveRecord.gem_version >= Gem::Version.new('7.0')
enum :main_sponsor, %i[no_sponsor food_factory transportation_company bank energy_producer]
else
enum main_sponsor: %i[no_sponsor food_factory transportation_company bank energy_producer]
end
def player_names_truncated
players.collect(&:name).join(', ')[0..32]
end
def color_enum
['white', 'black', 'red', 'green', 'blu<e>é']
end
scope :green, -> { where(color: 'red') }
scope :red, -> { where(color: 'red') }
scope :white, -> { where(color: 'white') }
rails_admin do
field :color, :color
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/abstract.rb | spec/dummy_app/app/active_record/abstract.rb | # frozen_string_literal: true
class Abstract < ActiveRecord::Base
self.abstract_class = true
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/paper_trail_test_with_custom_association.rb | spec/dummy_app/app/active_record/paper_trail_test_with_custom_association.rb | # frozen_string_literal: true
class PaperTrailTestWithCustomAssociation < ActiveRecord::Base
self.table_name = :paper_trail_tests
has_paper_trail versions: {class_name: 'Trail'}
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/nested_field_test.rb | spec/dummy_app/app/active_record/nested_field_test.rb | # frozen_string_literal: true
class NestedFieldTest < ActiveRecord::Base
belongs_to :field_test, optional: true, inverse_of: :nested_field_tests
belongs_to :another_field_test, optional: true, inverse_of: :nested_field_tests
has_one :comment, as: :commentable
has_many :deeply_nested_field_tests, inverse_of: :nested_field_test
accepts_nested_attributes_for :comment, allow_destroy: true, reject_if: proc { |attributes| attributes['content'].blank? }
accepts_nested_attributes_for :deeply_nested_field_tests, allow_destroy: true
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/ball.rb | spec/dummy_app/app/active_record/ball.rb | # frozen_string_literal: true
class Ball < ActiveRecord::Base
has_one :comment, as: :commentable
validates_presence_of :color, on: :create
def to_param
color.present? ? color.downcase.tr(' ', '-') : id
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/another_field_test.rb | spec/dummy_app/app/active_record/another_field_test.rb | # frozen_string_literal: true
class AnotherFieldTest < ActiveRecord::Base
has_many :nested_field_tests, inverse_of: :another_field_test
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/shrine_versioning_uploader.rb | spec/dummy_app/app/active_record/shrine_versioning_uploader.rb | # frozen_string_literal: true
class ShrineVersioningUploader < Shrine
plugin :activerecord
plugin :cached_attachment_data
plugin :determine_mime_type
plugin :pretty_location
plugin :remove_attachment
if Gem.loaded_specs['shrine'].version >= Gem::Version.create('3')
plugin :derivatives
Attacher.derivatives_processor do |original|
{
thumb: FakeIO.new('', filename: File.basename(original.path), content_type: File.extname(original.path)),
}
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/image.rb | spec/dummy_app/app/active_record/image.rb | # frozen_string_literal: true
class Image < ActiveRecord::Base
has_attached_file :file, styles: {medium: '300x300>', thumb: '100x100>'}
validates_attachment_presence :file
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/field_test.rb | spec/dummy_app/app/active_record/field_test.rb | # frozen_string_literal: true
class FieldTest < ActiveRecord::Base
has_many :nested_field_tests, dependent: :destroy, inverse_of: :field_test
accepts_nested_attributes_for :nested_field_tests, allow_destroy: true
has_one :comment, as: :commentable
accepts_nested_attributes_for :comment, allow_destroy: true
has_attached_file :paperclip_asset, styles: {thumb: '100x100>'}
attr_accessor :delete_paperclip_asset
before_validation { self.paperclip_asset = nil if delete_paperclip_asset == '1' }
ActiveRecord::Base.extend Dragonfly::Model
ActiveRecord::Base.extend Dragonfly::Model::Validations
dragonfly_accessor :dragonfly_asset
mount_uploader :carrierwave_asset, CarrierwaveUploader
mount_uploaders :carrierwave_assets, CarrierwaveUploader
if ActiveRecord.gem_version < Gem::Version.new('7.1')
serialize :carrierwave_assets, JSON
else
serialize :carrierwave_assets, coder: JSON
end
if defined?(ActiveStorage)
has_one_attached :active_storage_asset
attr_accessor :remove_active_storage_asset
after_save { active_storage_asset.purge if remove_active_storage_asset == '1' }
has_many_attached :active_storage_assets
attr_accessor :remove_active_storage_assets
after_save do
Array(remove_active_storage_assets).each { |id| active_storage_assets.find_by_id(id)&.purge }
end
end
include ShrineUploader.attachment(:shrine_asset)
include ShrineVersioningUploader.attachment(:shrine_versioning_asset)
has_rich_text :action_text_field if defined?(ActionText)
if ActiveRecord.gem_version >= Gem::Version.new('7.0')
enum :string_enum_field, {S: 's', M: 'm', L: 'l'}
enum :integer_enum_field, %i[small medium large]
else
enum string_enum_field: {S: 's', M: 'm', L: 'l'}
enum integer_enum_field: %i[small medium large]
end
validates :string_field, exclusion: {in: ['Invalid']} # to test file upload caching
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/user.rb | spec/dummy_app/app/active_record/user.rb | # frozen_string_literal: true
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable, :lockable and :timeoutable
devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable
if ActiveRecord.gem_version < Gem::Version.new('7.1')
serialize :roles, Array
else
serialize :roles, coder: YAML, type: Array
end
# Add Paperclip support for avatars
has_attached_file :avatar, styles: {medium: '300x300>', thumb: '100x100>'}
attr_accessor :delete_avatar
before_validation { self.avatar = nil if delete_avatar == '1' }
def attr_accessible_role
:custom_role
end
def roles_enum
%i[admin user]
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/concerns/taggable.rb | spec/dummy_app/app/active_record/concerns/taggable.rb | # frozen_string_literal: true
module Taggable
extend ActiveSupport::Concern
# dummy
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/user/confirmed.rb | spec/dummy_app/app/active_record/user/confirmed.rb | # frozen_string_literal: true
class User
class Confirmed < User
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/comment/confirmed.rb | spec/dummy_app/app/active_record/comment/confirmed.rb | # frozen_string_literal: true
class Comment
class Confirmed < Comment
default_scope { where(content: 'something') }
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/paper_trail_test/subclass_in_namespace.rb | spec/dummy_app/app/active_record/paper_trail_test/subclass_in_namespace.rb | # frozen_string_literal: true
class PaperTrailTest < ActiveRecord::Base
class SubclassInNamespace < self
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/two_level/namespaced.rb | spec/dummy_app/app/active_record/two_level/namespaced.rb | # frozen_string_literal: true
module TwoLevel
module Namespaced
def self.table_name_prefix
'two_level_namespaced_'
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/two_level/namespaced/polymorphic_association_test.rb | spec/dummy_app/app/active_record/two_level/namespaced/polymorphic_association_test.rb | # frozen_string_literal: true
module TwoLevel
module Namespaced
class PolymorphicAssociationTest < ActiveRecord::Base
has_many :comments, as: :commentable
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/app/active_record/cms/basic_page.rb | spec/dummy_app/app/active_record/cms/basic_page.rb | # frozen_string_literal: true
module Cms
class BasicPage < ActiveRecord::Base
self.table_name = :cms_basic_pages
validates :title, :content, presence: true
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/seeds.rb | spec/dummy_app/db/seeds.rb | # frozen_string_literal: true
require 'mlb'
user_model = RailsAdmin::AbstractModel.new(User)
league_model = RailsAdmin::AbstractModel.new(League)
division_model = RailsAdmin::AbstractModel.new(Division)
team_model = RailsAdmin::AbstractModel.new(Team)
player_model = RailsAdmin::AbstractModel.new(Player)
user_model.new(email: 'username@example.com', password: 'password', password_confirmation: 'password').save
MLB::Teams.all(season: Time.now.year).each do |mlb_team|
league = league_model.where(name: mlb_team.league.name).first
unless league
league = league_model.model.new(name: mlb_team.league.name)
league.save!
end
division = division_model.where(name: mlb_team.division.name).first
unless division
division = division_model.model.new(name: mlb_team.division.name, league: league)
division.save!
end
team = team_model.where(name: mlb_team.name).first
unless team
team = team_model.model.new(name: mlb_team.name, logo_url: mlb_team.link, manager: 'None', ballpark: mlb_team.venue.name, founded: mlb_team.first_year_of_play, wins: 0, losses: 0, win_percentage: 0.0, division: division)
team.save!
end
mlb_team.roster.reject { |roster| roster.jersey_number.nil? }.each do |roster|
player_model.model.new(name: roster.player.full_name, number: roster.jersey_number, position: roster.position.name, team: team).save
end
end
puts "Seeded #{league_model.count} leagues, #{division_model.count} divisions, #{team_model.count} teams and #{player_model.count} players"
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/schema.rb | spec/dummy_app/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 `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2024_09_21_171953) do
create_table "action_text_rich_texts", force: :cascade do |t|
t.string "name", null: false
t.text "body"
t.string "record_type", null: false
t.integer "record_id", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
end
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
t.integer "record_id", null: false
t.integer "blob_id", null: false
t.datetime "created_at", precision: nil, null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
end
create_table "active_storage_blobs", force: :cascade do |t|
t.string "key", null: false
t.string "filename", null: false
t.string "content_type"
t.text "metadata"
t.bigint "byte_size", null: false
t.string "checksum", null: false
t.datetime "created_at", precision: nil, null: false
t.string "service_name", default: "local", null: false
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end
create_table "active_storage_variant_records", force: :cascade do |t|
t.integer "blob_id", null: false
t.string "variation_digest", null: false
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
end
create_table "another_field_tests", force: :cascade do |t|
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
end
create_table "balls", force: :cascade do |t|
t.string "color"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.string "type"
end
create_table "categories", force: :cascade do |t|
t.integer "parent_category_id"
end
create_table "cms_basic_pages", force: :cascade do |t|
t.string "title"
t.text "content"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
end
create_table "comments", force: :cascade do |t|
t.integer "commentable_id"
t.string "commentable_type"
t.text "content"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
end
create_table "custom_versions", force: :cascade 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", precision: nil
t.index ["item_type", "item_id"], name: "index_custom_versions_on_item_type_and_item_id"
end
create_table "deeply_nested_field_tests", force: :cascade do |t|
t.integer "nested_field_test_id"
t.string "title"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.index ["nested_field_test_id"], name: "index_deeply_nested_field_tests_on_nested_field_test_id"
end
create_table "divisions", primary_key: "custom_id", force: :cascade do |t|
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.integer "custom_league_id"
t.string "name", limit: 50, null: false
end
create_table "drafts", force: :cascade do |t|
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.integer "player_id"
t.integer "team_id"
t.date "date"
t.integer "round"
t.integer "pick"
t.integer "overall"
t.string "college", limit: 100
t.text "notes"
end
create_table "fans", force: :cascade do |t|
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.string "name", limit: 100, null: false
end
create_table "fans_teams", id: false, force: :cascade do |t|
t.integer "fan_id"
t.integer "team_id"
t.date "since"
end
create_table "favorite_players", primary_key: ["fan_id", "team_id", "player_id"], force: :cascade do |t|
t.integer "fan_id", null: false
t.integer "team_id", null: false
t.integer "player_id", null: false
t.string "reason"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "field_tests", force: :cascade do |t|
t.string "string_field"
t.text "text_field"
t.integer "integer_field"
t.float "float_field"
t.decimal "decimal_field"
t.datetime "datetime_field", precision: nil
t.datetime "timestamp_field", precision: nil
t.time "time_field"
t.date "date_field"
t.boolean "boolean_field"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.string "format"
t.string "restricted_field"
t.string "protected_field"
t.string "paperclip_asset_file_name"
t.string "dragonfly_asset_uid"
t.string "carrierwave_asset"
t.string "dragonfly_asset_name"
t.string "refile_asset_id"
t.string "refile_asset_filename"
t.string "refile_asset_size"
t.string "refile_asset_content_type"
t.string "string_enum_field"
t.integer "integer_enum_field"
t.string "carrierwave_assets"
t.text "shrine_asset_data"
t.text "shrine_versioning_asset_data"
t.boolean "open"
t.boolean "non_nullable_boolean_field", default: false, null: false
end
create_table "foo_bars", force: :cascade do |t|
t.string "title"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
end
create_table "images", force: :cascade do |t|
t.string "file_file_name"
t.string "file_content_type"
t.bigint "file_file_size"
t.datetime "file_updated_at", precision: nil
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
end
create_table "leagues", force: :cascade do |t|
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.string "name", limit: 50, null: false
end
create_table "nested_field_tests", force: :cascade do |t|
t.string "title"
t.integer "field_test_id", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.integer "another_field_test_id"
end
create_table "paper_trail_tests", force: :cascade do |t|
t.string "name"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
end
create_table "players", force: :cascade do |t|
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.datetime "deleted_at", precision: nil
t.integer "team_id"
t.string "name", limit: 100, null: false
t.string "position", limit: 50
t.integer "number", null: false
t.boolean "retired", default: false
t.boolean "injured", default: false
t.date "born_on"
t.text "notes"
t.boolean "suspended", default: false
t.string "formation", default: "substitute", null: false
end
create_table "rails_admin_histories", force: :cascade do |t|
t.text "message"
t.string "username"
t.integer "item"
t.string "table"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.index ["item", "table"], name: "index_rails_admin_histories_on_item_and_table"
end
create_table "teams", force: :cascade do |t|
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.integer "division_id"
t.string "name", limit: 50
t.string "logo_url", limit: 255
t.string "manager", limit: 100, null: false
t.string "ballpark", limit: 100
t.string "mascot", limit: 100
t.integer "founded"
t.integer "wins"
t.integer "losses"
t.float "win_percentage"
t.decimal "revenue", precision: 18, scale: 2
t.string "color"
t.string "custom_field"
t.integer "main_sponsor", default: 0, null: false
end
create_table "two_level_namespaced_polymorphic_association_tests", force: :cascade do |t|
t.string "name"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
end
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at", precision: nil
t.datetime "remember_created_at", precision: nil
t.integer "sign_in_count", default: 0
t.datetime "current_sign_in_at", precision: nil
t.datetime "last_sign_in_at", precision: nil
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.string "password_salt"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.string "avatar_file_name"
t.string "avatar_content_type"
t.integer "avatar_file_size"
t.datetime "avatar_updated_at", precision: nil
t.string "roles"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
create_table "versions", force: :cascade 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", precision: nil
t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/00000000000001_create_divisions_migration.rb | spec/dummy_app/db/migrate/00000000000001_create_divisions_migration.rb | # frozen_string_literal: true
class CreateDivisionsMigration < ActiveRecord::Migration[5.0]
def self.up
create_table :divisions do |t|
t.timestamps null: false
t.integer :league_id
t.string :name, limit: 50, null: false
end
end
def self.down
drop_table(:divisions)
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20110329183136_remove_league_id_from_teams.rb | spec/dummy_app/db/migrate/20110329183136_remove_league_id_from_teams.rb | # frozen_string_literal: true
class RemoveLeagueIdFromTeams < ActiveRecord::Migration[5.0]
def self.up
remove_column :teams, :league_id
end
def self.down
add_column :teams, :league_id, :integer
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20120118122004_add_categories.rb | spec/dummy_app/db/migrate/20120118122004_add_categories.rb | # frozen_string_literal: true
class AddCategories < ActiveRecord::Migration[5.0]
def change
create_table :categories do |t|
t.integer :parent_category_id
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20110224184303_create_field_tests.rb | spec/dummy_app/db/migrate/20110224184303_create_field_tests.rb | # frozen_string_literal: true
class CreateFieldTests < ActiveRecord::Migration[5.0]
def self.up
create_table :field_tests do |t|
t.string :string_field
t.text :text_field
t.integer :integer_field
t.float :float_field
t.decimal :decimal_field
t.datetime :datetime_field
t.timestamp :timestamp_field
t.time :time_field
t.date :date_field
t.boolean :boolean_field
t.timestamps null: false
end
end
def self.down
drop_table :field_tests
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20110901150912_set_primary_key_not_null_for_divisions.rb | spec/dummy_app/db/migrate/20110901150912_set_primary_key_not_null_for_divisions.rb | # frozen_string_literal: true
class SetPrimaryKeyNotNullForDivisions < ActiveRecord::Migration[5.0]
def up
drop_table :divisions
create_table :divisions, id: false do |t|
t.timestamps null: false
t.primary_key :custom_id
t.integer :custom_league_id
t.string :name, limit: 50, null: false
end
end
def down
drop_table :divisions
create_table :divisions, primary_key: :custom_id do |t|
t.timestamps null: false
t.integer :custom_league_id
t.string :name, limit: 50, null: false
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20110103205808_create_comments.rb | spec/dummy_app/db/migrate/20110103205808_create_comments.rb | # frozen_string_literal: true
class CreateComments < ActiveRecord::Migration[5.0]
def self.up
create_table :comments do |t|
t.integer :commentable_id
t.string :commentable_type
t.text :content
t.timestamps null: false
end
end
def self.down
drop_table :comments
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/00000000000012_add_avatar_columns_to_user.rb | spec/dummy_app/db/migrate/00000000000012_add_avatar_columns_to_user.rb | # frozen_string_literal: true
class AddAvatarColumnsToUser < ActiveRecord::Migration[5.0]
def self.up
add_column :users, :avatar_file_name, :string
add_column :users, :avatar_content_type, :string
add_column :users, :avatar_file_size, :integer
add_column :users, :avatar_updated_at, :datetime
end
def self.down
remove_column :users, :avatar_file_name
remove_column :users, :avatar_content_type
remove_column :users, :avatar_file_size
remove_column :users, :avatar_updated_at
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20151027181550_change_field_test_id_to_nested_field_tests.rb | spec/dummy_app/db/migrate/20151027181550_change_field_test_id_to_nested_field_tests.rb | # frozen_string_literal: true
class ChangeFieldTestIdToNestedFieldTests < ActiveRecord::Migration[5.0]
def change
change_column :nested_field_tests, :field_test_id, :integer, null: false
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20150815102450_add_refile_to_field_tests.rb | spec/dummy_app/db/migrate/20150815102450_add_refile_to_field_tests.rb | # frozen_string_literal: true
class AddRefileToFieldTests < ActiveRecord::Migration[5.0]
def change
add_column :field_tests, :refile_asset_id, :string
add_column :field_tests, :refile_asset_filename, :string
add_column :field_tests, :refile_asset_size, :string
add_column :field_tests, :refile_asset_content_type, :string
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20140412075608_create_deeply_nested_field_tests.rb | spec/dummy_app/db/migrate/20140412075608_create_deeply_nested_field_tests.rb | # frozen_string_literal: true
class CreateDeeplyNestedFieldTests < ActiveRecord::Migration[5.0]
def change
create_table :deeply_nested_field_tests do |t|
t.belongs_to :nested_field_test
t.string :title
t.timestamps null: false
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20171229220713_add_enum_fields_to_field_tests.rb | spec/dummy_app/db/migrate/20171229220713_add_enum_fields_to_field_tests.rb | # frozen_string_literal: true
class AddEnumFieldsToFieldTests < ActiveRecord::Migration[5.0]
def change
add_column :field_tests, :string_enum_field, :string
add_column :field_tests, :integer_enum_field, :integer
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20120928075608_create_images.rb | spec/dummy_app/db/migrate/20120928075608_create_images.rb | # frozen_string_literal: true
class CreateImages < ActiveRecord::Migration[5.0]
def change
create_table :images do |t|
t.string :file_file_name
t.string :file_content_type
t.bigint :file_file_size
t.datetime :file_updated_at
t.timestamps null: false
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20111123092549_create_nested_field_tests.rb | spec/dummy_app/db/migrate/20111123092549_create_nested_field_tests.rb | # frozen_string_literal: true
class CreateNestedFieldTests < ActiveRecord::Migration[5.0]
def change
create_table :nested_field_tests do |t|
t.string :title
t.integer :field_test_id
t.timestamps null: false
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/00000000000002_create_drafts_migration.rb | spec/dummy_app/db/migrate/00000000000002_create_drafts_migration.rb | # frozen_string_literal: true
class CreateDraftsMigration < ActiveRecord::Migration[5.0]
def self.up
create_table :drafts do |t|
t.timestamps null: false
t.integer :player_id
t.integer :team_id
t.date :date
t.integer :round
t.integer :pick
t.integer :overall
t.string :college, limit: 100
t.text :notes
end
end
def self.down
drop_table :drafts
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/00000000000013_add_roles_to_user.rb | spec/dummy_app/db/migrate/00000000000013_add_roles_to_user.rb | # frozen_string_literal: true
class AddRolesToUser < ActiveRecord::Migration[5.0]
def self.up
add_column :users, :roles, :string
end
def self.down
remove_column :users, :roles
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20140826093552_create_versions.rb | spec/dummy_app/db/migrate/20140826093552_create_versions.rb | # frozen_string_literal: true
class CreateVersions < ActiveRecord::Migration[5.0]
def change
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
add_index :versions, %i[item_type item_id]
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/00000000000003_create_leagues_migration.rb | spec/dummy_app/db/migrate/00000000000003_create_leagues_migration.rb | # frozen_string_literal: true
class CreateLeaguesMigration < ActiveRecord::Migration[5.0]
def self.up
create_table :leagues do |t|
t.timestamps null: false
t.string :name, limit: 50, null: false
end
end
def self.down
drop_table :leagues
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/00000000000005_create_teams_migration.rb | spec/dummy_app/db/migrate/00000000000005_create_teams_migration.rb | # frozen_string_literal: true
class CreateTeamsMigration < ActiveRecord::Migration[5.0]
def self.up
create_table :teams do |t|
t.timestamps null: false
t.integer :league_id
t.integer :division_id
t.string :name, limit: 50
t.string :logo_url, limit: 255
t.string :manager, limit: 100, null: false
t.string :ballpark, limit: 100
t.string :mascot, limit: 100
t.integer :founded
t.integer :wins
t.integer :losses
t.float :win_percentage
end
end
def self.down
drop_table :teams
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20110901142530_rename_league_id_foreign_key_on_divisions.rb | spec/dummy_app/db/migrate/20110901142530_rename_league_id_foreign_key_on_divisions.rb | # frozen_string_literal: true
class RenameLeagueIdForeignKeyOnDivisions < ActiveRecord::Migration[5.0]
def change
rename_column :divisions, :league_id, :custom_league_id
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/00000000000006_devise_create_users.rb | spec/dummy_app/db/migrate/00000000000006_devise_create_users.rb | # frozen_string_literal: true
class DeviseCreateUsers < ActiveRecord::Migration[5.0]
def self.up
create_table :users do |t|
## Database authenticatable
t.string :email, null: false, default: ''
t.string :encrypted_password, null: false, default: ''
## Recoverable
t.string :reset_password_token
t.datetime :reset_password_sent_at
## Rememberable
t.datetime :remember_created_at
## Trackable
t.integer :sign_in_count, default: 0
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
t.string :last_sign_in_ip
## Encryptable
t.string :password_salt
## Confirmable
# t.string :confirmation_token
# t.datetime :confirmed_at
# t.datetime :confirmation_sent_at
# t.string :unconfirmed_email # Only if using reconfirmable
## Lockable
# t.integer :failed_attempts, default: 0 # Only if lock strategy is :failed_attempts
# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at
# Token authenticatable
# t.string :authentication_token
t.timestamps null: false
end
add_index :users, :email, unique: true
add_index :users, :reset_password_token, unique: true
end
def self.down
drop_table :users
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20110328193014_create_cms_basic_pages.rb | spec/dummy_app/db/migrate/20110328193014_create_cms_basic_pages.rb | # frozen_string_literal: true
class CreateCmsBasicPages < ActiveRecord::Migration[5.0]
def self.up
create_table :cms_basic_pages do |t|
t.string :title
t.text :content
t.timestamps null: false
end
end
def self.down
drop_table :cms_basic_pages
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20160728152942_add_main_sponsor_to_teams.rb | spec/dummy_app/db/migrate/20160728152942_add_main_sponsor_to_teams.rb | # frozen_string_literal: true
class AddMainSponsorToTeams < ActiveRecord::Migration[5.0]
def change
add_column :teams, :main_sponsor, :integer, default: 0, null: false
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20110901131551_change_division_primary_key.rb | spec/dummy_app/db/migrate/20110901131551_change_division_primary_key.rb | # frozen_string_literal: true
class ChangeDivisionPrimaryKey < ActiveRecord::Migration[5.0]
def up
drop_table :divisions
create_table :divisions, primary_key: 'custom_id' do |t|
t.timestamps null: false
t.integer :league_id
t.string :name, limit: 50, null: false
end
end
def down
drop_table :divisions
create_table :divisions do |t|
t.timestamps null: false
t.integer :league_id
t.string :name, limit: 50, null: false
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20201127111952_update_active_storage_tables.rb | spec/dummy_app/db/migrate/20201127111952_update_active_storage_tables.rb | # frozen_string_literal: true
class UpdateActiveStorageTables < ActiveRecord::Migration[5.0]
def change
add_column :active_storage_blobs, :service_name, :string, null: false, default: 'local'
create_table :active_storage_variant_records do |t|
t.belongs_to :blob, null: false, index: false
t.string :variation_digest, null: false
t.index %i[blob_id variation_digest], name: 'index_active_storage_variant_records_uniqueness', unique: true
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20210811121027_create_two_level_namespaced_polymorphic_association_tests.rb | spec/dummy_app/db/migrate/20210811121027_create_two_level_namespaced_polymorphic_association_tests.rb | # frozen_string_literal: true
class CreateTwoLevelNamespacedPolymorphicAssociationTests < ActiveRecord::Migration[5.0]
def change
create_table :two_level_namespaced_polymorphic_association_tests do |t|
t.string :name
t.timestamps
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20211011235734_add_bool_field_open.rb | spec/dummy_app/db/migrate/20211011235734_add_bool_field_open.rb | # frozen_string_literal: true
class AddBoolFieldOpen < ActiveRecord::Migration[6.0]
def change
add_column :field_tests, :open, :boolean
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/00000000000010_add_revenue_to_team_migration.rb | spec/dummy_app/db/migrate/00000000000010_add_revenue_to_team_migration.rb | # frozen_string_literal: true
class AddRevenueToTeamMigration < ActiveRecord::Migration[5.0]
def self.up
add_column :teams, :revenue, :decimal, precision: 18, scale: 2
end
def self.down
remove_column :teams, :revenue
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20110123042530_rename_histories_to_rails_admin_histories.rb | spec/dummy_app/db/migrate/20110123042530_rename_histories_to_rails_admin_histories.rb | # frozen_string_literal: true
class RenameHistoriesToRailsAdminHistories < ActiveRecord::Migration[5.0]
def self.up
rename_table :histories, :rails_admin_histories
end
def self.down
rename_table :rails_admin_histories, :histories
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/00000000000007_create_histories_table.rb | spec/dummy_app/db/migrate/00000000000007_create_histories_table.rb | # frozen_string_literal: true
class CreateHistoriesTable < ActiveRecord::Migration[5.0]
def self.up
create_table :histories do |t|
t.string :message # title, name, or object_id
t.string :username
t.integer :item
t.string :table
t.timestamps null: false
end
add_index(:histories, %i[item table])
end
def self.down
drop_table :histories
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20240921171953_add_non_nullable_boolean_field.rb | spec/dummy_app/db/migrate/20240921171953_add_non_nullable_boolean_field.rb | # frozen_string_literal: true
class AddNonNullableBooleanField < ActiveRecord::Migration[6.0]
def change
add_column :field_tests, :non_nullable_boolean_field, :boolean, null: false, default: false
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20220416102741_create_composite_key_tables.rb | spec/dummy_app/db/migrate/20220416102741_create_composite_key_tables.rb | # frozen_string_literal: true
class CreateCompositeKeyTables < ActiveRecord::Migration[6.0]
def change
add_column :fans_teams, :since, :date
create_table :favorite_players, primary_key: %i[fan_id team_id player_id] do |t|
t.integer :fan_id, null: false
t.integer :team_id, null: false
t.integer :player_id, null: false
t.string :reason
t.timestamps
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20110831090841_add_protected_field_and_restricted_field_to_field_tests.rb | spec/dummy_app/db/migrate/20110831090841_add_protected_field_and_restricted_field_to_field_tests.rb | # frozen_string_literal: true
class AddProtectedFieldAndRestrictedFieldToFieldTests < ActiveRecord::Migration[5.0]
def change
add_column :field_tests, :restricted_field, :string
add_column :field_tests, :protected_field, :string
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20190531065324_create_action_text_tables.action_text.rb | spec/dummy_app/db/migrate/20190531065324_create_action_text_tables.action_text.rb | # frozen_string_literal: true
class CreateActionTextTables < ActiveRecord::Migration[5.0]
def change
create_table :action_text_rich_texts do |t|
t.string :name, null: false
t.text :body, size: :long
t.references :record, null: false, polymorphic: true, index: false
t.timestamps
t.index %i[record_type record_id name], name: 'index_action_text_rich_texts_uniqueness', unique: true
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/00000000000004_create_players_migration.rb | spec/dummy_app/db/migrate/00000000000004_create_players_migration.rb | # frozen_string_literal: true
class CreatePlayersMigration < ActiveRecord::Migration[5.0]
def self.up
create_table :players do |t|
t.timestamps null: false
t.datetime :deleted_at
t.integer :team_id
t.string :name, limit: 100, null: false
t.string :position, limit: 50
t.integer :number, null: false
t.boolean :retired, default: false
t.boolean :injured, default: false
t.date :born_on
t.text :notes
end
end
def self.down
drop_table :players
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20210812115908_create_custom_versions.rb | spec/dummy_app/db/migrate/20210812115908_create_custom_versions.rb | # frozen_string_literal: true
class CreateCustomVersions < ActiveRecord::Migration[5.0]
def change
create_table :custom_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
add_index :custom_versions, %i[item_type item_id]
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20101223222233_create_rel_tests.rb | spec/dummy_app/db/migrate/20101223222233_create_rel_tests.rb | # frozen_string_literal: true
class CreateRelTests < ActiveRecord::Migration[5.0]
def self.up
create_table :rel_tests do |t|
t.integer :league_id
t.integer :division_id, null: false
t.integer :player_id
t.timestamps null: false
end
end
def self.down
drop_table :rel_tests
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20140826093220_create_paper_trail_tests.rb | spec/dummy_app/db/migrate/20140826093220_create_paper_trail_tests.rb | # frozen_string_literal: true
class CreatePaperTrailTests < ActiveRecord::Migration[5.0]
def change
create_table :paper_trail_tests do |t|
t.string :name
t.timestamps null: false
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/00000000000011_add_suspended_to_player_migration.rb | spec/dummy_app/db/migrate/00000000000011_add_suspended_to_player_migration.rb | # frozen_string_literal: true
class AddSuspendedToPlayerMigration < ActiveRecord::Migration[5.0]
def self.up
add_column :players, :suspended, :boolean, default: false
end
def self.down
remove_column :players, :suspended
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20111130075338_add_dragonfly_asset_name_to_field_tests.rb | spec/dummy_app/db/migrate/20111130075338_add_dragonfly_asset_name_to_field_tests.rb | # frozen_string_literal: true
class AddDragonflyAssetNameToFieldTests < ActiveRecord::Migration[5.0]
def change
add_column :field_tests, :dragonfly_asset_name, :string
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20180707101855_add_carrierwave_assets_to_field_tests.rb | spec/dummy_app/db/migrate/20180707101855_add_carrierwave_assets_to_field_tests.rb | # frozen_string_literal: true
class AddCarrierwaveAssetsToFieldTests < ActiveRecord::Migration[5.0]
def change
add_column :field_tests, :carrierwave_assets, :string, after: :carrierwave_asset
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/00000000000014_add_color_to_team_migration.rb | spec/dummy_app/db/migrate/00000000000014_add_color_to_team_migration.rb | # frozen_string_literal: true
class AddColorToTeamMigration < ActiveRecord::Migration[5.0]
def self.up
add_column :teams, :color, :string
end
def self.down
remove_column :teams, :color
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20181029101829_add_shrine_data_to_field_tests.rb | spec/dummy_app/db/migrate/20181029101829_add_shrine_data_to_field_tests.rb | # frozen_string_literal: true
class AddShrineDataToFieldTests < ActiveRecord::Migration[5.0]
def change
add_column :field_tests, :shrine_asset_data, :text
add_column :field_tests, :shrine_versioning_asset_data, :text
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20120117151733_add_custom_field_to_teams.rb | spec/dummy_app/db/migrate/20120117151733_add_custom_field_to_teams.rb | # frozen_string_literal: true
class AddCustomFieldToTeams < ActiveRecord::Migration[5.0]
def change
add_column :teams, :custom_field, :string
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20111115041025_add_type_to_balls.rb | spec/dummy_app/db/migrate/20111115041025_add_type_to_balls.rb | # frozen_string_literal: true
class AddTypeToBalls < ActiveRecord::Migration[5.0]
def change
add_column :balls, :type, :string
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20111215083258_create_foo_bars.rb | spec/dummy_app/db/migrate/20111215083258_create_foo_bars.rb | # frozen_string_literal: true
class CreateFooBars < ActiveRecord::Migration[5.0]
def change
create_table :foo_bars do |t|
t.string :title
t.timestamps null: false
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20111108143642_add_dragonfly_and_carrierwave_to_field_tests.rb | spec/dummy_app/db/migrate/20111108143642_add_dragonfly_and_carrierwave_to_field_tests.rb | # frozen_string_literal: true
class AddDragonflyAndCarrierwaveToFieldTests < ActiveRecord::Migration[5.0]
def change
add_column :field_tests, :paperclip_asset_file_name, :string
add_column :field_tests, :dragonfly_asset_uid, :string
add_column :field_tests, :carrierwave_asset, :string
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/00000000000009_create_fans_teams_migration.rb | spec/dummy_app/db/migrate/00000000000009_create_fans_teams_migration.rb | # frozen_string_literal: true
class CreateFansTeamsMigration < ActiveRecord::Migration[5.0]
def self.up
create_table :fans_teams, id: false do |t|
t.integer :fan_id, :team_id
end
end
def self.down
drop_table :fans_teams
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20110714095433_create_balls.rb | spec/dummy_app/db/migrate/20110714095433_create_balls.rb | # frozen_string_literal: true
class CreateBalls < ActiveRecord::Migration[5.0]
def self.up
create_table :balls, force: true do |t|
t.string :color
t.timestamps null: false
end
end
def self.down
drop_table :balls
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20180701084251_create_active_storage_tables.active_storage.rb | spec/dummy_app/db/migrate/20180701084251_create_active_storage_tables.active_storage.rb | # frozen_string_literal: true
# This migration comes from active_storage (originally 20170806125915)
class CreateActiveStorageTables < ActiveRecord::Migration[5.0]
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 :metadata
if t.respond_to? :bigint
t.bigint :byte_size, null: false
else
t.integer :byte_size, null: false
end
t.string :checksum, null: false
t.datetime :created_at, null: false
t.index [:key], unique: true
end
create_table :active_storage_attachments do |t|
t.string :name, null: false
t.references :record, null: false, polymorphic: true, index: false
t.references :blob, null: false
t.datetime :created_at, null: false
t.index %i[record_type record_id name blob_id], name: 'index_active_storage_attachments_uniqueness', unique: true
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20160728153058_add_formation_to_players.rb | spec/dummy_app/db/migrate/20160728153058_add_formation_to_players.rb | # frozen_string_literal: true
class AddFormationToPlayers < ActiveRecord::Migration[5.0]
def change
add_column :players, :formation, :string, default: 'substitute', null: false
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20120319041705_drop_rel_tests.rb | spec/dummy_app/db/migrate/20120319041705_drop_rel_tests.rb | # frozen_string_literal: true
class DropRelTests < ActiveRecord::Migration[5.0]
def self.up
drop_table :rel_tests
end
def self.down
create_table :rel_tests do |t|
t.integer :league_id
t.integer :division_id, null: false
t.integer :player_id
t.timestamps null: false
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20110607152842_add_format_to_field_test.rb | spec/dummy_app/db/migrate/20110607152842_add_format_to_field_test.rb | # frozen_string_literal: true
class AddFormatToFieldTest < ActiveRecord::Migration[5.0]
def self.up
add_column :field_tests, :format, :string
end
def self.down
remove_column :field_tests, :format
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/00000000000008_create_fans_migration.rb | spec/dummy_app/db/migrate/00000000000008_create_fans_migration.rb | # frozen_string_literal: true
class CreateFansMigration < ActiveRecord::Migration[5.0]
def self.up
create_table :fans do |t|
t.timestamps null: false
t.string :name, limit: 100, null: false
end
end
def self.down
drop_table :fans
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20110901154834_change_length_for_rails_admin_histories.rb | spec/dummy_app/db/migrate/20110901154834_change_length_for_rails_admin_histories.rb | # frozen_string_literal: true
class ChangeLengthForRailsAdminHistories < ActiveRecord::Migration[5.0]
def up
change_column :rails_admin_histories, :message, :text
end
def down
change_column :rails_admin_histories, :message, :string
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/db/migrate/20120720075608_create_another_field_tests.rb | spec/dummy_app/db/migrate/20120720075608_create_another_field_tests.rb | # frozen_string_literal: true
class CreateAnotherFieldTests < ActiveRecord::Migration[5.0]
def change
create_table :another_field_tests do |t|
t.timestamps null: false
end
add_column :nested_field_tests, :another_field_test_id, :integer
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/lib/does_not_load_autoload_paths_not_in_eager_load.rb | spec/dummy_app/lib/does_not_load_autoload_paths_not_in_eager_load.rb | # frozen_string_literal: true
module DoesNotLoadAutoloadPathsNotInEagerLoad
raise 'This file is in app.paths.autoload but not app.paths.eager_load and ' \
' should not be autoloaded by rails_admin'
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/config/application.rb | spec/dummy_app/config/application.rb | # frozen_string_literal: true
require File.expand_path('boot', __dir__)
require 'action_controller/railtie'
require 'action_mailer/railtie'
begin
require CI_ORM.to_s
require "#{CI_ORM}/railtie"
rescue LoadError
# ignore errors
end
require 'active_storage/engine' if CI_ORM == :active_record
require 'action_text/engine' if CI_ORM == :active_record
case CI_ASSET
when :webpacker
require 'webpacker'
when :sprockets, :webpack
require 'sprockets/railtie'
when :importmap
require 'sprockets/railtie'
require 'importmap-rails'
when :vite
require 'vite_rails'
end
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups, CI_ORM)
module DummyApp
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
config.load_defaults Rails.version[0, 3]
(CI_TARGET_ORMS - [CI_ORM]).each { |orm| config.paths.add "app/#{orm}", eager_load: false }
config.eager_load_paths = (config.try(:all_eager_load_paths) || config.eager_load_paths).reject { |p| p =~ %r{/app/([^/]+)} && !%W[controllers jobs locales mailers #{CI_ORM}].include?(Regexp.last_match[1]) }
config.eager_load_paths += %W[#{config.root}/app/eager_loaded]
config.autoload_paths += %W[#{config.root}/lib]
config.i18n.load_path += Dir[Rails.root.join('app', 'locales', '*.{rb,yml}').to_s]
if CI_ORM == :active_record
config.active_record.time_zone_aware_types = %i[datetime time]
config.active_record.yaml_column_permitted_classes = [Symbol] if [ActiveRecord::Base, ActiveRecord].any? { |klass| klass.respond_to?(:yaml_column_permitted_classes=) }
end
config.active_storage.service = :local if defined?(ActiveStorage)
config.active_storage.replace_on_assign_to_many = false if defined?(ActiveStorage) && ActiveStorage.version < Gem::Version.create('6.1')
case CI_ASSET
when :webpack
config.assets.precompile += %w[rails_admin.js rails_admin.css]
when :importmap
config.assets.paths << RailsAdmin::Engine.root.join('src')
config.assets.precompile += %w[rails_admin.js rails_admin.css]
config.importmap.cache_sweepers << RailsAdmin::Engine.root.join('src')
end
initializer :ignore_unused_assets_path, after: :append_assets_path, group: :all do |app|
case CI_ASSET
when :webpack, :importmap
app.config.assets.paths.delete(Rails.root.join('app', 'assets', 'javascripts').to_s)
when :sprockets
app.config.assets.paths.delete(Rails.root.join('app', 'assets', 'builds').to_s)
end
end
end
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/config/environment.rb | spec/dummy_app/config/environment.rb | # frozen_string_literal: true
# Load the Rails application.
require File.expand_path('application', __dir__)
# Initialize the Rails application.
DummyApp::Application.initialize!
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/config/puma.rb | spec/dummy_app/config/puma.rb | # frozen_string_literal: true
threads 0, ENV.fetch('RAILS_MAX_THREADS', 3)
port ENV.fetch('PORT', 3000)
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/config/routes.rb | spec/dummy_app/config/routes.rb | # frozen_string_literal: true
DummyApp::Application.routes.draw do
# Needed for :show_in_app tests
resources :players, only: [:show]
devise_for :users
mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
root to: 'rails_admin/main#dashboard'
end
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
railsadminteam/rails_admin | https://github.com/railsadminteam/rails_admin/blob/d8e0809ea4b38415ace5b0d038fca317d805a3c1/spec/dummy_app/config/importmap.rb | spec/dummy_app/config/importmap.rb | # frozen_string_literal: true
# Pin npm packages by running ./bin/importmap
pin 'application', preload: true
pin '@hotwired/turbo-rails', to: 'https://ga.jspm.io/npm:@hotwired/turbo-rails@7.1.3/app/javascript/turbo/index.js'
pin '@rails/ujs', to: 'https://ga.jspm.io/npm:@rails/ujs@6.0.5/lib/assets/compiled/rails-ujs.js'
pin '@hotwired/turbo', to: 'https://ga.jspm.io/npm:@hotwired/turbo@7.1.0/dist/turbo.es2017-esm.js'
pin '@rails/actioncable/src', to: 'https://ga.jspm.io/npm:@rails/actioncable@7.0.3/src/index.js'
| ruby | MIT | d8e0809ea4b38415ace5b0d038fca317d805a3c1 | 2026-01-04T15:39:16.877032Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.