Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Remove all deprecations from Action Pack#26746

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
rafaelfranca merged 23 commits intomasterfromdeprecations
Oct 10, 2016
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
23 commits
Select commitHold shift + click to select a range
d7be30e
Remove deprecated methods related to controller filters
rafaelfrancaMay 10, 2016
6c24e47
Remove deprecation at ActionController::BadRequest
rafaelfrancaMay 10, 2016
a2762d9
Remove deprecated support for status option in head
rafaelfrancaMay 10, 2016
333bfd8
Remove deprecated support to `:back` in `redirect_to`
rafaelfrancaMay 10, 2016
57e1c99
Remove deprecated support to :nothing in render
rafaelfrancaMay 21, 2016
79a5ea9
Remove deprecated support to :text in render
rafaelfrancaMay 21, 2016
c396a8c
Remove deprecated comparing support with `ActionController::Parameters`
rafaelfrancaMay 23, 2016
7093ceb
Remove deprecated methods in ActionController::Parameters
rafaelfrancaMay 23, 2016
31639ea
Remove deprecated `xml_http_request` and `xhr` methods
rafaelfrancaMay 23, 2016
98b8309
Remove deprecated support to non-keyword arguments #process
rafaelfrancaMay 23, 2016
2a3718f
Remove deprecated access to mime types through constants
rafaelfrancaJun 20, 2016
1740610
Remove deprecated code in ActionDispatch::ParamsParser::ParseError
rafaelfrancaJun 20, 2016
53d2b73
Remove deprecated ActionDispatch::ParamsParser
rafaelfrancaJun 20, 2016
b3d41ea
Deprecated ActionDispatch::ParamsParser::ParamsParser
rafaelfrancaJun 20, 2016
2ca83c4
Remove deprecated code in ActionDispatch::Session::SessionRestoreError
rafaelfrancaJun 20, 2016
fda5afe
Remove deprecated code in ssl middleware
rafaelfrancaJun 20, 2016
1b975e6
Remove deprecated support to passing strings to the middleware stack
rafaelfrancaJun 20, 2016
a3ff9db
Remove deprecated `cache_control` argument from `ActionDispatch::Stat…
rafaelfrancaJun 20, 2016
5860b35
Remove deprecated support passing path as `nil` in `ActionDispatch::R…
rafaelfrancaJul 28, 2016
9185b68
Remove deprecated support for passing `:path` and route path as sting…
rafaelfrancaJul 28, 2016
eb52e5d
Remove deprecated `ActionDispatch::IntegrationTest#xml_http_request`
rafaelfrancaJul 28, 2016
092033d
Remove deprecated `ActionDispatch::IntegrationTest#*_via_redirect`.
rafaelfrancaJul 28, 2016
de9542a
Remove deprecated support to non-keyword arguments in `ActionDispatch…
rafaelfrancaOct 10, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Remove deprecated methods in ActionController::Parameters
  • Loading branch information
@rafaelfranca
rafaelfranca committedOct 10, 2016
commit7093ceb480ad6a0a91b511832dad4c6a86981b93
4 changes: 4 additions & 0 deletionsactionpack/CHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
* Remove deprecated methods in `ActionController::Parameters`.

*Rafael Mendonça França*

* Remove deprecated support to comparing a `ActionController::Parameters`
with a `Hash`.

Expand Down
20 changes: 0 additions & 20 deletionsactionpack/lib/action_controller/metal/strong_parameters.rb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -611,28 +611,8 @@ def init_with(coder) # :nodoc:
end
end

# Undefine `to_param` such that it gets caught in the `method_missing`
# deprecation cycle below.
undef_method :to_param
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we still undef this?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I think so. The idea to undef this was to users not callto_param on parameters expecting the hash behavior and getting theto_s result. If we keep it defined it will silently break again and users will have the wrong behavior.

Copy link
Contributor

Choose a reason for hiding this comment

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

👌


def method_missing(method_sym, *args, &block)
if @parameters.respond_to?(method_sym)
message = <<-DEPRECATE.squish
Method #{method_sym} 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/v#{ActionPack.version}/classes/ActionController/Parameters.html
DEPRECATE
ActiveSupport::Deprecation.warn(message)
@parameters.public_send(method_sym, *args, &block)
else
super
end
end

protected
attr_reader :parameters

Expand Down
8 changes: 1 addition & 7 deletionsactionpack/test/controller/required_params_test.rb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,14 +72,8 @@ class ParametersRequireTest < ActiveSupport::TestCase
assert params.value?("cinco")
end

test "Deprecated methods are deprecated" do
assert_deprecated do
ActionController::Parameters.new(foo: "bar").merge!(bar: "foo")
end
end

test "to_query is not supported" do
assert_deprecated do
assert_raises(NoMethodError) do
ActionController::Parameters.new(foo: "bar").to_param
end
end
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp