Open mattangriffel opened 10 years ago
Yes, I get that too. It's caused by the use of Model.scoped in lib/cancan/model_adapters/active_record_adapter.rb
in the database_records
method, but I'm not sure what the correct fix would be.
@hitendrasingh line 101 still throws a deprecation warning:
@model_class.scoped.merge(override_scope)
Can't figure out how to get around this since @model_class.all returns an Array in < 1.9.3 and an ActiveRecord::Relation in > 2.0.0. The merge method doesn't work on arrays.
Seems to be solved by
@model_class.where(nil).merge(override_scope)
Just opened PR #992
Is anyone else getting this annoying deprecation warning everywhere in their tests?
Here's what the relevant parts of my my application_controller look like: