CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Fri, 08 Aug 2025 02:08:52 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090104042439
location: https://web.archive.org/web/20090104042439/https://github.com/thoughtbot/squirrel/tree
server-timing: captures_list;dur=3.921606, exclusion.robots;dur=0.025736, exclusion.robots.policy;dur=0.011135, esindex;dur=0.019982, cdx.remote;dur=32.221625, LoadShardBlock;dur=236.850359, PetaboxLoader3.datanode;dur=122.972155, PetaboxLoader3.resolve;dur=63.771246
x-app-server: wwwb-app203
x-ts: 302
x-tr: 323
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app203; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 301
server: nginx
date: Fri, 08 Aug 2025 02:08:53 GMT
content-type: text/html; charset=utf-8
content-length: 115
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Sun, 04 Jan 2009 04:24:38 GMT
x-archive-orig-connection: close
x-archive-orig-set-cookie: _github_ses=BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoOcmV0dXJuX3RvIhgvcGpzdGFkaWcvZm9sbG93ZXJz--53bd13ed6cd3fda23e1651ff64c73bc7439273a4; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT; HttpOnly
x-archive-orig-status: 301 Moved Permanently
location: https://web.archive.org/web/20090104042439/https://github.com/thoughtbot/squirrel/tree/master
x-archive-orig-x-runtime: 280ms
x-archive-orig-cache-control: no-cache
x-archive-orig-content-length: 115
cache-control: max-age=1800
memento-datetime: Sun, 04 Jan 2009 04:24:39 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Wed, 23 Jul 2008 22:26:50 GMT", ; rel="prev memento"; datetime="Sat, 04 Oct 2008 09:59:11 GMT", ; rel="memento"; datetime="Sun, 04 Jan 2009 04:24:39 GMT", ; rel="next memento"; datetime="Mon, 16 Mar 2009 17:46:28 GMT", ; rel="last memento"; datetime="Fri, 18 Sep 2009 12:23:01 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_7_20090104033323_crawl108-c/52_7_20090104041757_crawl103.arc.gz
server-timing: captures_list;dur=0.792304, exclusion.robots;dur=0.025364, exclusion.robots.policy;dur=0.010146, esindex;dur=0.013821, cdx.remote;dur=28.076677, LoadShardBlock;dur=353.618944, PetaboxLoader3.datanode;dur=154.673222, PetaboxLoader3.resolve;dur=344.932504, load_resource;dur=241.547495
x-app-server: wwwb-app203
x-ts: 301
x-tr: 659
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Fri, 08 Aug 2025 02:08:54 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.26
x-archive-orig-date: Sun, 04 Jan 2009 04:24:39 GMT
x-archive-orig-connection: close
x-archive-orig-set-cookie: _github_ses=BAh7BzoOcmV0dXJuX3RvIhgvcGpzdGFkaWcvZm9sbG93ZXJzIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--ed8503ec8c377111847d1eba66fd75f8fe6a97a1; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT; HttpOnly
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 1352ms
x-archive-orig-etag: "a2888fe32707528a01ecd42e7a1cbafe"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 16639
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 04 Jan 2009 04:24:39 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sat, 26 Apr 2008 22:07:43 GMT", ; rel="prev memento"; datetime="Sun, 21 Dec 2008 21:29:49 GMT", ; rel="memento"; datetime="Sun, 04 Jan 2009 04:24:39 GMT", ; rel="next memento"; datetime="Thu, 19 Feb 2009 21:40:48 GMT", ; rel="last memento"; datetime="Sat, 04 Apr 2015 07:15:15 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_7_20090104033323_crawl108-c/52_7_20090104041757_crawl103.arc.gz
server-timing: captures_list;dur=0.638152, exclusion.robots;dur=0.036500, exclusion.robots.policy;dur=0.014121, esindex;dur=0.011493, cdx.remote;dur=30.459397, LoadShardBlock;dur=102.555415, PetaboxLoader3.datanode;dur=61.763236, PetaboxLoader3.resolve;dur=147.429666, load_resource;dur=110.158348
x-app-server: wwwb-app203
x-ts: 200
x-tr: 303
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
thoughtbot's squirrel at master — GitHub
We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]
This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (

This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (

Description: | Natural-looking Finder Queries for ActiveRecord |
Homepage: | https://www.thoughtbot.com/projects/squirrel |
Clone URL: |
git://github.com/thoughtbot/squirrel.git
Give this clone URL to anyone.
git clone git://github.com/thoughtbot/squirrel.git
|
squirrel /
name | age | message | |
---|---|---|---|
![]() |
.gitignore | Fri Jun 20 13:55:12 -0700 2008 | Added .gitignore [jyurek] |
![]() |
README | Thu Apr 24 14:48:03 -0700 2008 | added website to readme [jyurek] |
![]() |
Rakefile | Mon Mar 24 18:44:42 -0700 2008 | Added first pass at a will_paginate compatabili... [jyurek] |
![]() |
init.rb | Fri Jun 20 13:54:27 -0700 2008 | Added capacity for scoped to take a Squirrel bl... [jyurek] |
![]() |
lib/ | Thu Jun 26 13:24:49 -0700 2008 | Fixed the actual problem this time. [jyurek] |
![]() |
test/ | Wed Jun 25 11:20:06 -0700 2008 | Added ability to compare to other columns. [jyurek] |
README
Squirrel ====== SQL Simplification Plugin for ActiveRecord This plugin extends the ActiveRecord::Base#find method to be able to take a block of Ruby which will get parsed into a nice SQL string and have its results returned. Author:: Jon Yurek (mailto:jyurek@thoughtbot.com) Copyright:: Copyright(c) 2008 thoughtbot, inc. License:: Distributes under the same terms as Ruby Website:: https://www.thoughtbot.com/projects/squirrel Squirrel is a plugin for ActiveRecord which attempts to make SQL querier a much more natural prospect. You can write your queries in Ruby code and they get translated, including all proper table joins, into relevant SQL code and executed, returning your results. User.find(:all) do first_name.contains? params[:first_name] posts.created_at >= 1.week.ago end This query will return all Users that have a first_name that contains whatever was passed in as the "first_name" parameter, and that has any Posts that were created"in the past week. Both columns and associations are referenced as methods. Columns are referenced exactly as they are in the database, and associations are referenced exactly as they are specified in their respective has_many, belongs_to, etc calls. For example, in the snippet above, the User has_many :posts, and so we use "posts" as the method to refer to that association. This mechanism works for *all* of ActiveRecord's associations, because it piggybacks on AR's eager loading functionality, which always produces the joins necessary for getting the columns required. By default, all conditions specified in the query are ANDed together. If it is necessary to have any condition match, you can group your conditions together using the "any" method, which takes a block containing the conditions. For example: Playlist.find(:all) do any do name == "Party Mix" total_length > 3600 end end ... will find all Playlists that either have a name of "Party Mix" or that have a total length of 1 hour (3600 seconds). There is also an "all" method that works similarly, but joins with "AND". These groups are nestable." Currenly, there is no allowance in Squirrel for either grouping or fetching columns that aren't part of any of the included tables.
This feature is coming soon. Sit tight!