geokit / geokit-rails

Official Geokit plugin for Rails/ActiveRecord. Provides location-based goodness for your Rails app. Requires the Geokit gem.
MIT License
1.57k stars 245 forks source link

Silence deprecation message for having before_filter if running on Rails 5.1 #105

Closed chayelheinsen closed 8 years ago

chayelheinsen commented 8 years ago

DEPRECATION WARNING: before_filter is deprecated and will be removed in Rails 5.1. Use before_action instead. (called from block in <module:GeocoderControl> at /Users/chayelheinsen/.rvm/gems/ruby-2.3.1/gems/geokit-rails-2.1.0/lib/geokit-rails/geocoder_control.rb:9) This PR will remove this from displaying in the terminal if running on Rails 5.1.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.002%) to 49.807% when pulling 6386c5e0039c4a3aea87fa392e9a8221edda2f34 on chayelheinsen:BeforeFilterDeprecation into f85ca01218a4efe2c4599dfed1801154ff0d0ae0 on geokit:master.

mnoack commented 8 years ago

@chayelheinsen I'm a bit confused, and since you're familiar with the change can you clarify?

If before_action is defined (which I assume it is in rails 5.0) why does it have a deprecation error under the existing code?

mnoack commented 8 years ago

@chayelheinsen Sorry I misread the commit. So you're using rails 5.0 or 5.1 and you want to use before_filter. That deprecation is not something that geokit-rails is doing right?

Geokit rails is using the appropriate call (at least in master branch) so it shouldn't be using deprecated code.

mnoack commented 8 years ago

I have released geokit-rails 2.2.0 which includes some rails 5 changes to avoid the deprecation, that should solve your problem.

chayelheinsen commented 8 years ago

It wasn't using the deprecation code but for some reason the warning was still being displayed. This commit just silenced the warning.