| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
These two clauses have nearly identical semantics with regards to how
they would be constructed as an AST. It doesn't make sense for their
interfaces to be separate.
|
|
|
|
|
| |
It is impossible to test equality of things constructing trees with bind
params otherwise.
|
|
|
|
|
|
|
|
|
| |
This will allow most consuming code to avoid the deprecation introduced
in 008445d6fd5f825d9b445ac75a7be67f0f7ab52c. The only code which will be
affected is code that is building the `Arel::Table` object manually,
rather than calling `arel_table` on an Active Record class. Hopefully
this case will be rare enough that we don't need to introduce any
additional APIs to work around it.
|
|
|
|
|
|
| |
This constructor parameter was unused for everything except the
convenience methods `to_sql` and `where_sql`. We can pass the engine
into those methods directly.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes the need for us to do the re-ordering by walking the AST in
ActiveRecord. We're using a block to communicate with the collector,
since the collector needs to be the thing which knows about the index,
while the visitor is the thing that needs to know the syntax. The
BindParam needs to know about neither of these things, so it's been
changed to stop being a subclass of SqlLiteral
I could also see an alternative implementation using format strings if
for some reason blocks cause a problem.
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixes https://github.com/rails/rails/issues/16913
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* master:
remove order_clauses since we do not use it
fix whitespace and unsupported method args
Add Regexp and NotRegexp nodes for PostgreSQL
Revert "Merge pull request #253 from corrupt952/master"
flatten object.children in visit_Arel_Node_And
Added right and full outer joins
Conflicts:
lib/arel/visitors/to_sql.rb
lib/arel/visitors/visitor.rb
|
| | |
|
| | |
|
|/ |
|
| |
|
|
|
|
|
| |
If we add the casting node to the ast at build time, then we can avoid
doing the lookup at visit time.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
People are often trying to use ARel nodes inside ActiveRecord, and when
they do so, lots of things can break, because ActiveRecord relies on
Array#uniq and sometimes hash key equality to handle values that end up
in wheres, havings, etc. By implementing equality for all the nodes, we
should hopefully be able to prevent any nodes (even nodes containing
other nodes) from failing an equality check they should otherwise pass,
and alleviate many of these errors.
Fixes #130
|
|
|
|
|
| |
Eventually #engine should go away, but until that time, this means that
Table and Nodes::TableAlias can be used more interchangeably.
|
|
|
|
|
|
|
|
|
|
| |
It is untested. There is no `@frame` variable. Presumably it is supposed
to be `@framing`, but changing that shows that some of the tests *are*
setting frame twice.
I don't see why this level of strictness is necessary. If someone
disagrees, they should add a test for this behaviour and make the other
tests pass.
|
|
|
|
|
|
| |
Also, removed unused ordering.rb file, since it is identical
to the one being created in unary.rb already, and isn't
required anywhere.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
2.2.1 we encountered the error
uninitialized constant Arel::Nodes::Visitors::DepthFirst
apparently Arel was trying to call a relative namespace with
Visitors::DepthFirst.new(block).accept self
we fixed this by making it call an absolute namespace with
::Arel::Visitors::DepthFirst.new(block).accept self
|
| |
|
|
|
|
| |
generating SQL, rather than the TreeManager. (There is a related commit coming in Active Record.)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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))
|
| |
|
|
|
|
| |
table[:id].count.eq(2)
|
|
|
|
| |
should support ordering
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| | |
* 'master' of github.com:rails/arel:
Add an #table_name method to Table and TableAlias, which always returns the actual table name, not the alias. Then fix ToSql#column_for to use this table name when checking whether the table exists (rather than before, where it was checking whether a table with the alias name exists, which was incorrect).
|
| |
| |
| |
| | |
actual table name, not the alias. Then fix ToSql#column_for to use this table name when checking whether the table exists (rather than before, where it was checking whether a table with the alias name exists, which was incorrect).
|