Nothing yet.
1.0.2 - 2017-02-07
BabySqueel::Association
now has#==
and#!=
. This is only supported for Rails 5+. Example:Post.where { author: Author.last }
.
- Incorrect alias detection caused by not tracking the full path to a join (#37).
1.0.1 - 2016-11-07
- Add DSL#_ for wrapping expressions in Arel::Node::Grouping. Thanks to @odedniv.
- Use strings for attribute names like Rails does. Symbols were preventing things like
unscope
from working. Thanks to @chewi. where.has {}
will now acceptnil
.- Arel::Nodes::Function did not previously include Arel::Math, so now you can do math operations on the result of SQL functions.
- Arel::Nodes::Binary did not previously include Arel::AliasPredication. Binary nodes can now be aliased using
as
.
1.0.0 - 2016-09-09
- Polyamorous. Unfortunately, this does monkey-patch Active Record internals, but there just isn't any other reliable way to generate outer joins. Baby Squeel, itself, will still keep monkey patching to an absolute minimum.
- Within DSL blocks, you can use
exists
andnot_exists
with Active Record relations. For example:Post.where.has { exists Post.where(title: 'Fun') }
.` - Support for polymorphic associations.
- Removed support for Active Record 4.0.x
- BabySqueel::JoinDependency is no longer a class responsible for creating Arel joins. It is now a namespace for utilities used when working with the ActiveRecord::Association::JoinDependency class.
- BabySqueel::Nodes::Generic is now BabySqueel::Nodes::Node.
- Arel nodes are only extended with the behaviors they need. Previously, all Arel nodes were being extended with
Arel::AliasPredication
,Arel::OrderPredications
, andArel::Math
.
- Fixed deprecation warnings on Active Record 5 when initializing an Arel::Table without a type caster.
- No more duplicate joins. Previously, Baby Squeel did a very poor job of ensuring that you didn't join an association twice.
- Alias detection should now actually work. The previous implementation was naive.
0.3.1 - 2016-08-02
- Ported backticks and #my from Squeel
- DSL#sql now returns a node wrapped in a BabySqueel proxy.
0.3.0 - 2016-06-26
- Added Squeel compatibility mode that allows
select
,order
,joins
,group
,where
, andhaving
to accept DSL blocks. - Added the ability to query tables that aren't backed by Active Record models.
- Added
BabySqueel::[]
, which provides aBabySqueel::Relation
for models, or aBabySqueel::Table
for symbols/strings.
- Renamed
BabySqueel::Association::AliasingError
toBabySqueel::AssociationAliasingError
.
0.2.2 - 2016-03-30
- Support for
group
(grouping
) andhaving
(when_having
). - Support for sifters.
- Added
quoted
andsql
helpers for quoting strings and SQL literals. - More descriptive error messages when a column or association is not found.
Arel::Nodes::Grouping
does not includeArel::Math
, so operations like(id + 5) + 3
would fail unexpectedly.- Fix missing bind values When joining through associations with default scope.
- Removed
ActiveRecord::VERSION
specific handling of theWhereChain
.
0.2.1 - 2016-03-27
- Support for subqueries.
- Some Arel nodes did not have access to
as
expressions.
0.2.0 - 2016-03-25
- References to aliased joins in a
select
,where
, ororder
expression now use the aliased table name.
- Rely on
ActiveRecord::Relation#join_sources
for the implicit construction of join nodes, rather than using theActiveRecord::Associations::JoinDependency
directly.
- Associations referencing the same table weren't being aliased.
- Initial support for selects, orders, wheres, and joins.