diff options
author | Alexander Podgorbunsky <shurikp@evilmartians.com> | 2009-03-26 15:00:12 +0300 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-05-01 14:44:24 -0700 |
commit | db0bfe4ede3cdfc2e4ccdb2a89525a914e6d0913 (patch) | |
tree | 47b8855b495422578dadda80228e60a48d23c0bb /activerecord/lib/active_record | |
parent | 853c229bbdb32c27231df8ad0d446bb35e588586 (diff) | |
download | rails-db0bfe4ede3cdfc2e4ccdb2a89525a914e6d0913.tar.gz rails-db0bfe4ede3cdfc2e4ccdb2a89525a914e6d0913.tar.bz2 rails-db0bfe4ede3cdfc2e4ccdb2a89525a914e6d0913.zip |
Default scope :order should be overridden by named scopes.
[#2346 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/named_scope.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb index 1f3ef300f2..3df7089096 100644 --- a/activerecord/lib/active_record/named_scope.rb +++ b/activerecord/lib/active_record/named_scope.rb @@ -114,7 +114,7 @@ module ActiveRecord end end - delegate :scopes, :with_scope, :to => :proxy_scope + delegate :scopes, :with_scope, :scoped_methods, :to => :proxy_scope def initialize(proxy_scope, options, &block) options ||= {} @@ -178,7 +178,7 @@ module ActiveRecord else with_scope({:find => proxy_options, :create => proxy_options[:conditions].is_a?(Hash) ? proxy_options[:conditions] : {}}, :reverse_merge) do method = :new if method == :build - if current_scoped_methods_when_defined + if current_scoped_methods_when_defined && !scoped_methods.include?(current_scoped_methods_when_defined) with_scope current_scoped_methods_when_defined do proxy_scope.send(method, *args, &block) end |