photomix/app/models/collection.rb

18 lines
386 B
Ruby
Raw Normal View History

2009-06-03 01:33:39 +02:00
class Collection < ActiveRecord::Base
has_many :collection_albums
has_many :albums, :through => :collection_albums
#accepts_nested_attributes_for :albums, :allow_destroy => true
attr_accessor :album_list
2009-06-03 01:33:39 +02:00
2009-06-11 13:05:09 +02:00
def to_param
2009-06-16 01:18:42 +02:00
#title.gsub(/[^a-z0-9]+/i, '-')
"#{id}-#{title.parameterize}"
2009-06-11 13:05:09 +02:00
end
def album_list=(albums)
self.albums = Album.find(albums)
end
2009-06-11 13:05:09 +02:00
end