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

18 lines
502 B
Ruby

class Album
include Mongoid::Document
include Mongoid::Timestamps
include OrbitCategory::Categorizable
include OrbitTag::Taggable
field :name, localize: true
field :description, localize: true
field :cover, default: "default"
field :cover_path #can refact
field :tag_names
# has_and_belongs_to_many :tags, :class_name => "GalleryTag"
has_many :album_images, :autosave => true, :dependent => :destroy
accepts_nested_attributes_for :album_images, :allow_destroy => true
end