Sha256: b03602035d8f945d8813df2d65240dae2fdad6887759749f0458ce271e865da0

Contents?: true

Size: 468 Bytes

Versions: 6

Compression:

Stored size: 468 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 Header < ActiveRecord::Base
  
  attr_accessible :photo, :name
  
  validates_presence_of :name
  
  translates :name
  
  mount_uploader :photo, PhotoUploader
  
  def to_param
    name ? "#{id}-#{name.to_url}" : id
  end

  scope :by_recent, :order => 'updated_at desc'
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tkh_illustrations-0.2.5 app/models/header.rb
tkh_illustrations-0.9 app/models/header.rb
tkh_illustrations-0.2.4 app/models/header.rb
tkh_illustrations-0.2.3 app/models/header.rb
tkh_illustrations-0.2 app/models/header.rb
tkh_illustrations-0.1 app/models/header.rb