application_record.rb 391 B

1234567891011121314151617181920212223
  1. # frozen_string_literal: true
  2. class ApplicationRecord < ActiveRecord::Base
  3. self.abstract_class = true
  4. include Remotable
  5. class << self
  6. def update_index(_type_name, *_args, &_block)
  7. super if Chewy.enabled?
  8. end
  9. end
  10. def boolean_with_default(key, default_value)
  11. value = attributes[key]
  12. if value.nil?
  13. default_value
  14. else
  15. value
  16. end
  17. end
  18. end