Created
December 20, 2011 19:47
-
-
Save vijaydev/1502952 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def visit_Arel_Nodes_SelectStatement o | |
puts caller | |
[ | |
(visit(o.with) if o.with), | |
o.cores.map { |x| visit_Arel_Nodes_SelectCore x }.join, | |
("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?), | |
(visit(o.limit) if o.limit), | |
(visit(o.offset) if o.offset), | |
(visit(o.lock) if o.lock), | |
].compact.join ' ' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment