Class: ActiveScaffold::Registry
- Defined in:
- lib/active_scaffold/registry.rb
Class Method Summary collapse
- .cache(kind, key = nil) ⇒ Object
- .column_links ⇒ Object
- .constraint_columns ⇒ Object
- .unauthorized_columns ⇒ Object
- .user_settings ⇒ Object
Class Method Details
.cache(kind, key = nil) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/active_scaffold/registry.rb', line 23 def self.cache(kind, key = nil, &) 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 |
.column_links ⇒ Object
19 20 21 |
# File 'lib/active_scaffold/registry.rb', line 19 def self.column_links RequestStore.store[:column_links] ||= {} end |
.constraint_columns ⇒ Object
11 12 13 |
# File 'lib/active_scaffold/registry.rb', line 11 def self.constraint_columns RequestStore.store[:attr_Registry_constraint_columns] ||= Hash.new { |h, k| h[k] = [] } end |
.unauthorized_columns ⇒ Object
15 16 17 |
# File 'lib/active_scaffold/registry.rb', line 15 def self. RequestStore.store[:attr_Registry_unauthorized_columns] ||= Hash.new { |h, k| h[k] = [] } end |
.user_settings ⇒ Object
7 8 9 |
# File 'lib/active_scaffold/registry.rb', line 7 def self.user_settings RequestStore.store[:attr_Registry_user_settings] ||= {} end |