Apipie / apipie-rails

Ruby on Rails API documentation tool
Apache License 2.0
2.47k stars 463 forks source link

Deprecation warnings #483

Open mattdowdell opened 8 years ago

mattdowdell commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 7 years ago

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