Orbit/app/models/design/image.rb

24 lines
426 B
Ruby
Raw Normal View History

2012-10-24 10:40:38 +00:00
class Image
include Mongoid::Document
include Mongoid::Timestamps
2011-10-18 03:21:24 +00:00
field :html_id
field :html_class
2012-10-24 10:40:38 +00:00
field :in_css, :type => Boolean, :default => false
field :in_html, :type => Boolean, :default => false
field :name
2011-09-14 07:11:50 +00:00
mount_uploader :file, ImageUploader
2012-10-24 10:40:38 +00:00
belongs_to :design
2012-11-01 12:42:40 +00:00
belongs_to :desktop_widget
2012-10-24 10:40:38 +00:00
before_save :set_name
protected
def set_name
self.name = self.file_identifier
end
end