Sology / smart_listing

Ruby on Rails data listing gem with built-in sorting, filtering and in-place editing.
http://showcase.sology.eu/smart_listing
MIT License
478 stars 138 forks source link

replace deprecated .any? with .present? #143

Closed AakLak closed 6 years ago

AakLak commented 6 years ago

The .any method is deprecated in rails 5.1. As per the suggestions of this Stack Overflow post, I changed it to .present?

DEPRECATION WARNING: Method any? is deprecated and will be removed in Rails 5.1, as ActionController::Parameters no longer inherits from hash. Using this deprecated behavior exposes potential security problems. If you continue to use this method you may be creating a security vulnerability in your app that can be exploited. Instead, consider using one of these documented methods which are not deprecated: http://api.rubyonrails.org/v5.0.0.rc1/classes/ActionController/Parameters.html

Have not personally tested.

ljachymczyk commented 6 years ago

Thank you @AakLak