2018-02-05 09:15:50 +00:00
|
|
|
class PropertyHireSetting
|
|
|
|
include Mongoid::Document
|
|
|
|
include Mongoid::Timestamps
|
|
|
|
|
|
|
|
field :auto_approve, type: Boolean, :default => false
|
2021-09-06 16:45:14 +00:00
|
|
|
field :carousel_image_width, type: String, :default => "75%"
|
|
|
|
field :disable_content_page, type: Boolean, :default => false
|
|
|
|
field :disable_view_calendar_page, type: Boolean, :default => false
|
2023-10-18 13:56:19 +00:00
|
|
|
field :disable_no_logins_view_calendar, type: Boolean, :default => false
|
2021-09-08 02:10:44 +00:00
|
|
|
field :allow_no_logins_user, type: Boolean, :default => false
|
|
|
|
field :calendar_type, type: Integer, default: 0 # 0=> 顯示, 1=> 不顯示
|
2018-02-05 09:15:50 +00:00
|
|
|
def self.auto_approve_enabled?
|
2020-03-23 17:26:52 +00:00
|
|
|
self.first.auto_approve rescue false
|
2018-02-05 09:15:50 +00:00
|
|
|
end
|
2021-09-07 05:07:09 +00:00
|
|
|
after_save do
|
|
|
|
Property.init_class_variables
|
|
|
|
end
|
2021-10-23 02:34:18 +00:00
|
|
|
def default_time_settings
|
|
|
|
PropertyDaySetting.where(:property_id=>"default_settings").asc(:key)
|
|
|
|
end
|
2018-02-05 09:15:50 +00:00
|
|
|
end
|