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.

14 lines
286 B

  1. # frozen_string_literal: true
  2. module Settings
  3. class ScopedSettings < ::Setting
  4. def self.for_thing(object)
  5. @object = object
  6. self
  7. end
  8. def self.thing_scoped
  9. unscoped.where(thing_type: @object.class.base_class.to_s, thing_id: @object.id)
  10. end
  11. end
  12. end