Rails 1.0 RC4 (0.14.3): It's the final countdown!

Comrades, we are so close to the goal that the relieve should be
tastable. The mythical 1.0 release is now penned to be the very next
release once we rattle out the heinous bugs from this one. So we need
every man, woman, and child at work testing the living daylights out
of this final release candidate. Upgrade your apps, start new ones,
kick the tires, rev the engine, do it all!

So what’s new? What’s in there to make it pay to upgrade today rather
than at 1.0? Lots! In a regular universe, this would have counted as
more than merely a 0.0.1 increment. We got a ton of stuff especially
for Active Record and the Rails infrastructure.

The new commands

  • script/server: Will now use lighttpd/FCGI if both are available on
    the system. This makes for a considerably faster development
    experience than WEBrick, but is unfortunately a OS X/*nix thing only.
    Windows users will continue to get a WEBrick-powered server launched.

  • script/plugin: Your gateway to the wonderful world of plugins. Helps
    you install, manage, and discover new plugins. See script/plugin
    –help for more.

  • script/about: Gives you the all the versions for Rails and
    associates. See the sample on http://bumble.jamisbuck.org/6

Active Record: find_or_create_by_X, association collection
extensions, migrations for all databases

We’ve added a new dynamic finder that allows you to find or create a
new record on the basis of attributes passed, such as saying
Tag.find_or_create_by_name(“Summer”). It even works on associations,
so page.tags.find_or_create_by_name(“Summer”) is kosher too.

Extensions for association collections is a sexy new way of adding
methods to the proxies that all access delegate through. Example:

class Account < ActiveRecord::Base
has_many :people do
def find_or_create_by_name(name)
first_name, *last_name = name.split
last_name = last_name.join " "

    find_or_create_by_first_name_and_last_name(first_name, 

last_name)
end
end
end

person = Account.find(:first).people.find_or_create_by_name(“David
Heinemeier H.”)
person.first_name # => “David”
person.last_name # => “Heinemeier H.”

And finally we’ve really put the spit and polish on the database
adapters by adding migration support to all the commercial ones. As
well as giving especially the SQL Server one a good loving in general.

Action Pack: Better filter controls, fixed ActiveRecordStore, and
redirect_to :back

Action Controller now has skip_before_filter and skip_after_filter to
sidestep certain filters set in superclasses that doesn’t apply to the
current controller. Such as specifying :authenticate in
ApplicationController, but skiping it in the SignupController.

The ActiveRecordStore no longer only saves when changes have occured,
so you can again rely on updated_at being incremented at each page
view, and thus rely on it for garbage collection.

Finally we now have an easy way of saying “go back to where you came
from” with redirect_to :back.

Upgrading from 0.14.x

It has never been so easy to upgrade to the latest and greatest if
you’re on 0.14.x series. You get almost all of it for free simply by
installing the latest gems and the rest by running these two commands:

rake update_javascripts
rake add_new_scripts

I’ll let you figure out what those do.

Upgrading from 0.13.x (or earlier)

Jeremy K. has put together a great guide to upgrading from an
earlier version at http://manuals.rubyonrails.org/read/book/19

What else is new?

As usual, you get the full play-by-play story of the changes by
examining the changelogs. Such wonderful bedtime reading.

David Heinemeier H.
http://www.loudthinking.com – Broadcasting Brain
http://www.basecamphq.com – Online project management
http://www.backpackit.com – Personal information manager
http://www.rubyonrails.com – Web-application framework

On 11/8/05, David Heinemeier H. [email protected] wrote:

What else is new?

As usual, you get the full play-by-play story of the changes by
examining the changelogs. Such wonderful bedtime reading.

Hello David,

I read in the ActionPack changelog:
“Added request as instance method to views, so you can do <%=
request.env[“HTTP_REFERER”] %>, just like you can already access
response, session, and the likes [DHH]”

Can you make the request object available for ActionMailer’s views too ?

Thanks !

Hi David, all, quick problem with the new version. I did an upgrade of
an app and everything seems to be working alright, but running the
‘script/server’ command is still firing up WEBrick and not lighttp.

Odd thing is I was playing around with it last night on a test app and
it launched lighttp, but now it refuses to on upgraded and new apps.

Any thoughts?
-Nick

With a default install of lighttpd, the binary is installed in
/usr/local/sbin, which is typically not in your path. A quick test:
type ‘lighttpd’ at your prompt. Not found? Then you’ll either need
to add /usr/local/sbin to your path, move the lighttpd binary, or
create a simlink to a bin directory in your path. That way rails can
find it at startup time.

Hope that helps.

caleb

On 11/9/05, Nick S. [email protected] wrote:

Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


caleb
http://www.ruejulesverne.com