Sha256: f7d222b2d103733b67204207d693586f98e7d162d3842baca7bc09a71baea5c2

Contents?: true

Size: 701 Bytes

Versions: 1

Compression:

Stored size: 701 Bytes

Contents

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

  # Translations
  translates :title, :body

  # Assets
  has_one_asset :poster_image, "images"
  has_many_assets :images, "images"
  has_many_assets :downloads, "downloads"

  # 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

1 entries across 1 versions & 1 rubygems

Version Path
lalala-4.1.0.dev.358 test/dummy/app/models/article.rb