Sha256: e77b2e2485fb2eb94d04e07b1850c1890dce655b833c5bb82a19ab438bbaf6ab

Contents?: true

Size: 888 Bytes

Versions: 4

Compression:

Stored size: 888 Bytes

Contents

require "active_record"

class User < ActiveRecord::Base
  has_many :projects
  has_many :ideas
  has_many :managers
  has_many :developers
  has_many :comments
  has_many :issues
  has_many :ideas
end

class Project < ActiveRecord::Base
  belongs_to :user
  belongs_to :member
  has_many :ideas
  has_many :issues
end

class Idea < ActiveRecord::Base
  belongs_to :project
  belongs_to :user
end

class Issue < ActiveRecord::Base
  belongs_to :project
  belongs_to :user
  has_many :comments
end

class Comment < ActiveRecord::Base
  belongs_to :issue
  belongs_to :user
  belongs_to :member
end

class Dummy < ActiveRecord::Base
end

class Member < ActiveRecord::Base
  belongs_to :user
  has_many :projects
  has_many :comments
end

class Manager < Member
  has_many :developers
end

class Developer < Member
  belongs_to :boss, class_name: "Manager", foreign_key: :custom_boss_id
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
foreign_key_validation-1.1.1 spec/support/load_models.rb
foreign_key_validation-1.1.0 spec/support/load_models.rb
foreign_key_validation-1.0.1 spec/support/load_models.rb
foreign_key_validation-1.0.0 spec/support/load_models.rb