Class: ActiveScaffold::Registry
- Defined in:
- lib/active_scaffold/registry.rb
Class Method Summary collapse
- .cache(kind, key = nil, &block) ⇒ Object
- .constraint_columns ⇒ Object
- .unauthorized_columns ⇒ Object
- .user_settings ⇒ Object
Class Method Details
.cache(kind, key = nil, &block) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/active_scaffold/registry.rb', line 17 def self.cache(kind, key = nil, &block) unless key key = kind kind = :cache end RequestStore.store[:attr_Registry_cache] ||= {} cache = RequestStore.store[:attr_Registry_cache][kind] ||= {} return cache[key] if cache.include? key cache[key] ||= yield end |
.constraint_columns ⇒ Object
9 10 11 |
# File 'lib/active_scaffold/registry.rb', line 9 def self.constraint_columns RequestStore.store[:attr_Registry_constraint_columns] ||= Hash.new { |h, k| h[k] = [] } end |
.unauthorized_columns ⇒ Object
13 14 15 |
# File 'lib/active_scaffold/registry.rb', line 13 def self. RequestStore.store[:attr_Registry_unauthorized_columns] ||= Hash.new { |h, k| h[k] = [] } end |
.user_settings ⇒ Object
5 6 7 |
# File 'lib/active_scaffold/registry.rb', line 5 def self.user_settings RequestStore.store[:attr_Registry_user_settings] ||= {} end |