Sha256: d28fd221cf370162aa1c46a58a24faa72d89bdadff186ffdc0723247b241530c

Contents?: true

Size: 595 Bytes

Versions: 14

Compression:

Stored size: 595 Bytes

Contents

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

  has_one_asset :image

  # Translations
  translates :title, :body

  # Validations
  validates :title, presence: true

  # Markdown columns
  markdown :body, tables: true, link_schemes: {
    "youtube" => Lalala::Markdown::Handlers::YouTube.new(width: 520, height: 292)
  }

  # 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

14 entries across 14 versions & 1 rubygems

Version Path
lalala-4.0.0.dev.416 test/dummy/app/models/article.rb
lalala-4.0.0.dev.407 test/dummy/app/models/article.rb
lalala-4.0.0.dev.396 test/dummy/app/models/article.rb
lalala-4.0.0.dev.395 test/dummy/app/models/article.rb
lalala-4.0.0.dev.393 test/dummy/app/models/article.rb
lalala-4.0.0.dev.388 test/dummy/app/models/article.rb
lalala-4.0.0.dev.385 test/dummy/app/models/article.rb
lalala-4.0.0.dev.382 test/dummy/app/models/article.rb
lalala-4.0.0.dev.374 test/dummy/app/models/article.rb
lalala-4.0.0.dev.372 test/dummy/app/models/article.rb
lalala-4.0.0.dev.368 test/dummy/app/models/article.rb
lalala-4.0.0.dev.366 test/dummy/app/models/article.rb
lalala-4.0.0.dev.357 test/dummy/app/models/article.rb
lalala-4.0.0.dev.354 test/dummy/app/models/article.rb