Sha256: f4e3cb5c8aeb3386fe74a04c3d1eb5492a8cb9efd4317db04886f87951baa697

Contents?: true

Size: 351 Bytes

Versions: 8

Compression:

Stored size: 351 Bytes

Contents

class Tag < ActiveRecord::Base
  has_many :taggings
  has_many :taggables, :through => :taggings
  has_one  :tagging

  has_many :tagged_posts, :through => :taggings, :source => 'taggable', :source_type => 'Post'
end

class OrderedTag < Tag
  self.table_name = "tags"

  has_many :taggings, -> { order('taggings.id DESC') }, foreign_key: 'tag_id'
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ibm_db-5.2.0 test/models/tag.rb
ibm_db-5.1.0 test/models/tag.rb
ibm_db-5.0.5 test/models/tag.rb
ibm_db-5.0.4 test/models/tag.rb
ibm_db-5.0.3 test/models/tag.rb
ibm_db-5.0.2 test/models/tag.rb
ibm_db-4.0.0-x86-mingw32 test/models/tag.rb
ibm_db-4.0.0 test/models/tag.rb