Sha256: 4b2d7aaef249882e87fc710d62e90750a1fedc154a6d1d57a93e5ef9b667693f

Contents?: true

Size: 425 Bytes

Versions: 9

Compression:

Stored size: 425 Bytes

Contents

class Article < ActiveRecord::Base
  attr_accessible :body, :title, :category, :tag_ids

  has_one_asset :image

  # Translations
  translates :title, :body

  # Validations
  validates :title, presence: true

  # Scopes
  scope :catA, where(:category => "A")
  scope :catB, where(:category => "B")
  scope :catC, where(:category => "C")

  # Bindings
  has_and_belongs_to_many :tags

  def get_tags
    self.tags
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
lalala-4.0.0.dev.269 test/dummy/app/models/article.rb
lalala-4.0.0.dev.267 test/dummy/app/models/article.rb
lalala-4.0.0.dev.264 test/dummy/app/models/article.rb
lalala-4.0.0.dev.260 test/dummy/app/models/article.rb
lalala-4.0.0.dev.258 test/dummy/app/models/article.rb
lalala-4.0.0.dev.256 test/dummy/app/models/article.rb
lalala-4.0.0.dev.255 test/dummy/app/models/article.rb
lalala-4.0.0.dev.254 test/dummy/app/models/article.rb
lalala-4.0.0.dev.249 test/dummy/app/models/article.rb