scoped_settings.rb 255 B

12345678910111213
  1. module RailsSettings
  2. class ScopedSettings < Base
  3. def self.for_thing(object)
  4. @object = object
  5. self
  6. end
  7. def self.thing_scoped
  8. unscoped.where(thing_type: @object.class.base_class.to_s, thing_id: @object.id)
  9. end
  10. end
  11. end