闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
391 B

  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