Module: ActiveRecord::Associations::CollectionProxy::DelegateExtending

Defined in:
lib/active_record/associations/collection_proxy.rb

Overview

:nodoc:

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



1076
1077
1078
1079
1080
1081
1082
1083
1084
# File 'lib/active_record/associations/collection_proxy.rb', line 1076

def method_missing(method, *args, &block)
  extending_values = association_scope.extending_values
  if extending_values.any? && (extending_values - self.class.included_modules).any?
    self.class.include(*extending_values)
    public_send(method, *args, &block)
  else
    super
  end
end