Class: Baza::Driver::ActiveRecord::ForeignKeys

Inherits:
Object
  • Object
show all
Defined in:
lib/baza/driver/active_record/foreign_keys.rb

Instance Method Summary collapse

Constructor Details

#initialize(db:) ⇒ ForeignKeys

Returns a new instance of ForeignKeys.



2
3
4
# File 'lib/baza/driver/active_record/foreign_keys.rb', line 2

def initialize(db:)
  @proxy_to = ::Baza::Driver.const_get(StringCases.snake_to_camel(db.driver.driver_type)).const_get(:ForeignKeys).new(db: db)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missingObject



6
7
8
# File 'lib/baza/driver/active_record/foreign_keys.rb', line 6

def method_missing(...)
  @proxy_to.__send__(...)
end

Instance Method Details

#respond_to_missing?(method_name) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/baza/driver/active_record/foreign_keys.rb', line 10

def respond_to_missing?(method_name)
  @proxy.respond_to?(method_name) || super
end