<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Jim Lindley: Notes - Edge Rails Notes</title>
  <id>tag:notes.jimlindley.com,2008:mephisto/notes</id>
  <generator uri="http://mephistoblog.com" version="0.8.0">Mephisto Drax</generator>
  <link href="http://notes.jimlindley.com/feed/notes/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://notes.jimlindley.com/notes" rel="alternate" type="text/html"/>
  <updated>2008-03-31T15:52:02Z</updated>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2008-03-31:238</id>
    <published>2008-03-31T15:44:00Z</published>
    <updated>2008-03-31T15:52:02Z</updated>
    <category term="Edge Rails Notes"/>
    <category term="Rails"/>
    <link href="http://notes.jimlindley.com/2008/3/31/rails-2-1" rel="alternate" type="text/html"/>
    <title>Rails 2.1</title>
<content type="html">
            &lt;p&gt;Rails 2.1 is almost here, and there are two great resources for learning about it:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://ryandaigle.com/&quot;&gt;Ryan Daigle&#8217;s &#8216;What&#8217;s New In Edge Rails&#8217;&lt;/a&gt;, and Rails contrubutor Chu Yeow&#8217;s series: &lt;a href=&quot;http://blog.codefront.net/category/ruby-on-rails/&quot;&gt;&#8216;Living on the Edge of Rails&#8217;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Lots of fun stuff for this point release!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2007-11-29:143</id>
    <published>2007-11-29T16:07:00Z</published>
    <updated>2008-03-23T15:46:20Z</updated>
    <category term="Edge Rails Notes"/>
    <category term="Rails"/>
    <category term="Releases"/>
    <link href="http://notes.jimlindley.com/2007/11/29/rails-2-0-rc-2-released" rel="alternate" type="text/html"/>
    <title>Rails 2.0 RC 2 Released</title>
<content type="html">
            &lt;p&gt;It looks like we are &lt;a href=&quot;http://feeds.feedburner.com/~r/RidingRails/~3/192216936/rails-2-0-release-candidate-2&quot;&gt;a week away from the actual 2.0 release&lt;/a&gt;, you can check out the preview release by pulling from the gem from the Rails dev server, or freezing to edge in your project like so:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rake rails:freeze:edge TAG=rel_2-0-0_RC2
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Remember, upgrade to the latest version of 1.2.x (&lt;a href=&quot;http://weblog.rubyonrails.org/2007/11/24/ruby-on-rails-1-2-6-security-and-maintenance-release&quot;&gt;1.2.6 at the moment&lt;/a&gt;), and check for any deprecation warnings before trying to run 2.0, unless you&#8217;ve been running on edge lately.&lt;/p&gt;

&lt;p&gt;This release candidate contains many bug fixes but minimal new features over the last release candidate.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2007-11-10:129</id>
    <published>2007-11-10T23:45:00Z</published>
    <updated>2008-03-23T15:46:19Z</updated>
    <category term="Edge Rails Notes"/>
    <category term="Rails"/>
    <link href="http://notes.jimlindley.com/2007/11/10/rake-db-reset-changes-schema-rb-info" rel="alternate" type="text/html"/>
    <title>Rake db:reset Changes, schema.rb Info</title>
<content type="html">
            &lt;p&gt;DHH has updated the &lt;a href=&quot;http://dev.rubyonrails.org/changeset/8124&quot;&gt;docs for schema.rb&lt;/a&gt;, to reflect the fact that schema.rb is an important file that should be kept into version control. He recommends that production apps be initialized to their schema via this file, and not from migrations.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;http://dev.rubyonrails.org/changeset/8123&quot;&gt;rake db:reset task has been changed&lt;/a&gt; to reflect this philosophy, it will now run the db:schema:load instead of db:migrate after first dropping then recreating your database.&lt;/p&gt;

&lt;p&gt;Migrations, as they build up over time, become increasingly fragile, whereas schema.rb is likely consistent to the current version of your schema and many fewer steps to load. One thing to keep in mind is that schema.rb does not preserve all the same setting that migrations do - character sets, collations, and other database dependent features. If you need those, switch from having a ruby schema.rb to an SQL schema file.&lt;/p&gt;

&lt;p&gt;Switch to SQL by uncommenting this line in environment.rb:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# config.active_record.schema_format = :sql
&lt;/code&gt;&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2007-11-10:126</id>
    <published>2007-11-10T23:14:00Z</published>
    <updated>2008-03-23T15:46:19Z</updated>
    <category term="Edge Rails Notes"/>
    <category term="Site News"/>
    <link href="http://notes.jimlindley.com/2007/11/10/site-news" rel="alternate" type="text/html"/>
    <title>Site News</title>
<content type="html">
            &lt;p&gt;If you subscribe to this feed purely for the list of major changes to edge Rails, you might want to switch &lt;a href=&quot;http://notes.jimlindley.com/feed/notes/atom.xml&quot;&gt;to this feed for that category of posts&lt;/a&gt;. I&#8217;m planning on talking about a wider range of subjects (still all programming and mostly Ruby related, and I won&#8217;t neglect Edge Rails) on this blog. I&#8217;ve also redirected the site from edgenotes.jimlindley.com to notes.jimlindley.com to reflect this change in direction, but it should be picked up up invisibly by feed readers. &lt;/p&gt;

&lt;p&gt;Please leave comment if you find a problem with the site move.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2007-11-07:120</id>
    <published>2007-11-07T14:57:00Z</published>
    <updated>2008-03-23T15:46:19Z</updated>
    <category term="Edge Rails Notes"/>
    <category term="Rails"/>
    <category term="Releases"/>
    <category term="javascript prototype scriptaculous"/>
    <link href="http://notes.jimlindley.com/2007/11/7/prototype-1-6-and-script-aculo-us-1-8" rel="alternate" type="text/html"/>
    <title>Prototype 1.6 and Script.aculo.us 1.8</title>
<content type="html">
            &lt;p&gt;The javascript libraries included with Rails have been bumped up to the latest release versions of each: &lt;a href=&quot;http://prototypejs.org/&quot;&gt;Prototype 1.6&lt;/a&gt; and &lt;a href=&quot;http://Script.aculo.us&quot;&gt;Script.acul.ous 1.8&lt;/a&gt;. It looks like these are the versions that will make it into the final Rails 2.0 release.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://dev.rubyonrails.org/changeset/8087&quot;&gt;Changeset #8087&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2007-10-27:116</id>
    <published>2007-10-27T18:42:00Z</published>
    <updated>2008-03-23T15:46:19Z</updated>
    <category term="Edge Rails Notes"/>
    <category term="rake migrations"/>
    <link href="http://notes.jimlindley.com/2007/10/27/rake-db-rollback" rel="alternate" type="text/html"/>
    <title>rake db:rollback</title>
<content type="html">
            &lt;p&gt;A new rake task, rollback, which will revert the latest applied migration.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rake db:rollback
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or for multiple steps back:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rake db:rollback STEP=2
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href=&quot;http://dev.rubyonrails.org/changeset/8039&quot;&gt;Changeset #8039&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2007-10-27:115</id>
    <published>2007-10-27T18:40:00Z</published>
    <updated>2008-03-23T15:46:19Z</updated>
    <category term="Edge Rails Notes"/>
    <category term="fixtures activerecord"/>
    <link href="http://notes.jimlindley.com/2007/10/27/foxy-fixtures" rel="alternate" type="text/html"/>
    <title>Foxy Fixtures</title>
<content type="html">
            &lt;p&gt;Just added to edge Rails is an update that makes fixtures worth using again. Instead of manually specifying the keys of associated fixtures or created/modified times, like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# in users.yaml

  jdoe:
    id: 1
    name: John Doe
    created_at: &amp;lt;%= Time.now %&amp;gt;
    modified_at: &amp;lt;%= Time.now %&amp;gt;

# in photos.yaml

  sunset_photo:
    id: 42
    title: Photo of a Sunset
    user_id: 1
    created_at: &amp;lt;%= Time.now %&amp;gt;
    modified_at: &amp;lt;%= Time.now %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can just give the name of the associated fixture and Rails will figure out keys for you:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# in users.yaml

  jdoe:
    name: John Doe

# in photos.yaml

  sunset_photo:
    title: Photo of a Sunset
    user: jdoe # user not user_id
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;For has_and_belongs_to_many assocations, you can specify the relations with a comma separted list of references to the associated fixtures:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# in tags.yaml

  red:
    name: Red
    items: fire_hydrant, rover
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href=&quot;http://dev.rubyonrails.org/changeset/8036&quot;&gt;Changeset #8036&lt;/a&gt;, &lt;a href=&quot;http://edgedocs.jimlindley.com/classes/Fixtures.html&quot;&gt;RDoc&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2007-10-22:98</id>
    <published>2007-10-22T00:29:00Z</published>
    <updated>2008-03-23T15:46:19Z</updated>
    <category term="Edge Rails Notes"/>
    <link href="http://notes.jimlindley.com/2007/10/22/filter-chain-halting" rel="alternate" type="text/html"/>
    <title>Filter Chain Halting</title>
<content type="html">
            &lt;p&gt;Controller filters (in 1.2.x and previous) stop when a filter returns false. Checked into edge today, and sure to show up in the next 2.0 RC, is a break to that behaviour. &lt;/p&gt;

&lt;p&gt;In 2.0 filters can only halt the chain with a &lt;i&gt;render&lt;/i&gt; or &lt;i&gt;redirect&lt;/i&gt; (similar to the actual controller methods themselves). It was too easy for an errant filter halt to lead to a white screen of death. Be sure to comb through your code and consider how your execution flow will be affected.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://dev.rubyonrails.org/changeset/7984&quot;&gt;Changeset #7984&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2007-10-20:97</id>
    <published>2007-10-20T01:29:00Z</published>
    <updated>2008-03-23T15:46:19Z</updated>
    <category term="Edge Rails Notes"/>
    <link href="http://notes.jimlindley.com/2007/10/20/sexy-migration-additions" rel="alternate" type="text/html"/>
    <title>Sexy Migration Addition</title>
<content type="html">
            &lt;p&gt;A new foreign key helper for sexy migrations, &#8216;references&#8217;. &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;create_table :users do |t|
  # old: t.integer :profile_id
  t.references :profile 
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It can also do polymorphic relations, like so (from the Rails docs)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;create_table :taggings do |t| 
   t.references :tag 
   t.references :tagger, :polymorphic =&amp;gt; true 
   t.references :taggable, 
                :polymorphic =&amp;gt; { :default =&amp;gt; 'Photo' } 
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href=&quot;http://dev.rubyonrails.org/changeset/7973&quot;&gt;Changeset #7973&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2007-10-15:95</id>
    <published>2007-10-15T18:19:00Z</published>
    <updated>2008-03-23T15:46:19Z</updated>
    <category term="Edge Rails Notes"/>
    <link href="http://notes.jimlindley.com/2007/10/15/error-message-options" rel="alternate" type="text/html"/>
    <title>Error Message Options</title>
<content type="html">
            &lt;p&gt;New in trunk, additional options for presenting model errors. You can now add :message or :header_message to &#8216;error_messages_for&#8217;, to override the default messages.&lt;/p&gt;

&lt;p&gt;Currently the messages are based on the model name and error count, but those can be misleading in some presentations.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://dev.rubyonrails.org/changeset/7870&quot;&gt;Changeset #7870&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2007-10-15:93</id>
    <published>2007-10-15T18:08:00Z</published>
    <updated>2008-03-23T15:46:19Z</updated>
    <category term="Edge Rails Notes"/>
    <category term="Releases"/>
    <link href="http://notes.jimlindley.com/2007/10/15/rails-1-2-5" rel="alternate" type="text/html"/>
    <title>Rails 1.2.5</title>
<content type="html">
            &lt;p&gt;I was away this weekend, so this is old news by now, but Rails 1.2.5 is out. &lt;a href=&quot;&quot;&gt;It fixes several bugs and security issues&lt;/a&gt;, and is a recommended update for all 1.2.x users.&lt;/p&gt;

&lt;p&gt;(quoting from the announcement):&lt;/p&gt;

&lt;p&gt;To upgrade:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gem install rails
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Set RAILS&lt;em&gt;GEM&lt;/em&gt;VERSION to ‘1.2.5’ in config/environment.rb, and run: &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rake rails:update:configs
&lt;/code&gt;&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2007-10-08:92</id>
    <published>2007-10-08T00:35:00Z</published>
    <updated>2008-03-23T15:46:19Z</updated>
    <category term="Edge Rails Notes"/>
    <category term="activesupport"/>
    <link href="http://notes.jimlindley.com/2007/10/8/installing-xml-builder" rel="alternate" type="text/html"/>
    <title>Installing XML Builder</title>
<content type="html">
            &lt;p&gt;Builder will no longer be bundled inside Rails, it will be required as a Gem dependency. You can install Builder with a simple &#8216;gem install builder&#8217;, and the minimum required version is 2.1.2. &lt;a href=&quot;http://dev.rubyonrails.org/changeset/7761&quot;&gt;Changeset #7761&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(This currently only applies to trunk, not the Rails 2.0 Release Candidate)&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2007-10-05:89</id>
    <published>2007-10-05T17:54:00Z</published>
    <updated>2008-03-23T15:46:19Z</updated>
    <category term="Edge Rails Notes"/>
    <link href="http://notes.jimlindley.com/2007/10/5/installing-action-web-services" rel="alternate" type="text/html"/>
    <title>Installing Action Web Services</title>
<content type="html">
            &lt;p&gt;If you need the recently removed Action Web Services, it can currently be installed like this (but all on one line):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;svn export \ 
  http://dev.rubyonrails.org/svn/rails/trunk/actionwebservice/ \
  vendor/rails/actionwebservice
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;(Or via piston, etc, from the same address)&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2007-10-03:87</id>
    <published>2007-10-03T19:59:00Z</published>
    <updated>2008-03-23T15:46:19Z</updated>
    <category term="Edge Rails Notes"/>
    <category term="ActiveResource rails2"/>
    <link href="http://notes.jimlindley.com/2007/10/3/initialization-errors-rails-2-0-rc" rel="alternate" type="text/html"/>
    <title>Initialization Errors / Rails 2.0 Preview Release</title>
<content type="html">
            &lt;p&gt;If you&#8217;ve frozen to the Rails 2.0 preview release via this rake task:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rails:freeze:edge TAG=rel_2-0-0_PR
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And are getting errors from the Rails initializer, run it again. The first time it runs, it does not know how to install Active Resource, but once everything else is in place (including the new 2.0 rake tasks), it will correctly download all the right stuff.&lt;/p&gt;

&lt;p&gt;(Tip seen on the Rails-Core mailing list, thanks Mislav Marohnić.)&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://notes.jimlindley.com/">
    <author>
      <name>Jim Lindley</name>
    </author>
    <id>tag:notes.jimlindley.com,2007-09-30:85</id>
    <published>2007-09-30T23:37:00Z</published>
    <updated>2008-03-23T15:46:19Z</updated>
    <category term="Edge Rails Notes"/>
    <category term="Releases"/>
    <link href="http://notes.jimlindley.com/2007/9/30/rails-2-preview-release" rel="alternate" type="text/html"/>
    <title>Rails 2 Preview Release</title>
<content type="html">
            &lt;p&gt;A Rails 2.0 RC has been tagged. &lt;a href=&quot;http://dev.rubyonrails.org/changeset/7702&quot;&gt;Changeset #7702&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To use it in your app, use this rake task:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rake rails:freeze:edge TAG=rel_2-0-0_PR
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And try it out. There will be a Rails 1.2.4 release soon that will contain additional deprecation warnings for 2.0, so if you don't have time to jump right in, wait for that first and you'll have a friendlier face on your update process.&lt;/p&gt;

&lt;p&gt;Also, check out the official &lt;a href=&quot;http://weblog.rubyonrails.org/2007/9/30/rails-2-0-0-preview-release&quot;&gt;Rails 2 Preview Release announcement&lt;/a&gt;, which contains a run down of all the major changes from 1.2 to 2.0.&lt;/p&gt;
          </content>  </entry>
</feed>
