Is anyone else getting this annoying deprecation warning everywhere in their tests?
DEPRECATION WARNING: Model.scoped is deprecated. Please use Model.all instead. (called from set_accessible_courses at /Users/mgriffel/code/one_month_rails/app/controllers/application_controller.rb:41)
Here's what the relevant parts of my my application_controller look like:
# Sets courses to be looped over in header
@accessible_courses ||= Course.accessible_by(current_ability)
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:
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.
Rails 4 fix for #951
Seems to be solved by
Just opened PR #992