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

26 lines
469 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
# belongs_to :desktop_widget
belongs_to :imgs, polymorphic: true
before_save :set_name
protected
def set_name
self.name = self.file_identifier
end
end