Skip to content
Browse files

Update 4.0 Release Notes

Related with 17d2115
  • Loading branch information...
1 parent f335389 commit b5a2f24b6b2b466a5692f0d46b4a2b8154ee0e53 @rafaelfranca rafaelfranca committed
Showing with 15 additions and 1 deletion.
  1. +15 −1 guides/source/4_0_release_notes.textile
View
16 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:

0 comments on commit b5a2f24

Please sign in to comment.
Something went wrong with that request. Please try again.