CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 06 Aug 2025 02:04:20 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20080919102757
location: https://web.archive.org/web/20080919102757/https://github.com/sevenwire/searchable_record/tree
server-timing: captures_list;dur=0.522172, exclusion.robots;dur=0.018795, exclusion.robots.policy;dur=0.009228, esindex;dur=0.010830, cdx.remote;dur=19.433330, LoadShardBlock;dur=240.317352, PetaboxLoader3.datanode;dur=62.451518, PetaboxLoader3.resolve;dur=44.628764
x-app-server: wwwb-app204
x-ts: 302
x-tr: 282
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: wb-p-SERVER=wwwb-app204; 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 302
server: nginx
date: Wed, 06 Aug 2025 02:04:20 GMT
content-type: text/html; charset=utf-8
content-length: 123
x-archive-orig-server: nginx/0.6.26
x-archive-orig-date: Fri, 19 Sep 2008 10:27:56 GMT
x-archive-orig-connection: close
x-archive-orig-status: 302 Found
location: https://web.archive.org/web/20080919102757/https://github.com/sevenwire/searchable_record/tree/master
x-archive-orig-x-runtime: 0.92187
x-archive-orig-cache-control: no-cache
x-archive-orig-content-length: 123
cache-control: max-age=1800
memento-datetime: Fri, 19 Sep 2008 10:27:57 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Fri, 19 Sep 2008 10:27:57 GMT", ; rel="memento"; datetime="Fri, 19 Sep 2008 10:27:57 GMT", ; rel="last memento"; datetime="Fri, 19 Sep 2008 10:27:57 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_5_20080919080437_crawl103-c/52_5_20080919102416_crawl103.arc.gz
server-timing: captures_list;dur=0.515795, exclusion.robots;dur=0.019521, exclusion.robots.policy;dur=0.008997, esindex;dur=0.010792, cdx.remote;dur=13.194347, LoadShardBlock;dur=384.084299, PetaboxLoader3.resolve;dur=283.732749, PetaboxLoader3.datanode;dur=99.583726, load_resource;dur=151.795499
x-app-server: wwwb-app204
x-ts: 302
x-tr: 576
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: Wed, 06 Aug 2025 02:04:21 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Fri, 19 Sep 2008 10:27:57 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 0.61234
x-archive-orig-etag: "e8f696a677b194e5361b33784578dd47"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 20121
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Fri, 19 Sep 2008 10:27:57 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Fri, 19 Sep 2008 10:27:57 GMT", ; rel="memento"; datetime="Fri, 19 Sep 2008 10:27:57 GMT", ; rel="next memento"; datetime="Sun, 28 Sep 2008 12:32:43 GMT", ; rel="last memento"; datetime="Sun, 28 Sep 2008 12:32:43 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_5_20080919080437_crawl103-c/52_5_20080919102416_crawl103.arc.gz
server-timing: captures_list;dur=0.735837, exclusion.robots;dur=0.028018, exclusion.robots.policy;dur=0.012263, esindex;dur=0.015310, cdx.remote;dur=10.499031, LoadShardBlock;dur=126.461247, PetaboxLoader3.datanode;dur=78.157967, PetaboxLoader3.resolve;dur=98.456246, load_resource;dur=76.789404
x-app-server: wwwb-app204
x-ts: 200
x-tr: 288
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
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
sevenwire's searchable_record 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: | Fork of searchable_record plugin. Now works with will_paginate and the IN operator. |
Homepage: | https://sevenwire.com |
Clone URL: |
git://github.com/sevenwire/searchable_record.git
Give this clone URL to anyone.
git clone git://github.com/sevenwire/searchable_record.git
|
Search Repo: |
name | age | message | |
---|---|---|---|
![]() |
ChangeLog | Sun Jun 01 20:03:11 -0700 2008 | Really, the initial commit. [brandonarbini] |
![]() |
MIT-LICENSE | Sun Jun 01 20:03:11 -0700 2008 | Really, the initial commit. [brandonarbini] |
![]() |
README | Sat May 17 14:12:31 -0700 2008 | Initial import of the plugin. Already has modif... [brandonarbini] |
![]() |
Rakefile | Sun Jun 01 20:03:11 -0700 2008 | Really, the initial commit. [brandonarbini] |
![]() |
init.rb | Sun Jun 01 20:03:11 -0700 2008 | Really, the initial commit. [brandonarbini] |
![]() |
lib/ | Sun Jun 01 20:03:11 -0700 2008 | Really, the initial commit. [brandonarbini] |
![]() |
test/ | Sun Jun 01 20:03:11 -0700 2008 | Really, the initial commit. [brandonarbini] |
README
= SearchableRecord A small Ruby on Rails plugin that makes the parsing of query parameters from URLs easy for resources, allowing the requester to control the items (records) shown in the resource's representation. The implementation is a helper module (a mixin) for ActiveRecord models. It is used by including SearchableRecord module in a model. The mixin provides a class method, <tt>find_queried</tt>, to the class that includes it. The method is a frontend to ActiveRecord::Base#find: it parses query parameters against the given rules and calls <tt>find</tt> accordingly, returning the results of <tt>find</tt>. == A usage example The following example, although a bit contrived, allows the client to * limit the number of items as the result of the search (<tt>limit</tt> parameter), * set an offset for the items (<tt>offset</tt> parameter, intended to be used together with <tt>limit</tt>), * sort the items either in ascending (<tt>sort</tt> parameter) or descending (<tt>rsort</tt> parameter) order by items' type and name, * to limit the result by matching only items that were update before (<tt>until</tt> parameter) or after (<tt>since</tt> parameter) a certain date, and * to limit the result by matching only items with certain kind of types (<tt>type</tt> parameter) or names (<tt>name</tt> parameter), or both (for a name, a conversion to the client supplied parameter must be applied before matching the name in the database). These requirements for the query parameters are expressed as the following rules: rules = { :limit => nil, # key as a flag; the value for the key is not used :offset => nil, # key as a flag :sort => { 'name' => 'items.name', 'created' => 'items.created_at' }, :rsort => nil, # rsort is allowed according to rules in :sort (key as a flag) :since => 'items.created_at', # cast parameter value as the default type :until => 'items.created_at', # cast parameter value as the default type :patterns => { :type => 'items.type', # match the pattern with the default operator and converter :name => { :column => 'items.name', :converter => lambda { |val| "%#{val.gsub('_', '.')}%" } } } # match the pattern with the default operator } The client wants to use the URL <tt>https://example-site.org/items?limit=5&offset=4&rsort=name&since=2008-02-28&name=foo_bar</tt> to fetch a representation of the resource containing the items. This results to the following parameters: # => query_params = { # 'offset' => '4', # 'limit' => '5', # 'rsort' => 'name', # 'until' => '2008-02-28', # 'name' => 'foo_bar', # ... # # plus Rails specific parameters, such as 'action' and 'controller' # } In addition, the application happens to require some options to be passed to <tt>find</tt>: options = { :include => [ :owners ], :conditions => "items.flag = 'f'" } When <tt>find_queried</tt> is called, with Item.find_queried(:all, query_params, rules, options) the result is the following call to <tt>find</tt>. Item.find(:all, :include => [ :owners ], :order => 'items.name desc', :offset => 4, :limit => 5, :conditions => [ "(items.flag = 'f') and (items.created_at <= cast(:until as datetime)) and (items.name like :name)", { :until => '2008-02-28', :name => '%foo.bar%' } ]) The search result for <tt>find</tt> contains at most 5 items that are * from offset 4 (that is, items from positions 5 to 9), * sorted in descending order by items' names, * updated since 2008-02-28, and * have <tt>foo.bar</tt> in their name. See +find_queried+ method in SearchableRecord::ClassMethods for usage documentation. == Installation In order to checkout the source code to the current working directory, execute: svn co https://searchable-rec.rubyforge.org/svn/trunk === Installation with Subversion svn:externals to a Ruby on Rails project In the root directory of the project, execute: svn propedit svn:externals vendor/plugins Add the following line to the file with an editor: searchable-rec https://searchable-rec.rubyforge.org/svn/trunk Save and exit the editor. Execute: svn ci -m 'Updated svn:external property for SearchableRecord.' vendor/plugins svn up vendor/plugins == Contacting Please send comments, suggestions, bugs, or patches by email to Tuomas Kareinen < tkareine (at) gmail (dot) com >. == Legal note Copyright (c) 2008 Tuomas Kareinen. SearchableRecord plugin is licensed under the MIT license.
This feature is coming soon. Sit tight!