Revision 10, 429 bytes
(checked in by falcon, 17 years ago)
|
Final styling tweaks, ordering, misc cleanup.
|
Rev | Line | |
---|
[4] | 1 | class Gallery < ActiveRecord::Base |
---|
| 2 | has_many :gallery_files |
---|
| 3 | has_many :gallery_medias |
---|
| 4 | |
---|
| 5 | belongs_to :artwork |
---|
| 6 | belongs_to :engineering |
---|
| 7 | |
---|
[10] | 8 | def media=(gallery_id) |
---|
| 9 | return GalleryMedia.find(:all, :conditions => ["gallery_id = ?", gallery_id]) |
---|
| 10 | end |
---|
| 11 | |
---|
| 12 | def media_fields_update=(media_fields) |
---|
| 13 | media_fields.each do |id, media| |
---|
[4] | 14 | if (GalleryMedia.exists?(id)) |
---|
[10] | 15 | GalleryMedia.find(id).update_attributes(media) |
---|
[4] | 16 | end |
---|
| 17 | end |
---|
| 18 | end |
---|
| 19 | end |
---|