Class: RailsSettings::ScopedSettings

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

Class Method Summary collapse

Methods inherited from Base

[], []=, #cache_key, cache_key, cache_prefix, cache_store, configure, #expire_cache, #rewrite_cache

Methods inherited from Settings

[], []=, destroy, get_all, merge!, method_missing, object, rails_initialized?, source, #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