HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
activerecord-hackery
squeel
Ruby2012–2013
activerecord-hackery / squeel · Archived

squeel

Active Record, improved. Live again :)

2Distinct people
2Mentions
0Explicit recommenders
2.4KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Active Record, improved. Live again :)

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month2 dated mentions

Observed mentions: 2012-07-09 14:15:23 UTC to 2013-03-27 12:24:24 UTC.

012012-07-01 00:00:00 UTC to 2012-08-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJul 20122012-08-01 00:00:00 UTC to 2012-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2012-09-01 00:00:00 UTC to 2012-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2012-10-01 00:00:00 UTC to 2012-11-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2012-11-01 00:00:00 UTC to 2012-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsNov 20122012-12-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-01-01 00:00:00 UTC to 2013-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-02-01 00:00:00 UTC to 2013-03-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-03-01 00:00:00 UTC to 2013-04-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsMar 2013

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Jul 20122012-07-01 00:00:00 UTC2012-08-01 00:00:00 UTC101
Aug 20122012-08-01 00:00:00 UTC2012-09-01 00:00:00 UTC000
Sep 20122012-09-01 00:00:00 UTC2012-10-01 00:00:00 UTC000
Oct 20122012-10-01 00:00:00 UTC2012-11-01 00:00:00 UTC000
Nov 20122012-11-01 00:00:00 UTC2012-12-01 00:00:00 UTC000
Dec 20122012-12-01 00:00:00 UTC2013-01-01 00:00:00 UTC000
Jan 20132013-01-01 00:00:00 UTC2013-02-01 00:00:00 UTC000
Feb 20132013-02-01 00:00:00 UTC2013-03-01 00:00:00 UTC000
Mar 20132013-03-01 00:00:00 UTC2013-04-01 00:00:00 UTC101

What Hacker News says

2 sources
This is a nice article about the subtleties of instance_eval in Ruby. It's an interesting feature that powers some very clever DSLs [1][2][3]. At the same time it's a feature that is confusing and should be avoided as much as possible. One reason is that it is impossible to predict by looking at the calling code in which context a block is executed if instance_eval is used. Another reason is that a block that is executed with instance_eval cannot reference instance variables of the calling object. No problem for trivial code, but a huge headache for slightly more complex code or for views in Rails apps (which use instance variables to pass objects from controllers to views). And unlike the inability to call local helper methods (as explained at the end in the article) this cannot be worked around by throwing more magic into the mix. I be
Read the rest
lieve there's some consensus now that instance_eval is a nice trick, but should be reserved for simple DSLs or DSLs that don't interact much with other code. Some libraries [4] have stopped using instance_eval altogether because of associated problems. If you do use instance_eval in your API, be sure to mention it explicitly in the documentation to avoid headaches for your users. [1]:https://github.com/ernie/squeel [2]:http://api.rubyonrails.org/classes/ActionDispatch/Routing.ht... [3]:http://docs.opscode.com/chef/dsl_recipe.html [4]:http://builder.rubyforge.org/classes/Builder/XmlMarkup.html
In A Closure Is Not Always A Closure In Ruby
Comments aren't available on the article, so a couple of quick clarifications here: Nitpicky, but ActiveRecord::Relation is not ARel. ARel is the relational algebra library that underpins ActiveRecord (>=3.0). See http://erniemiller.org/2010/05/11/activerecord-relation-vs-a... for more info. The specific example he used to demonstrate worked transparently because of the has_many :through relationship for users on Article, which requires the collaborations table to filter the users, so joins it. Otherwise, you would need to do the join yourself before merging the scope, and things get messy pretty quickly, especially if you end up with table aliases (which the merged relation knows nothing about -- it will still query against the collaborations table). I added "sifters" to Squeel (http://github.com/ernie/squeel) in order to address the nee
Read the rest
d for a set of reusable conditions on a specific model that could work through an association. I'm not saying Squeel is the solution you're definitely looking for, but I just want to let people know about the things they'll need to look out for when using Relation#merge.
In Arel merge, rails' hidden gem

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.