Tuesday, May 17, 2016

Rails Upgrade from 3.2 to 4.2 Active Record Update Checklist

To migrate dynamic finders to Rails 4.1+:
  • find_all_by_... should become where(...).
  • find_last_by_... should become where(...).last.
  • scoped_by_... should become where(...).
  • find_or_initialize_by_... should become find_or_initialize_by(...).
  • find_or_create_by_... should become find_or_create_by(...).
https://github.com/rails/activerecord-deprecated_finders

No comments:

Post a Comment