property_hire/app/models/property_hire_setting.rb

15 lines
477 B
Ruby
Raw Normal View History

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
def self.auto_approve_enabled?
2020-03-23 17:26:52 +00:00
self.first.auto_approve rescue false
end
2021-09-07 05:07:09 +00:00
after_save do
Property.init_class_variables
end
end