diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-19 14:08:42 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-19 14:08:42 -0700 |
commit | e8966bf9a86afb82c658cedd7e4baffa3a15a856 (patch) | |
tree | 8705c27da734888b2ca9713182ac3a837026cb99 /lib/arel/relations/operations/order.rb | |
parent | 518db17ca3dade07fc67b6044b63c826cefb1442 (diff) | |
download | rails-e8966bf9a86afb82c658cedd7e4baffa3a15a856.tar.gz rails-e8966bf9a86afb82c658cedd7e4baffa3a15a856.tar.bz2 rails-e8966bf9a86afb82c658cedd7e4baffa3a15a856.zip |
reorganized file structure
Diffstat (limited to 'lib/arel/relations/operations/order.rb')
-rw-r--r-- | lib/arel/relations/operations/order.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/arel/relations/operations/order.rb b/lib/arel/relations/operations/order.rb new file mode 100644 index 0000000000..ebb4dc0668 --- /dev/null +++ b/lib/arel/relations/operations/order.rb @@ -0,0 +1,19 @@ +module Arel + class Order < Compound + attr_reader :orderings + + def initialize(relation, *orderings) + @relation, @orderings = relation, orderings.collect { |o| o.bind(relation) } + end + + def orders + orderings + relation.orders + end + + def ==(other) + Order === other and + relation == other.relation and + orderings == other.orderings + end + end +end
\ No newline at end of file |