From 19c36778822c09c6159c538478f296459f592687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 9 Oct 2013 20:21:38 -0300 Subject: Move wrap_scope to class level --- .../lib/active_record/associations/builder/collection_association.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/associations/builder/collection_association.rb b/activerecord/lib/active_record/associations/builder/collection_association.rb index c8b1873531..090e593358 100644 --- a/activerecord/lib/active_record/associations/builder/collection_association.rb +++ b/activerecord/lib/active_record/associations/builder/collection_association.rb @@ -18,7 +18,7 @@ module ActiveRecord::Associations::Builder super if extension - @scope = wrap_scope @scope, extension + @scope = self.class.wrap_scope @scope, extension end end @@ -80,7 +80,7 @@ module ActiveRecord::Associations::Builder private - def wrap_scope(scope, mod) + def self.wrap_scope(scope, mod) if scope proc { |owner| instance_exec(owner, &scope).extending(mod) } else -- cgit v1.2.3