Fixes #11924 - Substitute .scoped by .where(nil) to force return relation
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. There are a couple of fixes too on models such as bookmark.rb which return where conditions ({} and similar) instead of a relation, which is also a deprecated behavior.
We could possibly substitute these by .all after the Rails 4 migration if they feel too 'unidiomatic'.
Related issues
Bug #11924: Substitute .scoped by .where(nil) to force return relation
Fixes #11924 - Substitute .scoped by .where(nil) to force return relation
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. There are a couple of fixes too
on models such as bookmark.rb which return where conditions ({} and
similar) instead of a relation, which is also a deprecated behavior.
We could possibly substitute these by .all after the Rails 4 migration
if they feel too 'unidiomatic'.