Sha256: 2bf2cb25619a2bfad914e378a72b819e22b5309405dba10a1633f0478d5681c0

Contents?: true

Size: 412 Bytes

Versions: 6

Compression:

Stored size: 412 Bytes

Contents

class User < ActiveRecord::Base
  has_one :company, foreign_key: :owner_id
  has_one :address, as: :addressable

  has_and_belongs_to_many :users, join_table: :purchases, association_foreign_key: :present_id, foreign_key: :buyer_id

  has_many :projects
  has_many :favourites
  has_many :favourite_projects, through: :favourites, source: :favourable, source_type: 'Project'

  validates_uniqueness_of :name
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lol_dba-2.4.0 spec/fixtures/app/models/user.rb
lol_dba-2.2.0 spec/fixtures/app/models/user.rb
lol_dba-2.1.9 spec/fixtures/app/models/user.rb
lol_dba-2.1.8 spec/fixtures/app/models/user.rb
lol_dba-2.1.7 spec/fixtures/app/models/user.rb
lol_dba-2.1.6 spec/fixtures/app/models/user.rb