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

Deprecation warnings #483

Open
mattdowdell opened this issue Aug 23, 2016 · 3 comments
Open

Deprecation warnings #483

mattdowdell opened this issue Aug 23, 2016 · 3 comments

Comments

@mattdowdell
Copy link

mattdowdell commented Aug 23, 2016

I get the following warnings when running my tests using Ruby 2.3.0, Rails 5.0.0.1:

DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from <top (required)> at /vagrant/api/config/environment.rb:5)

Where the line in question is

Rails.application.initialize!

The only reference to said method is 1

DEPRECATION WARNING: before_filter is deprecated and will be removed in Rails 5.1. Use before_action instead. (called from <top (required)> at /vagrant/api/app/controllers/application_controller.rb:4)
DEPRECATION WARNING: before_filter is deprecated and will be removed in Rails 5.1. Use before_action instead. (called from <top (required)> at /vagrant/api/app/controllers/application_controller.rb:4)

ApplicationController is currently empty for me. I would guess it's caused by 2

I also saw a warning about use of each_key on params, see 3 due to params no longer being a subclass of Hash.

@andreydeineko
Copy link

andreydeineko commented Oct 7, 2016

I am currently switching to Rails 5.0.0 and also see these warnings although in my project do not use bofere_filter. So running

ack before_filter /Users/andreydeineko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/

gives the following output (within apipie-rails gem):

/Users/andreydeineko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/apipie-rails-0.3.6/app/controllers/apipie/apipies_controller.rb
9:    before_filter :authenticate

/Users/andreydeineko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/apipie-rails-0.3.6/CHANGELOG.md
87:* ability to use before_filter instead of overriding the action method

/Users/andreydeineko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/apipie-rails-0.3.6/lib/apipie/extractor.rb
12:      before_filter do |controller|

/Users/andreydeineko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/apipie-rails-0.3.6/README.rst
531:  controller method ``apipie_validations`` (typically in a before_filter).
729:Parameter validation normally happens after before_filters, just before
736:   before_filter: :apipie_validations
738:This is useful if you have before_filters which use parameter values: just add them
739:after the ``apipie_validations`` before_filter.

@mbusch
Copy link

mbusch commented Oct 25, 2016

Same here with rails 5.0.0.1 and apipie 0.3.7, although both before_filter and alias_method_chain are not used anymore within our application.

DEPRECATION WARNING: before_filter is deprecated and will be removed in Rails 5.1. Use before_action instead. (called from <top (required)> at /home/mbusch/**/verstehe/config/environment.rb:5)
DEPRECATION WARNING: before_filter is deprecated and will be removed in Rails 5.1. Use before_action instead. (called from <top (required)> at /home/mbusch/projects/**/config/environment.rb:5)
DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from <top (required)> at /home/mbusch/projects/**/config/environment.rb:5)

@jsantos
Copy link
Contributor

jsantos commented Mar 7, 2017

The alias_method_chain issue is still present, from what I see the culprits are on:

  • lib/apipie/extractor/recorder.rb#FunctionalTestRecording (line 147);
  • spec/spec_helper.rb#Rails4Compatibility (line 12)

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 a pull request may close this issue.

4 participants