# Rails 1.2.2: SQLite3, gems, singular resources

**URL:** <https://www.ruby-forum.com/t/rails-1-2-2-sqlite3-gems-singular-resources/84644>\
**Category:** Rails\
**Created:** [February 6, 2007, 5:54pm UTC](https://www.ruby-forum.com/t/rails-1-2-2-sqlite3-gems-singular-resources/84644 "2007-02-06T17:54:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DHH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/258eb7/32.png) [@DHH](https://www.ruby-forum.com/u/DHH)\
**Post date:** [February 6, 2007, 5:54pm UTC](https://www.ruby-forum.com/t/rails-1-2-2-sqlite3-gems-singular-resources/84644/1 "2007-02-06T17:54:43Z")

</div>

It’s time for another minor update to Rails 1.2. This was primarily  
prompted by a change in the API for SQLite between version 3.3.7 and  
3.3.8+, which left the Rails database adapter for dead by the road  
side. But with this release and Jamis B.'s sqlite3-ruby gem at  
version 1.2.1, we’re back in business on all versions of SQLite3.

Second, we’re now depending on RubyGems 0.9.0 and above. This will fix  
the deprecation messages for require\_gem (the new method is just gem)  
and will restore rake rails:freeze:gems to working order. So be sure  
to update to the latest RubyGems before installing. That’s done with  
“gem update --system”.

Finally, we’ve decided to throw in a few goodies along with the fixes  
described above and the rest of the bug reparations in this release.  
Singular resources, for example, allow you to model singleton  
resources within the scope of the domain. The common example is  
[user.application.com/account](http://user.application.com/account). That’s now modeled with:

map.resource :account

…and routes accordingly:

GET /account =\> AccountController#show  
GET /account/new =\> AccountController#new  
GET /account;edit =\> AccountController#edit  
POST /account =\> AccountController#create  
PUT /account =\> AccountController#update  
DELETE /account =\> AccountController#destroy

Note that the controller is also singular, not plural as is usually  
the case when using map.resources.

We’ve also brought over the enhancement to :conditions in Active  
Record that’ll allow you to pass in ranges and get them automatically  
converted to BETWEEN statements. Like:

Student.find(:all, :conditions =\> { :grade =\> 9…12 })

…which then becomes:

“SELECT \* FROM students WHERE grade BETWEEN 9 AND 12”

This is a recommended upgrade for everyone running 1.2.x (and a  
reminder that if you’re not yet on Rails 1.2.x, you won’t be getting  
bug fixes automatically and have to backport them yourself). It’s a  
drop-in replacement requiring no changes to applications running  
1.2.x.

Enjoy!

---

<div class="post-metadata">

**Author:** ![DHH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/258eb7/32.png) [@DHH](https://www.ruby-forum.com/u/DHH)\
**Post date:** [February 6, 2007, 6:44pm UTC](https://www.ruby-forum.com/t/rails-1-2-2-sqlite3-gems-singular-resources/84644/2 "2007-02-06T18:44:48Z")

</div>

On Feb 6, 11:53 am, “DHH” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> “gem update --system”.
> 
> We’ve also brought over the enhancement to :conditions in Active  
> reminder that if you’re not yet on Rails 1.2.x, you won’t be getting  
> bug fixes automatically and have to backport them yourself). It’s a  
> drop-in replacement requiring no changes to applications running  
> 1.2.x.
> 
> Enjoy!

How about a tag in the repository so we can freeze it?

\_Kevin

---

<div class="post-metadata">

**Author:** ![DHH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/258eb7/32.png) [@DHH](https://www.ruby-forum.com/u/DHH)\
**Post date:** [February 6, 2007, 6:48pm UTC](https://www.ruby-forum.com/t/rails-1-2-2-sqlite3-gems-singular-resources/84644/3 "2007-02-06T18:48:49Z")

</div>

On Feb 6, 12:43 pm, “\_Kevin” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Second, we’re now depending on RubyGems 0.9.0 and above. This will fix
> 
> How about a tag in the repository so we can freeze it?
> 
> \_Kevin

Never mind, it’s there.

---

<div class="post-metadata">

**Author:** ![DHH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/258eb7/32.png) [@DHH](https://www.ruby-forum.com/u/DHH)\
**Post date:** [February 6, 2007, 6:59pm UTC](https://www.ruby-forum.com/t/rails-1-2-2-sqlite3-gems-singular-resources/84644/4 "2007-02-06T18:59:50Z")

</div>

On 2/6/07, \_Kevin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Never mind, it’s there.

Is this correct?

rake rails:freeze:edge TAG=rel\_1-2-2

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)

---

<div class="post-metadata">

**Author:** ![DHH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/258eb7/32.png) [@DHH](https://www.ruby-forum.com/u/DHH)\
**Post date:** [February 6, 2007, 7:06pm UTC](https://www.ruby-forum.com/t/rails-1-2-2-sqlite3-gems-singular-resources/84644/5 "2007-02-06T19:06:51Z")

</div>

> Is this correct?
> 
> rake rails:freeze:edge TAG=rel\_1-2-2

Works for me.

Nicolai

---

<div class="post-metadata">

**Author:** ![DHH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/258eb7/32.png) [@DHH](https://www.ruby-forum.com/u/DHH)\
**Post date:** [February 6, 2007, 8:26pm UTC](https://www.ruby-forum.com/t/rails-1-2-2-sqlite3-gems-singular-resources/84644/6 "2007-02-06T20:26:01Z")

</div>

I upgraded and ran into a routing error. I have this in my routes.rb:

map.resources :campaigns, :collection =\> { :pause =\> :post, :resume =\>  
:post, :destroy =\> :delete }

Before 1.2.2, that meant I could do (in console):

> > app.destroy\_campaigns\_path  
> > =\> “/campaigns;destroy”

Now it that throws an error:  
ActionController::RoutingError: destroy\_campaigns\_url failed to generate  
from {:controller=\>“campaigns”, :action=\>“destroy”}, expected:  
{:controller=\>“campaigns”, :action=\>“destroy”, :id=\>/[^/;.,?]+/}, diff:  
{:id=\>/[^/;.,?]+/}

If I pass it an :id, it works, but doesn’t even use the :id

> > app.destroy\_campaigns\_path :id =\> 1  
> > =\> “/campaigns;destroy”

What is the point of that? Is it supposed to be that way and, if so,  
then  
how can I do a collection delete?

ed

---

<div class="post-metadata">

**Author:** ![DHH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/258eb7/32.png) [@DHH](https://www.ruby-forum.com/u/DHH)\
**Post date:** [February 7, 2007, 3:22am UTC](https://www.ruby-forum.com/t/rails-1-2-2-sqlite3-gems-singular-resources/84644/7 "2007-02-07T03:22:40Z")

</div>

I upgraded from Rails 1.2.1 and got the following error:

Updating installed gems…  
Bulk updating Gem source index for: [http://gems.rubyforge.org](http://gems.rubyforge.org)  
Attempting remote update of rails  
Successfully installed rails-1.2.2  
Successfully installed activesupport-1.4.1  
Successfully installed activerecord-1.15.2  
Successfully installed actionpack-1.13.2  
Successfully installed actionmailer-1.3.2  
Successfully installed actionwebservice-1.2.2  
Installing ri documentation for activesupport-1.4.1…  
Installing ri documentation for activerecord-1.15.2…  
/usr/local/lib/ruby/1.8/rdoc/parsers/parse\_rb.rb:1272: [BUG]  
Segmentation fault  
ruby 1.8.5 (2006-08-25) [powerpc-darwin8.8.0]

Abort trap

When I typed rails -v, I got Rails 1.2.2. All my tests passed.

Does the error message cause any problems? Can someone please help? TIA.
