1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

15 commits

Author SHA1 Message Date
Daniel Cadenas
11f929b5c4 Add nodes for boolean constants
This is useful for dynamically created predicates e.g:

expr1 = table.create_false
expr2 = table.create_false

expr1 = create_a_predicate() if some_condition
expr2 = create_another_predicate() if some_other_condition

table.where(expr1.and(expr2))
2011-08-03 20:50:03 -03:00
Ernie Miller
7361b6cbd5 Move #as to AliasPredication, stop overriding Function's #as. 2011-04-29 11:13:41 -07:00
Aaron Patterson
d09a882329 Revert "Merged pull request #40 from gmile/master."
This reverts commit 490d6f98f8, reversing
changes made to dd07005dce.
2011-04-29 10:26:53 -07:00
Aaron Patterson
490d6f98f8 Merged pull request #40 from gmile/master.
Passing nil in array generates improper SQL
2011-04-29 10:05:40 -07:00
Arthur Taylor
85882d1b26 Add support for ordering on expressions
Conflicts:

	lib/arel.rb
	lib/arel/attributes/attribute.rb
	lib/arel/nodes/infix_operation.rb
	lib/arel/nodes/named_function.rb

Conflicts:

	lib/arel.rb
	lib/arel/attributes/attribute.rb
2011-04-28 10:11:50 +02:00
Ernie Miller
3e3d4d1979 Improve performance of grouping_any/grouping_all 2011-04-19 00:20:29 +08:00
gmile
fe5719fea5 Generate more sqlish queue.
Now, instead of the following SQL code:
  some_field IN (1, 2, NULL)

Arel will generate the proper one:
  some_field IN (1, 2) OR IS NULL
2011-03-24 22:12:48 +02:00
Ernie Miller
05887fc406 Make as factory method convert alias name to SqlLiteral 2011-03-12 10:59:03 +08:00
Ernie Miller
3d21dabaa6 Fix modification of input on *_any/*_all predications 2011-02-08 06:33:38 -05:00
Aaron Patterson
6be1a71464 stop using deprecated AND usage 2010-12-09 14:52:11 -08:00
Aaron Patterson
b9d2cd9788 refactoring where, fixing subselect 2010-12-07 10:46:30 -08:00
Sven Fuchs
1135c2c088 implementation for passing a subquery to #in and #not_in 2010-12-07 10:05:42 +01:00
Aaron Patterson
6667cfb995 adding an AS node 2010-11-23 18:22:42 -08:00
Rolf Timmermans
9244e2ddbd Fixed Ruby 1.8 performance regression for Nodes::In and Nodes::NotIn queries with very wide ranges that was caused by using Range#min and Range#max rather than Range#begin and Range#end. Ruby 1.8 uses Enumerable#min and Enumerable#max in Ranges, which calls to_a internally. It is not necessary to enumerate the range in order to construct the predicates. At the same time, an off-by-one error (failing test) with exclusive-end Ranges in Nodes::NotIn queries was fixed. 2010-11-18 00:37:16 +08:00
Ernie Miller
01e7ceef45 Refactor predication methods to be available to SqlLiterals as well. 2010-10-27 22:34:04 +08:00