Orbit/vendor/built_in_modules/gallery/app/models/album.rb

18 lines
502 B
Ruby
Raw Normal View History

2013-11-18 12:02:02 +00:00
class Album
include Mongoid::Document
include Mongoid::Timestamps
2012-07-25 08:20:07 +00:00
include OrbitCategory::Categorizable
2013-04-26 03:18:57 +00:00
include OrbitTag::Taggable
field :name, localize: true
field :description, localize: true
field :cover, default: "default"
field :cover_path #can refact
field :tag_names
2012-07-25 08:20:07 +00:00
# has_and_belongs_to_many :tags, :class_name => "GalleryTag"
2013-11-18 12:02:02 +00:00
has_many :album_images, :autosave => true, :dependent => :destroy
accepts_nested_attributes_for :album_images, :allow_destroy => true
2012-07-25 08:20:07 +00:00
end