photomix/app/models/collection.rb
2009-08-06 15:01:39 +02:00

14 lines
301 B
Ruby

class Collection < ActiveRecord::Base
has_many :collection_albums
has_many :albums, :through => :collection_albums
attr_accessor :album_list
def to_param
"#{id}-#{title.parameterize}"
end
def album_list=(albums)
self.albums = Album.find(albums.map{|album|album[0]})
end
end