Over the weekend, I released Squeel 1.0.10 (and then yanked it and released 1.0.11, because I fail at semantic versioning, putting a deprecation into a patch release). It's been a while since I made a post about a Squeel release, so I thought maybe it was time for an update on what's new, as well as what you can expect in Squeel 1.1/2.0.
1.0.3 - 1.0.9, summarized
Bug fixes. That's been just about it, really. Many of them are related to an ongoing battle I've had with ActiveRecord::Relation#merge. Oh man, how I hate that method. I've had a draft queued up for a while about that, actually. I'll get around to polishing it up one day.
Anyway, I believe I've currently arrived at a solution that's working as well as can be hoped for. With that out of the way, what else is new?
Here's what's new as of 1.0.11:
- Resolve issues when joining the same table twice in two different scopes (#157)
- Allow predicates in order and select clauses. (#128)
- Support Squeel syntax in Relation#from (#155)
There's a bit of behind the scenes work that's been done to support some of these changes, that should allow for easier support of one-off behavior in specific clauses in the future. Namely, each clause now has its own Visitor class. This was really an oversight in the way I modeled things initially. I made a naive assumption that there wer clauses that would contain predicates, and clauses that would contain attributes (or attribute-likes), with no overlap. That's just not the case. As a side effect of this work, I finally had the impetus I needed to clean house in the visitors, and removed a bunch of duplicated code. The result is a cleaner and easier to understand codebase.
What's in store for the future?
Squeel 2.0 will have some changes in store. Here are a couple, with more to come later.
- Sifters will better coexist with scopes. Currently, I'm planning to have a sifter definition create a scope of the same name (either automatically or with an option, undecided as of yet). The sifter will be prefixed with "sift_" in its method name, and the sift syntax within the DSL will take this into account when referencing sifters.In current versions of Squeel, a sifter and a scope with the same name cannot coexist.
- Core extensions will be removed. The symbol and hash extensions in Squeel 1.0 were provided as a convenience for those migrating from MetaWhere. A quick check of RubyGems.org shows that Squeel has surpassed MetaWhere in current usage, which means that the time is right to remove support for this stopgap measure. As of 1.1.0, loading these extensions will trigger a deprecation notice.
As both of the changes outlined above will result in modifications to the public-facing API of Squeel, they'll only happen in version 2.0. You can safely continue to use Squeel 1.x without being concerned about a backport of these changes causing breakage.comments powered by Disqus