in Rails 4.0.4 this code work:
mailboxes = Mailbox.order(:mailbox) mailboxes.keep_if do |mailbox| # test end
in Rails 4.1.0 it break with
Its in release notes for rails 4.1
Relation no longer has mutator methods like #map! and #delete_if. Convert to an Array by calling #to_a before using these methods. (Pull Request)
Since keep_if is a mutator method, its removed from Relation
keep_if
Relation