Low commit activity in last 3 years
A long-lived project that still receives updates
Since Rails 5 you can no longer call some ActiveRecord class methods named like their Enumerable counterparts. This gem reinstates the expected behaviour, where you can always get the method from Enumerable by calling to_a on the relation.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Expected behaviour for ActiveRecord::Delegation

Prefer some class methods over methods from Enumerable on ActiveRecord relations

Rationale

In Rails 5 you can no longer call some ActiveRecord class methods named like their Enumerable counterparts:

:encode_with, :to_ary, :join, :[], :&, :|, :+, :-, :sample, :reverse, :compact, :in_groups, :in_groups_of, :to_sentence, :to_formatted_s, :shuffle, :split, :index, :excluding

This gem reinstates the expected behaviour, where you can always get the method from Enumerable by calling to_a on the relation, whilst being able to define it as class method on the relation model.

See: rails/rails#26949

Licensing

Licensed under the MIT license.