No commit activity in last 3 years
No release in over 3 years
Deprecated finder APIs extracted from Active Record.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

< 5, >= 4.0.0.beta
~> 1.3
 Project Readme

Active Record Deprecated Finders

This gem is a dependency of Rails 4.0 to provide deprecated finder functionality.

It will be removed as a dependency in Rails 4.1, but users can manually include it in their Gemfile and it will continue to be maintained until Rails 5.

gem 'activerecord-deprecated_finders', require: 'active_record/deprecated_finders'

This gem is used to extract and deprecate old-style finder option hashes in Active Record:

Post.find(:all, conditions: { published_on: 2.weeks.ago }, limit: 5)

as well as the following dynamic finders:

  • find_all_by_...
  • find_last_by_...
  • scoped_by_...
  • find_or_initialize_by_...
  • find_or_create_by_...

Note that find(primary_key), find_by..., and find_by...! are not deprecated.

To avoid reliance on this gem, you'll need to migrate your finder usage.

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(...).

To migrate old-style finder option hashes and for additional information, please refer to: