gallery/app/models/album_setting.rb

18 lines
722 B
Ruby
Raw Normal View History

class AlbumSetting
include Mongoid::Document
include Mongoid::Timestamps
field :limit
field :resize_gravity, type: String, default: 'Center'
2021-04-04 05:03:24 +00:00
ResizeGravities = %w[Center NorthWest North NorthEast West East SouthWest South SouthEast]
field :album_card_background_color, default: ''
field :album_card_text_color, default: '#000000'
2022-12-03 16:26:47 +00:00
field :min_order, type: Integer, default: -1
field :thumb_process_option, type: Integer, default: 1
before_save do
if defined?(OrbitHelper::SharedHash) && OrbitHelper::SharedHash
OrbitHelper::SharedHash['gallery'][:thumb_process_option] = self.thumb_process_option
OrbitHelper::SharedHash['gallery'][:resize_gravity] = self.resize_gravity
end
end
end