How to avoid deprecation warning with named_scope (rails 2.X) / scope (rails 3) class_method
I build several plugins using the class method 'named_scope', which has been deprecated and replaced by 'scope' in Rails 3. I would like to avoid the following warning as I have lot a scopes present in my plugins :
DEPRECATION WARNING: Base.named_scope has been deprecated, please use Base.scope instead.
How to you deal with that? Did you create any 'scope' method if it's rails 2.X and pass the information to 'named_scope'? Any clean sugg开发者_如何学JAVAestion?
Cheers!
Vincent
Only real fix for this is to fix actual plugins outputting this error.
Just change named_scope to scope from where are you calling it.
精彩评论