Permalink
Browse files

ordering

  • Loading branch information...
1 parent c541dac commit 128aee3568b8ed452112b941461db37f3b1a79af @mattvv mattvv committed Oct 29, 2012
Showing with 5 additions and 5 deletions.
  1. +3 −3 lib/parse_resource/query.rb
  2. +2 −2 lib/parse_resource/query_methods.rb
@@ -24,10 +24,10 @@ def include_object(parent)
end
# deprecating until it works
- def order(attribute)
- orders = attribute.split(" ")
+ def order(attr)
+ orders = attr.split(" ")
if orders.count > 1
- criteria[:order] = orders[1] == "desc" ? "-#{orders[0]}" : "+#{orders[0]}"
+ criteria[:order] = orders[1] == "desc" ? "-#{orders[0]}" : "#{orders[0]}"
end
self
end
@@ -44,8 +44,8 @@ def skip(n)
Query.new(self).skip(n)
end
- def order(attribute)
- Query.new(self).order(attribute)
+ def order(attr)
+ Query.new(self).order(attr)
end
end

0 comments on commit 128aee3

Please sign in to comment.