Class: Setler::ScopedSettings

Inherits:
Settings
  • Object
show all
Defined in:
lib/setler/scoped_settings.rb

Class Method Summary collapse

Methods inherited from Settings

[], []=, all, destroy, method_missing

Class Method Details

.for_thing(object, scopename) ⇒ Object



3
4
5
6
7
# File 'lib/setler/scoped_settings.rb', line 3

def self.for_thing(object, scopename)
  self.table_name = scopename
  @object = object
  self
end

.thing_scopedObject



9
10
11
# File 'lib/setler/scoped_settings.rb', line 9

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