root/app/models/gallery.rb~ @ 10

Revision 10, 429 bytes (checked in by falcon, 17 years ago)

Final styling tweaks, ordering, misc cleanup.

RevLine 
[4]1class 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
19end
Note: See TracBrowser for help on using the browser.