Created
October 11, 2013 01:18
-
-
Save pond/6928197 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_Between o | |
if (o.right.children[0].class == Date && o.right.children[1].class == Date) | |
min = o.right.children[ 0 ] | |
max = o.right.children[ 1 ] + 1 | |
"(#{visit o.left} >= #{visit min} AND #{visit o.left} < #{visit max})" | |
else | |
"#{visit o.left} BETWEEN #{visit o.right}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment