Sha256: b4a3b18d326ea22124bf934974657a3cce8dc56db6a5caace81a837fc15fab8b

Contents?: true

Size: 839 Bytes

Versions: 1

Compression:

Stored size: 839 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
end

class Dummy < ActiveRecord::Base
end

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

class Manager < Member
  has_many :developers
end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
foreign_key_validation-0.0.7 spec/support/load_models.rb