Sha256: 9289d0c8297bfe7a7bc54e22941d2e985b959b201413597151e010dc458d790f

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

# encoding: UTF-8

class Post < ActiveRecord::Base
  include ArelHelpers::ArelTable
  has_many :comments
  has_many :favorites
end

class Comment < ActiveRecord::Base
  include ArelHelpers::ArelTable
  belongs_to :post
  belongs_to :author
end

class Author < ActiveRecord::Base
  include ArelHelpers::ArelTable
  has_one :comment
  has_and_belongs_to_many :collab_posts
end

class Favorite < ActiveRecord::Base
  include ArelHelpers::ArelTable
  belongs_to :post
end

class CollabPost < ActiveRecord::Base
  include ArelHelpers::ArelTable
  has_and_belongs_to_many :authors
end

class Card < ActiveRecord::Base
  has_many :card_locations
end

class CardLocation < ActiveRecord::Base
  belongs_to :location
  belongs_to :card, polymorphic: true
end

class Location < ActiveRecord::Base
  has_many :card_locations
  has_many :community_tickets, {
    through: :card_locations, source: :card, source_type: 'CommunityTicket'
  }
end

class CommunityTicket < ActiveRecord::Base
  has_many :card_locations, as: :card, source_type: 'CommunityTicket'
  has_many :locations, through: :card_locations
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
arel-helpers-2.5.0 spec/env/models.rb
arel-helpers-2.4.0 spec/env/models.rb
arel-helpers-2.3.0 spec/env/models.rb
arel-helpers-2.2.0 spec/env/models.rb