aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/parameters/accessors_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Implemented deep_transform_keys/! for ActionController::ParametersGustavo Gutierrez2019-05-221-0/+9
|
* Merge pull request #36302 from eugeneius/parameters_transform_keys_enumeratorRyuta Kamizono2019-05-201-2/+14
|\ | | | | | | Return parameters enumerator from transform_keys/!
| * Return parameters enumerator from transform_keys/!Eugene Kenny2019-05-181-2/+14
|/ | | | | | | | | | | | | | | | | Previously calling `ActionController::Parameters#transform_keys/!` without passing a block would return an enumerator for the underlying hash, which was inconsistent with the behaviour when a block was passed: ActionController::Parameters.new(foo: "bar").transform_keys { |k| k } => <ActionController::Parameters {"foo"=>"bar"} permitted: false> ActionController::Parameters.new(foo: "bar").transform_keys.each { |k| k } => {"foo"=>"bar"} An enumerator for the parameters is now returned instead, ensuring that evaluating it produces another parameters object instead of a hash: ActionController::Parameters.new(foo: "bar").transform_keys.each { |k| k } => <ActionController::Parameters {"foo"=>"bar"} permitted: false>
* Fix `ActionController::Parameters#each_value` and add changelog entry to ↵Bogdan2018-10-151-2/+6
| | | | | | | | | | | | | this method (#34210) * Fix `ActionController::Parameters#each_value` `each_value` should yield with "value" of the params instead of "value" as an array. Related to #33979 * Add changelog entry about `ActionController::Parameters#each_value`. Follow up #33979
* Added ActionController::Parameters.each_value methodLukas Zapletal2018-09-271-0/+18
|
* Convert hashes into parameters (#33076)Kevin Sjöberg2018-06-191-0/+21
| | | | | | | | | | | | * Convert hashes into parameters Ensure `ActionController::Parameters#transform_values` and `ActionController::Parameters#transform_values!` converts hashes into parameters. * fixup! Convert hashes into parameters [Rafael Mendonça França + Kevin Sjöberg]
* Make mutating params#dig mutate underlying paramsVince DeVendra2018-03-241-0/+8
| | | | | | | | | | | When #dig was called on a params object and return either a Hash or an Array, and that value was subsquently mutated, it would not modify the containing params object. That means that the behavior of `params.dig(:a, :b)[:c] = 1` did not match either `params[:a][:b][:c] = 1` nor `hash.dig(:a, :b)[:c] = 1`. Similarly to `ActionController::Parameters#[]`, use `#convert_hashes_to_parameters` to pre-convert values and insert them in the receiving params object prior to returning them.
* Rails 6 requires Ruby 2.4.1+Jeremy Daer2018-02-171-1/+0
| | | | | | Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug. References #32028
* Rails 6 requires Ruby 2.3+Jeremy Daer2018-02-171-16/+9
|
* Use assert_empty and assert_not_emptyDaniel Colson2018-01-251-2/+2
|
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-28/+28
|
* Change refute to assert_notDaniel Colson2018-01-251-6/+6
|
* Use respond_to test helpersDaniel Colson2018-01-251-1/+1
|
* Yield array from AC::Parameters#each for block with one argDominic Cleal2017-12-061-0/+16
| | | | Matches Hash#each behaviour as used in Rails 4.
* Use frozen string literal in actionpack/Kir Shatrov2017-07-291-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-021-0/+1
|\ | | | | | | Enforce frozen string in Rubocop
| * Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
| |
* | Fallback Parameters#to_s to Hash#to_sKir Shatrov2017-06-301-0/+5
|/ | | Fixes https://github.com/rails/rails/issues/29617
* Fix test that was asserting the wrong thingRafael Mendonça França2017-03-211-1/+1
|
* Tests for delegated public methods on AC::ParametersT.J. Schuck2017-03-071-0/+63
|
* Remove deprecated comparing support with `ActionController::Parameters`Rafael Mendonça França2016-10-101-8/+0
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies new string literal convention in actionpack/testXavier Noria2016-08-061-9/+9
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Add `ActionController::Parameters#dig`Sean Griffin2016-03-091-0/+20
| | | | | | This method will only be added when used with Ruby 2.3.0 or greater. This method has the same behavior as `Hash#dig`, except it will convert hashes to `ActionController::Parameters`, similar to `#[]` and `#fetch`.
* Show permitted flag in the output of AC::Parameters#inspectPrathamesh Sonpatki2016-02-241-3/+13
| | | | - Fixes #23822.
* Deprecate AC::Parameters#== with a HashBenjamin Quorning2016-02-191-2/+4
|
* Fix AC::Parameters#== with other AC::ParametersBenjamin Quorning2016-02-191-0/+33
| | | | Creating a protected getter method for `@parameters`.
* Tests for AC::Parameters#==Benjamin Quorning2016-02-191-0/+6
|
* Implement ActionController::Parameters#inspectBenjamin Quorning2016-02-171-0/+9
| | | | Now that AC::Parameters is no longer a Hash, it shouldn't look like a hash.
* Fix `ActionController::Parameters#==` bugJon Moss2016-01-211-0/+6
| | | | See bug #21032.
* AC::Parameters#at_json: restore Rails 4.2’s valueclaudiob2016-01-121-0/+6
| | | | | | Fixes #23026 See discussion at #23026
* Fix failing test on several methods on ParameterPrem Sichanugrist2014-08-181-0/+9
| | | | | | | * `each` * `each_pair` * `delete` * `select!`
* Seperate Parameters accessors and mutators testsPrem Sichanugrist2014-08-181-0/+116