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



5
6
7
8
# File 'lib/rails_admin/config/proxyable.rb', line 5

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

#bindings=(new_bindings) ⇒ Object



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

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



19
20
21
# File 'lib/rails_admin/config/proxyable.rb', line 19

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