0
ActiveRecord::Associations::HasManyThroughAssociation ].each do |klass|
0
- def method_missing_without_paginate(method, *args)
0
- if @target.respond_to?(method) || (!@reflection.klass.respond_to?(method) && Class.respond_to?(method))
0
- super { |*block_args| yield(*block_args) }
0
- elsif @reflection.klass.scopes.include?(method)
0
- @reflection.klass.scopes[method].call(self, *args)
0
+ alias :method_missing_without_scopes :method_missing_without_paginate
0
+ def method_missing_without_paginate(method, *args, &block)
0
+ if @reflection.klass.scopes.include?(method)
0
+ @reflection.klass.scopes[method].call(self, *args, &block)
0
- with_scope construct_scope do
0
- @reflection.klass.send(method, *args) { |*block_args| yield(*block_args) }
0
- @reflection.klass.send(method, *args)
0
+ method_missing_without_scopes(method, *args, &block)
0
@@ -47,4 +36,4 @@ ActiveRecord::Associations::HasAndBelongsToManyAssociation.class_eval do
0
-end if ActiveRecord::VERSION::MAJOR < 2
1
+end if ActiveRecord::Base.respond_to? :find_first
Comments
Smart!