Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed

Conversation

chayelheinsen
Copy link

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.

if self.respond_to? :before_action
self.send :before_action, :set_geokit_domain
elsif self.respond_to? :before_filter
self.send :before_filter, :set_geokit_domain

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant self detected.

@coveralls
Copy link

coveralls commented Jul 12, 2016

Coverage Status

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

@mnoack
Copy link
Member

mnoack commented Jul 13, 2016

@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
Copy link
Member

mnoack commented Jul 13, 2016

@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
Copy link
Member

mnoack commented Jul 13, 2016

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

@mnoack mnoack closed this Jul 13, 2016
@chayelheinsen
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants