Class: ActiveScaffold::Registry
- Extended by:
- ActiveSupport::PerThreadRegistry
- Defined in:
- lib/active_scaffold/registry.rb
Instance Attribute Summary collapse
-
#current_ability_proc ⇒ Object
Returns the value of attribute current_ability_proc.
-
#current_user_proc ⇒ Object
Returns the value of attribute current_user_proc.
-
#marked_records ⇒ Object
Returns the value of attribute marked_records.
Class Method Summary collapse
Instance Method Summary collapse
- #cache(kind, key = nil, &block) ⇒ Object
- #constraint_columns ⇒ Object
- #unauthorized_columns ⇒ Object
- #user_settings ⇒ Object
Instance Attribute Details
#current_ability_proc ⇒ Object
Returns the value of attribute current_ability_proc.
4 5 6 |
# File 'lib/active_scaffold/registry.rb', line 4 def current_ability_proc @current_ability_proc end |
#current_user_proc ⇒ Object
Returns the value of attribute current_user_proc.
4 5 6 |
# File 'lib/active_scaffold/registry.rb', line 4 def current_user_proc @current_user_proc end |
#marked_records ⇒ Object
Returns the value of attribute marked_records.
4 5 6 |
# File 'lib/active_scaffold/registry.rb', line 4 def marked_records @marked_records end |
Class Method Details
.instance ⇒ Object
29 30 31 |
# File 'lib/active_scaffold/registry.rb', line 29 def self.instance RequestStore.store[@per_thread_registry_key] ||= new end |
Instance Method Details
#cache(kind, key = nil, &block) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/active_scaffold/registry.rb', line 18 def cache(kind, key = nil, &block) unless key key = kind kind = :cache end @cache ||= {} cache = @cache[kind] ||= {} return cache[key] if cache.include? key cache[key] ||= yield end |
#constraint_columns ⇒ Object
10 11 12 |
# File 'lib/active_scaffold/registry.rb', line 10 def constraint_columns @constraint_columns ||= Hash.new { |h, k| h[k] = [] } end |
#unauthorized_columns ⇒ Object
14 15 16 |
# File 'lib/active_scaffold/registry.rb', line 14 def @unauthorized_columns ||= Hash.new { |h, k| h[k] = [] } end |
#user_settings ⇒ Object
6 7 8 |
# File 'lib/active_scaffold/registry.rb', line 6 def user_settings @user_settings ||= {} end |