This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/models/design/image.rb

23 lines
397 B
Ruby

class Image
include Mongoid::Document
include Mongoid::Timestamps
field :html_id
field :html_class
field :in_css, :type => Boolean, :default => false
field :in_html, :type => Boolean, :default => false
field :name
mount_uploader :file, ImageUploader
belongs_to :design
before_save :set_name
protected
def set_name
self.name = self.file_identifier
end
end