3.0.0 - 2023-11-20
- Added support for ActiveRecord 7.1 (#125)
- Added support for Ruby 3.2 (#128)
- Updated ransack to 4.1. (#126)
- Droped support for Ruby 2.6 and 2.7. (#126)
- Droped support for ActiveRecord 6.0. (#126)
2.0.0 - 2022-08-28
- AR 6.1: fix - FrozenError: can't modify frozen object: []
- Drop support for ActiveRecord older than 6.0.
1.4.4 - 2022-02-07
- Nested merge-joins query causes NoMethodError with ActiveRecord 6.1.4.4 (#119)
1.4.3 - 2022-02-04
- ActiveRecord::Relation#left_joins performs INNER JOIN on Active Record 6.1 (#118)
1.4.2 - 2022-01-24
- Added support for activerecord 7.0 (#116)
- Added support for activerecord 6.1 (#116)
- Added support for activerecord 6.0 (#116)
1.4.1 - 2021-06-17
- Fixed a bug related to checking the Active Record version.
1.4.0 - 2021-06-17
- Fix table alias when joining a polymorphic table twice (#108)
- Removed internal class
BabySqueel::Pluck
. You can still useplucking
. For example,Post.joining { author }.plucking { author.name }
- Removed old code from Active Record < 5.2
- Removed dependency
join_dependency
1.4.0.beta1 - 2021-04-21
- Add Support for activerecord '>= 5.2.3'
- Drop Support for Active Record versions that have reached EOL (activerecord < 5.2)
- Use polyamorous from ransack '~> 2.3'
1.3.1 - 2018-05-15
- Upgraded
join_dependency
requirement, which fixes issue #1.
1.3.0 - 2018-05-04
- The ability to use
plucking
with an array of nodes. For example,User.plucking { [id, name] }
.
1.2.1 - 2018-04-25
- Added support for Active Record 5.2
1.2.0 - 2017-10-20
reordering
, which is just a BabySqueel version of Active Record'sreorder
.on
expressions can now be given a block that will yield the current node (#77).
1.1.5 - 2017-05-26
- Returning an empty hash from a
where.has {}
block would generate invalid SQL (#69).
1.1.4 - 2017-04-13
- Nodes::Attribute#in and #not_in generate valid SQL when given ActiveRecord::NullRelations.
1.1.3 - 2017-03-31
- Nodes::Attribute#in was not returning BabySqueel node. As a result, you couldn't chain on it. This fixes #61.
1.1.2 - 2017-03-21
- Check if a reflection has a parent reflection before comparing them. This fixes #56.
- The logic encapsulated in
#method_missing
and#respond_to_missing?
was difficult to follow, because it was falling back tosuper
, sometimes going up the inheritance tree multiple levels. The addition ofBabySqueel::Resolver
now handles this a little more gracefully.
1.1.1 - 2017-02-14
- There is a bug in Active Record where the
AliasTracker
initializesArel::Table
s use the wrongtype_caster
. To address this, BabySqueel must re-initialize theArel::Table
with the correcttype_caster
(#54).
1.1.0 - 2017-02-10
This version drops support for Active Record 4.1. If you're stil on 4.1, you should seriously consider upgrading to at least 4.2.
- DSLs for ActiveRecord::Relation::Calculations. You can now use
plucking
,counting
,summing
,averaging
,minimizing
, andmaximizing
.
1.0.3 - 2017-02-09
- Support for
pluck
. - Support for
not_in
.
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.