CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Tue, 26 Aug 2025 05:33:14 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090425003258
location: https://web.archive.org/web/20090425003258/https://github.com/thoughtbot/squirrel/tree/
server-timing: captures_list;dur=0.535324, exclusion.robots;dur=0.022309, exclusion.robots.policy;dur=0.010105, esindex;dur=0.011167, cdx.remote;dur=20.650331, LoadShardBlock;dur=259.454766, PetaboxLoader3.datanode;dur=82.428018, PetaboxLoader3.resolve;dur=124.412127
x-app-server: wwwb-app224
x-ts: 302
x-tr: 310
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app224; 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: Tue, 26 Aug 2025 05:33:15 GMT
content-type: text/html; charset=utf-8
content-length: 115
x-archive-orig-server: nginx/0.6.26
x-archive-orig-date: Sat, 25 Apr 2009 00:32:57 GMT
x-archive-orig-connection: close
x-archive-orig-set-cookie: _github_ses=BAh7BzoOcmV0dXJuX3RvIikvc2xpY2VvZnBpL2VzcHJlc3NvLXRoZW1lcy93aWtpcy9uZXciCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1c2VkewA%3D--2bfe662a775cf2a05c26c14a511e9a60ad1d0ea8; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT; HttpOnly
x-archive-orig-status: 301 Moved Permanently
location: https://web.archive.org/web/20090425003258/https://github.com/thoughtbot/squirrel/tree/master
x-archive-orig-x-runtime: 344ms
x-archive-orig-cache-control: no-cache
x-archive-orig-content-length: 115
cache-control: max-age=1800
memento-datetime: Sat, 25 Apr 2009 00:32:58 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="Mon, 16 Mar 2009 17:46:28 GMT", ; rel="memento"; datetime="Sat, 25 Apr 2009 00:32:58 GMT", ; rel="next memento"; datetime="Mon, 18 May 2009 08:50:18 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_9_20090425001105_crawl102-c/52_9_20090425003229_crawl101.arc.gz
server-timing: captures_list;dur=1.083881, exclusion.robots;dur=0.018450, exclusion.robots.policy;dur=0.009082, esindex;dur=0.011012, cdx.remote;dur=11.396883, LoadShardBlock;dur=151.023231, PetaboxLoader3.datanode;dur=92.594167, PetaboxLoader3.resolve;dur=243.601512, load_resource;dur=239.013579
x-app-server: wwwb-app224
x-ts: 301
x-tr: 435
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: Tue, 26 Aug 2025 05:33:15 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Sat, 25 Apr 2009 00:32:58 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 205ms
x-archive-orig-etag: "8a5f598697cb6dc51c50d16fad49a060"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 19218
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sat, 25 Apr 2009 00:32:58 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="Thu, 26 Mar 2009 07:38:27 GMT", ; rel="memento"; datetime="Sat, 25 Apr 2009 00:32:58 GMT", ; rel="next memento"; datetime="Mon, 18 May 2009 08:50:18 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_9_20090425001105_crawl102-c/52_9_20090425003229_crawl101.arc.gz
server-timing: captures_list;dur=0.433033, exclusion.robots;dur=0.015954, exclusion.robots.policy;dur=0.007348, esindex;dur=0.011563, cdx.remote;dur=16.912702, LoadShardBlock;dur=164.594475, PetaboxLoader3.datanode;dur=139.319379, PetaboxLoader3.resolve;dur=139.106618, load_resource;dur=117.009625
x-app-server: wwwb-app224
x-ts: 200
x-tr: 347
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
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 /
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!