Sha256: fde6c636ef98f7541933a441719f5195894653d3f16ff308910f9c386a00532a

Contents?: true

Size: 290 Bytes

Versions: 3

Compression:

Stored size: 290 Bytes

Contents

class Download < ActiveRecord::Base

  validates_presence_of :name
  translates :name

  mount_uploader :thing, ThingUploader

  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

3 entries across 3 versions & 1 rubygems

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