Sha256: 808db4af7455e629b4f965023e5ed6d6ede16425fe8cbb1c9eb3ca6c4597572d

Contents?: true

Size: 503 Bytes

Versions: 1

Compression:

Stored size: 503 Bytes

Contents

# this is needed for now to make mass assignment security compatible with the translation of globalize3
Globalize::ActiveRecord::Translation.class_eval do
  attr_accessible :locale
end

class Illustration < ActiveRecord::Base

  attr_accessible :image, :name

  validates_presence_of :name

  translates :name

  mount_uploader :image, ImageUploader

  def to_param
    name ? "#{id}-#{name.to_url}" : id
  end

  scope :by_recent, :order => 'updated_at desc'
  scope :alphabetically, order('name')
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tkh_illustrations-0.2.5 app/models/illustration.rb