Skip to content

Commit

Permalink
Update 4.0 Release Notes
Browse files Browse the repository at this point in the history
Related with 17d2115
  • Loading branch information
rafaelfranca committed Jul 4, 2012
1 parent f335389 commit b5a2f24
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion guides/source/4_0_release_notes.textile
Expand Up @@ -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>
Expand All @@ -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:
Expand Down

0 comments on commit b5a2f24

Please sign in to comment.