Module: RailsDrivers::Overrides::CheckForShadowedMethods

Defined in:
lib/rails_drivers/overrides.rb

Overview

This module is prepended to the singleton class of the including class to detect when an override is attempting to re-define any methods.

Instance Method Summary collapse

Instance Method Details

#method_added(method_name) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'lib/rails_drivers/overrides.rb', line 34

def method_added(method_name)
  driver_overrides.each do |override|
    next unless override.instance_methods.include?(method_name)

    Rails.logger.warn "Driver override method #{override.name}##{method_name} "\
      "is shadowed by #{name}##{method_name} and will likely not do anything."
  end

  super(method_name)
end