Created
January 1, 2009 21:56
-
-
Save fcheung/42383 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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