Sha256: 5e5521b7c0bb6fda3dd855f56fc3eea7a6471807ba2850ef5a448ffcc998b2d5

Contents?: true

Size: 435 Bytes

Versions: 3

Compression:

Stored size: 435 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

  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

3 entries across 3 versions & 1 rubygems

Version Path
tkh_illustrations-0.9.6 app/models/header.rb
tkh_illustrations-0.9.5 app/models/header.rb
tkh_illustrations-0.9.4 app/models/header.rb