Class: ScopedSettings

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

Class Method Summary collapse

Methods inherited from Settings

[], []=, all, cache_key, delete_all, destroy, merge!, method_missing, reload, target, target_scoped, #value, #value=

Class Method Details

.for_target(target) ⇒ Object



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

def self.for_target(target)
  @target = target
  self
end

.target_idObject



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

def self.target_id
  @target.is_a?(Class) ? nil : @target.id
end

.target_typeObject



11
12
13
# File 'lib/rails-settings/scoped_settings.rb', line 11

def self.target_type
  @target.is_a?(Class) ? @target.name : @target.class.base_class.to_s
end