sunlightlabs / opencongress

An open website for opening Congress.
http://www.opencongress.org
GNU General Public License v3.0
48 stars 16 forks source link

Update migrations for rails 4 #465

Closed plantfansam closed 10 years ago

plantfansam commented 10 years ago

update_all changed between Rails 2 and 4. It's no longer an ActiveRecord::Base method; it now lives in ActiveRecord::Relation. Previously, the update_all method allowed you to supply selection parameters (e.g. WHERE should_update = true) along with new values for certain columns. Now, you run a Model.where method, then call update_all on the resulting ActiveRecord::Relation.

There's also a small change to find_or_initialize_by.

Don't think this will have any side effects, since all of these migrations have already been run in the important places. Note that db/structure.sql has changed, though.

Cspeisman commented 10 years ago

looks :ok_hand: @handlers