Bug #11924
closed
Substitute .scoped by .where(nil) to force return relation
Added by Daniel Lobato Garcia over 9 years ago.
Updated over 6 years ago.
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'.
- Subject changed from Substitute scoped for where(nil) to force return relation to Substitute .scoped by .where(nil) to force return relation
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2754 added
- Pull request deleted (
)
- Assignee set to Daniel Lobato Garcia
- Translation missing: en.field_release set to 71
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Related to Bug #12432: User edit roles tab, no roles found for admin user added
Also available in: Atom
PDF