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)



1130
1131
1132
1133
1134
1135
1136
1137
1138
# File 'lib/active_record/associations/collection_proxy.rb', line 1130

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