application_record.rb 280 B

1234567891011121314151617
  1. # frozen_string_literal: true
  2. class ApplicationRecord < ActiveRecord::Base
  3. self.abstract_class = true
  4. include Remotable
  5. def boolean_with_default(key, default_value)
  6. value = attributes[key]
  7. if value.nil?
  8. default_value
  9. else
  10. value
  11. end
  12. end
  13. end