Sha256: ed05eaddbf122c47a6da0c69b0ca8f8f51fb871ca404266e1d294a7e5f4b8328

Contents?: true

Size: 279 Bytes

Versions: 1

Compression:

Stored size: 279 Bytes

Contents

class Monologue::Tag < ActiveRecord::Base
  attr_accessible :name

  validates :name, uniqueness: true,presence: true
  has_many :taggings
  has_many :posts,through: :taggings

  def posts_with_tag
    self.posts.published
  end

  def frequency
    posts_with_tag.size
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
monologue-0.3.0 app/models/monologue/tag.rb