aboutsummaryrefslogtreecommitdiffstats
path: root/railties/doc/guides
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-10-24 22:19:38 +0530
committerPratik Naik <pratiknaik@gmail.com>2008-10-24 22:20:08 +0530
commite7f06a8d50b8418c265b859c5e7809bcf0d67cf2 (patch)
treed19ffacd49dc97b42d74d1a5d94829b70780659a /railties/doc/guides
parentec5070c2e2d46c5f209da99bb2f3b455ec02c349 (diff)
downloadrails-e7f06a8d50b8418c265b859c5e7809bcf0d67cf2.tar.gz
rails-e7f06a8d50b8418c265b859c5e7809bcf0d67cf2.tar.bz2
rails-e7f06a8d50b8418c265b859c5e7809bcf0d67cf2.zip
Fix release notes
Diffstat (limited to 'railties/doc/guides')
-rw-r--r--railties/doc/guides/html/2_2_release_notes.html7
-rw-r--r--railties/doc/guides/source/2_2_release_notes.txt7
2 files changed, 6 insertions, 8 deletions
diff --git a/railties/doc/guides/html/2_2_release_notes.html b/railties/doc/guides/html/2_2_release_notes.html
index c657be20b4..0be9596a7d 100644
--- a/railties/doc/guides/html/2_2_release_notes.html
+++ b/railties/doc/guides/html/2_2_release_notes.html
@@ -586,16 +586,15 @@ by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">class</span></span> Photo <span style="color: #990000">&lt;</span> ActiveRecord<span style="color: #990000">::</span>Base
- belongs_to <span style="color: #990000">:</span>Product
+ belongs_to <span style="color: #990000">:</span>product
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
<span style="font-weight: bold"><span style="color: #0000FF">class</span></span> Product <span style="color: #990000">&lt;</span> ActiveRecord<span style="color: #990000">::</span>Base
- has_many <span style="color: #990000">:</span>products
+ has_many <span style="color: #990000">:</span>photos
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
<span style="font-style: italic"><span style="color: #9A1900"># Get all products with copyright-free photos:</span></span>
-Product<span style="color: #990000">.</span>find<span style="color: #990000">(:</span>all<span style="color: #990000">,</span> <span style="color: #990000">:</span>joins <span style="color: #990000">=&gt;</span> <span style="color: #990000">:</span>photo<span style="color: #990000">,</span>
- <span style="color: #990000">:</span>conditions <span style="color: #990000">=&gt;</span> <span style="color: #FF0000">{</span> <span style="color: #990000">:</span>photos <span style="color: #990000">=&gt;</span> <span style="color: #FF0000">{</span> <span style="color: #990000">:</span>copyright <span style="color: #990000">=&gt;</span> <span style="font-weight: bold"><span style="color: #0000FF">false</span></span> <span style="color: #FF0000">}}</span><span style="color: #990000">)</span>
+Product<span style="color: #990000">.</span>all<span style="color: #990000">(:</span>joins <span style="color: #990000">=&gt;</span> <span style="color: #990000">:</span>photos<span style="color: #990000">,</span> <span style="color: #990000">:</span>conditions <span style="color: #990000">=&gt;</span> <span style="color: #FF0000">{</span> <span style="color: #990000">:</span>photos <span style="color: #990000">=&gt;</span> <span style="color: #FF0000">{</span> <span style="color: #990000">:</span>copyright <span style="color: #990000">=&gt;</span> <span style="font-weight: bold"><span style="color: #0000FF">false</span></span> <span style="color: #FF0000">}}</span><span style="color: #990000">)</span>
</tt></pre></div></div>
<div class="ilist"><ul>
<li>
diff --git a/railties/doc/guides/source/2_2_release_notes.txt b/railties/doc/guides/source/2_2_release_notes.txt
index 00243d6941..d5eeefb16f 100644
--- a/railties/doc/guides/source/2_2_release_notes.txt
+++ b/railties/doc/guides/source/2_2_release_notes.txt
@@ -149,16 +149,15 @@ You can now specify conditions on join tables using a hash. This is a big help i
[source, ruby]
-------------------------------------------------------
class Photo < ActiveRecord::Base
- belongs_to :Product
+ belongs_to :product
end
class Product < ActiveRecord::Base
- has_many :products
+ has_many :photos
end
# Get all products with copyright-free photos:
-Product.find(:all, :joins => :photo,
- :conditions => { :photos => { :copyright => false }})
+Product.all(:joins => :photos, :conditions => { :photos => { :copyright => false }})
-------------------------------------------------------
* More information: