Sha256: 9c41db1769beeab030c131acebad620b4f9ef1493d6bf58eaab0d2321bf7044f

Contents?: true

Size: 458 Bytes

Versions: 20

Compression:

Stored size: 458 Bytes

Contents

class Song < ActiveRecord::Base
  extend Enumerize
  extend FriendlyId

  attr_accessible :author, :mp3, :slug, :status, :title

  enumerize :status, in: [:published, :unpublished], default: :published, predicates: true
  friendly_id :title, use: :slugged

  mount_uploader :mp3, Songs::SongUploader

  validates_presence_of :title
  validates_presence_of :author

  scope :published, where(status: :published)

  belongs_to :related, polymorphic: true

end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
mix-rails-0.26.3 mix-rails-songs/app/models/song.rb
mix-rails-songs-0.26.3 app/models/song.rb
mix-rails-0.26.2 mix-rails-songs/app/models/song.rb
mix-rails-songs-0.26.2 app/models/song.rb
mix-rails-0.26.1 mix-rails-songs/app/models/song.rb
mix-rails-songs-0.26.1 app/models/song.rb
mix-rails-0.26.0 mix-rails-songs/app/models/song.rb
mix-rails-songs-0.26.0 app/models/song.rb
mix-rails-0.25.1 mix-rails-songs/app/models/song.rb
mix-rails-songs-0.25.1 app/models/song.rb
mix-rails-0.25.0 mix-rails-songs/app/models/song.rb
mix-rails-songs-0.25.0 app/models/song.rb
mix-rails-0.24.1 mix-rails-songs/app/models/song.rb
mix-rails-songs-0.24.1 app/models/song.rb
mix-rails-0.24.0 mix-rails-songs/app/models/song.rb
mix-rails-songs-0.24.0 app/models/song.rb
mix-rails-0.23.1 mix-rails-songs/app/models/song.rb
mix-rails-songs-0.23.1 app/models/song.rb
mix-rails-0.23.0 mix-rails-songs/app/models/song.rb
mix-rails-songs-0.23.0 app/models/song.rb