This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2016-11-15 07:56:29 -08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-17 08:56:23 -07:00
|
|
|
class ApplicationRecord < ActiveRecord::Base
|
|
|
|
self.abstract_class = true
|
2019-08-05 10:54:29 -07:00
|
|
|
|
2018-03-26 05:02:10 -07:00
|
|
|
include Remotable
|
2019-08-05 10:54:29 -07:00
|
|
|
|
2023-07-16 23:26:52 -07:00
|
|
|
connects_to database: { writing: :primary, reading: :read }
|
|
|
|
|
2019-09-30 16:19:11 -07:00
|
|
|
class << self
|
|
|
|
def update_index(_type_name, *_args, &_block)
|
|
|
|
super if Chewy.enabled?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-08-05 10:54:29 -07:00
|
|
|
def boolean_with_default(key, default_value)
|
|
|
|
value = attributes[key]
|
|
|
|
|
|
|
|
if value.nil?
|
|
|
|
default_value
|
|
|
|
else
|
|
|
|
value
|
|
|
|
end
|
|
|
|
end
|
2016-08-17 08:56:23 -07:00
|
|
|
end
|