Class: ActiveRecord::Connections::ConnectionProxy

Inherits:
ActiveSupport::BasicObject
Defined in:
lib/active_record/connections/connection_proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection_name, connection_spec) ⇒ ConnectionProxy

Returns a new instance of ConnectionProxy.



6
7
8
# File 'lib/active_record/connections/connection_proxy.rb', line 6

def initialize(connection_name, connection_spec)
  @connection_name, @connection_spec = connection_name, connection_spec
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *arguments, &block) ⇒ Object



14
15
16
# File 'lib/active_record/connections/connection_proxy.rb', line 14

def method_missing(method_name, *arguments, &block)
  connection.send(method_name, *arguments, &block)
end

Instance Method Details

#respond_to?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/active_record/connections/connection_proxy.rb', line 10

def respond_to?(method_name, include_private = false)
  connection.respond_to?(method_name, include_private)
end