Module: RailsAdmin::Config::Proxyable

Included in:
Actions::Base, Fields::Base, Fields::Group, Fields::Types::MultipleFileUpload::AbstractAttachment, Model, Sections::Base
Defined in:
lib/rails_admin/config/proxyable.rb,
lib/rails_admin/config/proxyable/proxy.rb

Defined Under Namespace

Classes: Proxy

Instance Method Summary collapse

Instance Method Details

#bindingsObject



7
8
9
10
# File 'lib/rails_admin/config/proxyable.rb', line 7

def bindings
  Thread.current[:rails_admin_bindings] ||= {}
  Thread.current[:rails_admin_bindings][self]
end

#bindings=(new_bindings) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/rails_admin/config/proxyable.rb', line 12

def bindings=(new_bindings)
  Thread.current[:rails_admin_bindings] ||= {}
  if new_bindings.nil?
    Thread.current[:rails_admin_bindings].delete(self)
  else
    Thread.current[:rails_admin_bindings][self] = new_bindings
  end
end

#with(bindings = {}) ⇒ Object



21
22
23
# File 'lib/rails_admin/config/proxyable.rb', line 21

def with(bindings = {})
  RailsAdmin::Config::Proxyable::Proxy.new(self, bindings)
end