<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -116,7 +116,9 @@ arguments are given it will default to @created_at DESC@:
   Article.ordered(:id)            # Get all articles ordered by &quot;id&quot;
   Article.ordered(&quot;rank ASC&quot;)     # Get all articles ordered by &quot;rank ASC&quot;
   Article.order_by(:id)           # order_by and sort_by are alias to ordered
-  Article.order_by([:id, :desc], :popularity)   # can take a hash as parameter
+  Article.order_by([:id, :desc], :popularity)           # can take a array as parameter
+  Article.order_by(:id =&gt; :desc, :popularity =&gt; :asc)   # can take a hash as parameter
+                                                        # only available for jruby/ruby 1.9
   Article.order_by_id             # can be set as a sentence
 
 If you would like to specify a different default sort order you can do so on a per class basis</diff>
      <filename>README.textile</filename>
    </modified>
    <modified>
      <diff>@@ -8,9 +8,16 @@ module UtilityScopes
       base.class_eval do
         # Provide an ordered scope
         named_scope(:ordered, lambda { |*order|
-          { :order =&gt; order.empty? ?
-            self.default_ordering :
-            order.collect{|e| e.is_a?(Array) ? &quot;#{e[0]} #{e[1].to_s.upcase}&quot; : e}.join(', ') }
+          { :order =&gt; case
+            when order.empty?
+              self.default_ordering
+            # allow hash support for jruby or ruby 1.9
+            when order.size == 1 &amp;&amp; order[0].is_a?(Hash) &amp;&amp; (PLATFORM=~/java/ || RUBY_VERSION=~/1\.9.*/)
+              order.first.collect{|(k,v)| &quot;#{k} #{v.to_s.upcase}&quot;}.join(', ')
+            else
+              order.collect{|e| e.is_a?(Array) ? &quot;#{e[0]} #{e[1].to_s.upcase}&quot; : e}.join(', ')
+            end
+          }
         })
         
         class &lt;&lt; self
@@ -41,9 +48,16 @@ module UtilityScopes
         # Override named scope on AR::Base so we can access default_ordering
         # on subclass
         named_scope(:ordered, lambda { |*order|
-          { :order =&gt; order.empty? ?
-            self.default_ordering :
-            order.collect{|e| e.is_a?(Array) ? &quot;#{e[0]} #{e[1].to_s.upcase}&quot; : e}.join(', ') }
+          { :order =&gt; case
+            when order.empty?
+              self.default_ordering
+            # allow hash support for jruby or ruby 1.9
+            when order.size == 1 &amp;&amp; order[0].is_a?(Hash) &amp;&amp; (PLATFORM=~/java/ || RUBY_VERSION=~/1\.9.*/)
+              order.first.collect{|(k,v)| &quot;#{k} #{v.to_s.upcase}&quot;}.join(', ')
+            else
+              order.collect{|e| e.is_a?(Array) ? &quot;#{e[0]} #{e[1].to_s.upcase}&quot; : e}.join(', ') 
+            end
+          }
         })
         
         metaclass.instance_eval do</diff>
      <filename>lib/utility_scopes/ordered.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,10 +15,16 @@ describe &quot;Ordered scope&quot; do
     Article.ordered('created_at ASC').proxy_options.should == {:order =&gt; 'created_at ASC'}
   end
   
-  it &quot;should allow the order to arrays as arg&quot; do
+  it &quot;should allow the order to use arrays as arg&quot; do
     Article.ordered([:popularity, :asc], [:second_param, :desc]).proxy_options.should == {:order =&gt; 'popularity ASC, second_param DESC'}
   end
   
+  it &quot;should allow the order hash as arg&quot; do
+    if (PLATFORM=~/java/ || RUBY_VERSION=~/1\.9.*/)
+      Article.ordered(:popularity =&gt; :asc, :second_param =&gt; :desc).proxy_options.should == {:order =&gt; 'popularity ASC, second_param DESC'}
+    end
+  end
+  
   it &quot;should allow the order with several args&quot; do
     Article.ordered(:popularity, :updated_at).proxy_options.should == {:order =&gt; 'popularity, updated_at'}
   end</diff>
      <filename>spec/ordered_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>464c8dc69ef3966be990a0eebca480c4cfa784b1</id>
    </parent>
  </parents>
  <author>
    <name>Jean-S&#233;bastien Ney</name>
    <email>jeansebastien.ney@gmail.com</email>
  </author>
  <url>http://github.com/yfactorial/utility_scopes/commit/8d51af960f91fc771a0e655c7cf9253144a4728c</url>
  <id>8d51af960f91fc771a0e655c7cf9253144a4728c</id>
  <committed-date>2008-10-25T12:35:30-07:00</committed-date>
  <authored-date>2008-10-25T12:35:30-07:00</authored-date>
  <message>added ordered hash support for jruby and ruby 1.9</message>
  <tree>963cc37b471ca4579fa7ffaea2b225fb9653c2a0</tree>
  <committer>
    <name>Jean-S&#233;bastien Ney</name>
    <email>jeansebastien.ney@gmail.com</email>
  </committer>
</commit>
