Class: RailsSettings::ScopedSettings

Inherits:
Settings
  • Object
show all
Defined in:
lib/rails-settings/scoped_settings.rb

Class Method Summary collapse

Methods inherited from Settings

[], []=, destroy, get_all, merge!, method_missing, object, #value, #value=, where

Class Method Details

.for_thing(object) ⇒ Object



3
4
5
6
# File 'lib/rails-settings/scoped_settings.rb', line 3

def self.for_thing(object)
  @object = object
  self
end

.thing_scopedObject



8
9
10
# File 'lib/rails-settings/scoped_settings.rb', line 8

def self.thing_scoped
  unscoped.where(thing_type: @object.class.base_class.to_s, thing_id: @object.id)
end