Sha256: bc6c8e5bfcaa285a3c2b2bf1c9a3910b96ae48d9eb21fbc3381e91c23f441b52

Contents?: true

Size: 847 Bytes

Versions: 23

Compression:

Stored size: 847 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),
    "asset" => Lalala::Markdown::Handlers::LazyAsset.new,
    "vimeo"   => Lalala::Markdown::Handlers::Vimeo.new(color: "5c2d91", show_title: 1)
  }

  # 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

23 entries across 23 versions & 1 rubygems

Version Path
lalala-4.1.0.dev.425 test/dummy/app/models/article.rb
lalala-4.1.0.dev.420 test/dummy/app/models/article.rb
lalala-4.1.0.dev.419 test/dummy/app/models/article.rb
lalala-4.1.0.dev.418 test/dummy/app/models/article.rb
lalala-4.1.0.dev.417 test/dummy/app/models/article.rb
lalala-4.1.0.dev.415 test/dummy/app/models/article.rb
lalala-4.1.0.dev.414 test/dummy/app/models/article.rb
lalala-4.1.0.dev.413 test/dummy/app/models/article.rb
lalala-4.1.0.dev.412 test/dummy/app/models/article.rb
lalala-4.1.0.dev.411 test/dummy/app/models/article.rb
lalala-4.1.0.dev.410 test/dummy/app/models/article.rb
lalala-4.1.0.dev.409 test/dummy/app/models/article.rb
lalala-4.1.0.dev.408 test/dummy/app/models/article.rb
lalala-4.1.0.dev.398 test/dummy/app/models/article.rb
lalala-4.1.0.dev.397 test/dummy/app/models/article.rb
lalala-4.1.0.dev.394 test/dummy/app/models/article.rb
lalala-4.1.0.dev.392 test/dummy/app/models/article.rb
lalala-4.1.0.dev.391 test/dummy/app/models/article.rb
lalala-4.1.0.dev.390 test/dummy/app/models/article.rb
lalala-4.1.0.dev.389 test/dummy/app/models/article.rb