Class: ActiveScaffold::Registry

Inherits:
Object
  • Object
show all
Extended by:
ActiveSupport::PerThreadRegistry
Defined in:
lib/active_scaffold/registry.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_ability_procObject

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_procObject

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_recordsObject

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

.instanceObject



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_columnsObject



10
11
12
# File 'lib/active_scaffold/registry.rb', line 10

def constraint_columns
  @constraint_columns ||= Hash.new { |h, k| h[k] = [] }
end

#unauthorized_columnsObject



14
15
16
# File 'lib/active_scaffold/registry.rb', line 14

def unauthorized_columns
  @unauthorized_columns ||= Hash.new { |h, k| h[k] = [] }
end

#user_settingsObject



6
7
8
# File 'lib/active_scaffold/registry.rb', line 6

def 
  @user_settings ||= {}
end