ActiveRecord 2.0.0/2.0.1 ChangeLogでひっかかったとこだけ

http://svn.rubyonrails.org/rails/trunk/activerecord/CHANGELOG
  • belongs_to infers the foreign key from the association name instead of from the class name. [Jeremy Kemper]
  • Change belongs_to so that the foreign_key assumption is taken from the association name, not the class name. Closes #8992 [hasmanyjosh]

つまりこういうこと。

  OLD
    belongs_to :visitor, :class_name => 'User' # => inferred foreign_key is user_id
    
  NEW
    belongs_to :visitor, :class_name => 'User' # => inferred foreign_key is visitor_id
  • Eager loading respects explicit :joins. #9496 [dasil003]

ふむふむ。

  • SQLite: use AUTOINCREMENT primary key in >= 3.1.0. #6588, #6616 [careo, lukfugl]

おぉ。

  • Support nil and Array in :conditions => { attr => value } hashes. #6548 [Assaf, Jeremy Kemper]

つまり、

    find(:all, :conditions => { :topic_id => [1, 2, 3], :last_read => nil }

とできる。

  • Migrations: uniquely name multicolumn indexes so you don't have to. [Jeremy Kemper]
    # people_active_last_name_index, people_active_deactivated_at_index
    add_index    :people, [:active, :last_name]
    add_index    :people, [:active, :deactivated_at]
    remove_index :people, [:active, :last_name]
    remove_index :people, [:active, :deactivated_at]

とできる。