aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-07-04 08:23:51 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-07-04 08:24:57 -0300
commitb5a2f24b6b2b466a5692f0d46b4a2b8154ee0e53 (patch)
tree9e7caecfff5fcdf9a41b56b2a58f1af908248059 /guides/source
parentf3353895a04dfd9a06cf1ca2e7bbfb80a38dbfad (diff)
downloadrails-b5a2f24b6b2b466a5692f0d46b4a2b8154ee0e53.tar.gz
rails-b5a2f24b6b2b466a5692f0d46b4a2b8154ee0e53.tar.bz2
rails-b5a2f24b6b2b466a5692f0d46b4a2b8154ee0e53.zip
Update 4.0 Release Notes
Related with 17d2115e3df6caf15d554b44e28177069fa3ed5b
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/4_0_release_notes.textile16
1 files changed, 15 insertions, 1 deletions
diff --git a/guides/source/4_0_release_notes.textile b/guides/source/4_0_release_notes.textile
index e1d6b42e6c..d430dca164 100644
--- a/guides/source/4_0_release_notes.textile
+++ b/guides/source/4_0_release_notes.textile
@@ -329,6 +329,20 @@ Moved into a separate gem <tt>sprockets-rails</tt>.
h3. Active Record
+* Add <tt>add_reference</tt> and <tt>remove_reference</tt> schema statements. Aliases, <tt>add_belongs_to</tt> and <tt>remove_belongs_to</tt> are acceptable. References are reversible.
+
+<ruby>
+# Create a user_id column
+add_reference(:products, :user)
+
+# Create a supplier_id, supplier_type columns and appropriate index
+add_reference(:products, :supplier, polymorphic: true, index: true)
+
+# Remove polymorphic reference
+remove_reference(:products, :supplier, polymorphic: true)
+</ruby>
+
+
* Add <tt>:default</tt> and <tt>:null</tt> options to <tt>column_exists?</tt>.
<ruby>
@@ -343,7 +357,7 @@ User.where(:age => 30) # => returns the relation
User.where(:age => 30).to_a # => executes the query and returns the loaded objects, as before
</ruby>
-* Add <tt>collation</tt> and <tt>ctype</tt> support to PostgreSQL. These are available for PostgreSQL 8.4 or later.
+* Add <tt>:collation</tt> and <tt>:ctype</tt> support to PostgreSQL. These are available for PostgreSQL 8.4 or later.
<yaml>
development: