Actions
Bug #11924
closedSubstitute .scoped by .where(nil) to force return relation
Description
On Rails 4 .scoped is deprecated. Calling .all on the model returns the equivalent ActiveRecord relation object on Rails 4, but on Rails 3 it returns an Array right away.
A proper replacement we can use is where(nil) - it's ugly but it returns the same relation in both Rails 3 and 4.
We could possibly substitute these by .all after the Rails 4 migration if they feel too 'unidiomatic'.
Updated by Daniel Lobato Garcia over 9 years ago
- Subject changed from Substitute scoped for where(nil) to force return relation to Substitute .scoped by .where(nil) to force return relation
Updated by The Foreman Bot over 9 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2754 added
- Pull request deleted (
)
Updated by Daniel Lobato Garcia over 9 years ago
- Related to Tracker #3157: Rails 4.1 upgrade tasks added
Updated by Dominic Cleal about 9 years ago
- Assignee set to Daniel Lobato Garcia
- Translation missing: en.field_release set to 71
Updated by Daniel Lobato Garcia about 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 02e4c535896e51670531c50d7c80b35968e25720.
Updated by Dominic Cleal about 9 years ago
- Related to Bug #12432: User edit roles tab, no roles found for admin user added
Actions