Sha256: d77c8713fef297a90f433e015be96a4f18bd412ec2cbf5af1dc8858f1a9db23c

Contents?: true

Size: 636 Bytes

Versions: 16

Compression:

Stored size: 636 Bytes

Contents

module Writefully
  class Post < ActiveRecord::Base
    self.table_name = "writefully_posts"

    extend FriendlyId
    include Writefully::Postable

    friendly_id :title, use: :slugged

    has_many :taggings, dependent: :destroy
    wf_taxonomize :tags, through: :taggings

    belongs_to :authorship
    belongs_to :translation_source, class_name: "Writefully::Post"
    belongs_to :site

    has_many :translations, class_name: "Writefully::Post", foreign_key: :translation_source_id

    scope :by_site, -> (site_id) { where(site_id: site_id) }

    def details
      Hashie::Mash.new(read_attribute(:details))
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
writefully-0.8.2 app/models/writefully/post.rb
writefully-0.8.1 app/models/writefully/post.rb
writefully-0.8.0 app/models/writefully/post.rb
writefully-0.7.1 app/models/writefully/post.rb
writefully-0.6.12 app/models/writefully/post.rb
writefully-0.6.11 app/models/writefully/post.rb
writefully-0.6.10 app/models/writefully/post.rb
writefully-0.6.9 app/models/writefully/post.rb
writefully-0.6.7 app/models/writefully/post.rb
writefully-0.6.6 app/models/writefully/post.rb
writefully-0.6.5 app/models/writefully/post.rb
writefully-0.6.4 app/models/writefully/post.rb
writefully-0.6.3 app/models/writefully/post.rb
writefully-0.6.2 app/models/writefully/post.rb
writefully-0.5.1 app/models/writefully/post.rb
writefully-0.5.0 app/models/writefully/post.rb