Skip to content

Instantly share code, notes, and snippets.

@fcheung
Created Jan 1, 2009
Embed
What would you like to do?
diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb
index 83043c2..8c2507e 100644
--- a/activerecord/lib/active_record/named_scope.rb
+++ b/activerecord/lib/active_record/named_scope.rb
@@ -93,7 +93,11 @@ module ActiveRecord
end
(class << self; self end).instance_eval do
define_method name do |*args|
- scopes[name].call(self, *args)
+ if scoped? :find
+ scopes[name].call(Scope.new(self, scope(:find)), *args)
+ else
+ scopes[name].call(self, *args)
+ end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment