aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-05-02 13:56:10 -0300
committerPratik Naik <pratiknaik@gmail.com>2009-05-18 22:46:37 +0200
commit5463823df38310d392a3f87d633dce9b4150259a (patch)
tree2a70aaca65595410f8c476aec2976029ae66451f /activerecord/lib/active_record
parentcef76c8af4705dc60f85a721e3a14adb99418d33 (diff)
downloadrails-5463823df38310d392a3f87d633dce9b4150259a.tar.gz
rails-5463823df38310d392a3f87d633dce9b4150259a.tar.bz2
rails-5463823df38310d392a3f87d633dce9b4150259a.zip
Remove unnecessary condition and local variable [#2602 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-xactiverecord/lib/active_record/base.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 968b9bde5a..af800261e5 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1541,12 +1541,12 @@ module ActiveRecord #:nodoc:
end
def reverse_sql_order(order_query)
- reversed_query = order_query.to_s.split(/,/).each { |s|
+ order_query.to_s.split(/,/).each { |s|
if s.match(/\s(asc|ASC)$/)
s.gsub!(/\s(asc|ASC)$/, ' DESC')
elsif s.match(/\s(desc|DESC)$/)
s.gsub!(/\s(desc|DESC)$/, ' ASC')
- elsif !s.match(/\s(asc|ASC|desc|DESC)$/)
+ else
s.concat(' DESC')
end
}.join(',')