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

get a warning in rails5 #30

Open
wenxuankou opened this issue Aug 29, 2016 · 2 comments
Open

get a warning in rails5 #30

wenxuankou opened this issue Aug 29, 2016 · 2 comments

Comments

@wenxuankou
Copy link

i get a warning in rails5,"some methods will be remove in rails5.1",Please consider compatibility in rails5

@adis-io
Copy link

adis-io commented Sep 13, 2016

DEPRECATION WARNING: Method member? 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.1/classes/ActionController/Parameters.html (called from coerce_type at [FILTERED])

@estebanbouza
Copy link

I have been browsing the code but cannot find any direct invocation of member?. Running RSpec passes all tests however there are many warnings thrown, like this ones:

DEPRECATION WARNING: ActionController::TestCase HTTP request methods will accept only keyword arguments in future Rails versions.
DEPRECATION WARNING: `render :text` is deprecated because it does not actually render a `text/plain` response. Switch to `render plain: 'plain text'` to render as `text/plain`, `render html: '<strong>HTML</strong>'` to render as `text/html`, or `render body: 'raw'` to match the deprecated behavior and render with the default Content-Type, which is `text/plain`. (called from edit at /Users/<username>/projects/rails_param/spec/fixtures/controllers.rb:31)
WARNING: Using the `raise_error` matcher without providing a specific error or message risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or `ArgumentError`, potentially allowing the expectation to pass without even executing the method you are intending to call. Actual error raised was #<RailsParam::Param::InvalidParameterError: Parameter is required>. Instead consider providing a specific error class or message. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/<username>/projects/rails_param/spec/rails_param/param_spec.rb:216:in `block (4 levels) in <top (required)>'.

My guess is that the first deprecation warning, the one related to TestCase HTTP request methods or the render one are using internally the call to member?. I don't know very well how to fix it (update dependent libraries?). Perhaps @nicolasblanco can give some insight?

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

No branches or pull requests

4 participants