aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/params_wrapper.rb
Commit message (Collapse)AuthorAgeFilesLines
* checking for nested attributes when attribute names specified to wrap them ↵Kelton Manzanares2017-10-251-6/+7
| | | | as well
* Fixed functionality to include method in params_wrapper.rbRyan Perez2017-10-251-0/+7
| | | | to properly wrap all attributes, including those which are nested.
* Use frozen string literal in actionpack/Kir Shatrov2017-07-291-0/+2
|
* Don't wrap parameters if query parameter existsEugene Kenny2017-06-251-7/+2
| | | | | | | | | | | | We want to avoid overwriting a query parameter with the wrapped parameters hash. Previously this was implemented by merging the wrapped parameters at the root level if the key already existed, which was effectively a no-op. The query parameter was still overwritten in the filtered parameters hash, however. We can fix that discrepancy with a simpler implementation and less unnecessary work by skipping parameter wrapping entirely if the key was sent as a query parameter.
* Don't wrap parameters if key already existsEugene Kenny2017-06-241-1/+1
| | | | | | | | | | | | | | | | | We shouldn't perform parameter wrapping if it would overwrite one of the parameters sent with the request, as that would interfere with reading the parameter directly from the top level `params` hash. The current implementation has logic for this case, but it doesn't handle `nil`/`false` values, which means these parameters: { "user" => nil } are transformed into this `params` hash: { "user" => { "user" => nil } } and `params["user"]` no longer returns the original parameter value.
* Add option for class_attribute default (#29270)David Heinemeier Hansson2017-05-291-2/+1
| | | | | | | | | | | | * Allow a default value to be declared for class_attribute * Convert to using class_attribute default rather than explicit setter * Removed instance_accessor option by mistake * False is a valid default value * Documentation
* Wrap store accessors in parametersSid Ngeth2017-03-211-1/+5
| | | | Modified params wrapper to account for model's stored_attributes
* [docs] fix ActionController documentationHrvoje Šimić2017-03-121-4/+4
| | | | [ci skip]
* AC::ParamsWrapper::Options needs anonymous superclassAkira Matsuda2017-01-131-1/+1
| | | | | | it has some methods that override the accessors and calls the original accessors via `super` this partially reverts 9360b6be63b7a452535699bcf6ae853df7f5eea7
* class Foo < Struct.new(:x) creates an extra unneeded anonymous classAkira Matsuda2017-01-131-1/+1
| | | | because Struct.new returns a Class, we just can give it a name and use it directly without inheriting from it
* No need to nodoc private methodsAkira Matsuda2016-12-241-1/+1
|
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-1/+1
|
* Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-141-7/+7
| | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-16/+16
|
* modernizes hash syntax in actionpackXavier Noria2016-08-061-2/+2
|
* applies new string literal convention in actionpack/libXavier Noria2016-08-061-6/+6
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* don't deal with `nil` valuesAaron Patterson2015-09-221-1/+3
| | | | | We can know whether or not there is a content type object, and just exit early. There is no need to `try` so hard.
* Fix params_wrapper doc [ci skip]Mehmet Emin İNAÇ2015-07-261-3/+3
| | | | | | This feature also works with `PUT`, `PATCH` and `DELETE` requests. Also developers can add `:url_encoded_form` and `:multipart_form` into the `:format` for wrapping url encoded or multipart form data.
* A few documentation edits [ci skip]Robin Dupret2015-06-151-1/+1
|
* Spelling/typo/grammatical fixes [ci skip]karanarora2015-05-231-1/+1
| | | | | | | | | | spelling fix [ci skip] example to be consistent [ci skip] grammatical fix typo fixes [ci skip]
* [ci skip] Remove comments about Rails 3.1claudiob2015-05-111-2/+1
| | | | | | | | | Stems from https://github.com/rails/rails/pull/20105#issuecomment-100900939 where @senny said: > From my point of view, all the docs (guides, API) are version bound. > They should describe that version and continue to be available when newer versions are released. > The cross referencing can be done by the interested user.
* Doc fix [ci skip]Sushruth Sivaramakrishnan2015-03-051-1/+1
|
* Remove Struct#to_h backportRafael Mendonça França2015-01-041-1/+0
|
* Fix typo in nodoc should be `:nodoc:` for RDoc to parse correctlyZachary Scott2014-12-171-1/+1
|
* Rephrasing sentencesNeeraj Singh2014-10-071-2/+2
|
* Do not discard query parameters on requests that use wrap_parametersJosh Jordan2014-01-301-4/+11
|
* Remove warning of circular requireRafael Mendonça França2012-11-271-1/+1
| | | | | | | | | This file was using mime_types before load the Mime::Type class. When trying to register first Mime::Type it load mime_type that loads mime_types in the end. Requiring mime_type ensure that we have the class definition and the mime types
* lazily calculate name in the options objectAaron Patterson2012-11-131-14/+18
|
* move include calculation to include method on the options objectAaron Patterson2012-11-131-9/+24
|
* model name is lazily evaluated in the options objectAaron Patterson2012-11-131-27/+37
|
* move the controller class to the options objectAaron Patterson2012-11-131-9/+12
|
* attribute_names will always return a list, so just use any?Aaron Patterson2012-11-131-1/+1
|
* wrap up hash conversion in the constructorAaron Patterson2012-11-131-5/+5
|
* use the options object in the wrapper defaultsAaron Patterson2012-11-131-13/+12
|
* start using options objectAaron Patterson2012-11-131-9/+20
|
* only do hash lookups on options onceAaron Patterson2012-11-131-13/+15
|
* replace present? with any? to reduce dependency on ASAaron Patterson2012-11-131-1/+1
|
* Multiple changes to 1,9 hash syntaxAvnerCohen2012-10-271-2/+2
|
* update AC::ParamsWrapper documentation [ci skip]Francesco Rodriguez2012-09-191-3/+4
|
* Remove integration between attr_accessible/protected and ↵Guillermo Iguaran2012-09-161-7/+2
| | | | AC::Metal::ParamsWrapper
* load active_support/core_ext/class/attribute in active_support/railsXavier Noria2012-08-021-1/+0
|
* Show in log correct wrapped keysDmitry Vorotilin2012-05-201-1/+2
|
* Use Hash#fetch instead of has_key? checkCarlos Antonio da Silva2012-05-041-1/+1
|
* Merge pull request #4445 from nragaz/role_based_params_wrappingJosé Valim2012-05-041-2/+3
| | | | specify a role for identifying accessible attributes when wrapping params
* More using <tt>x</tt> instead of +x+ when the latter renders improperly.Mark Rushakoff2012-04-271-1/+1
|
* Use <tt>Foo::Bar</tt> instead of +Foo::Bar+Mark Rushakof2012-04-271-1/+1
| | | | | | | | The latter doesn't render as code in HTML output. Regex used in Rubymine to locate the latter form: (\+)(:*\w+:(?::|\w)+)(\+)
* Change more Array.wrap to Kernel#ArrayRafael Mendonça França2012-01-051-6/+5
|
* ParamsWrapper only wrap the accessible attributes when they were setJean-Francois Turcot2011-12-071-1/+8
|
* use classify in ParamsWrapper to derive model name from controller namelest2011-12-051-1/+1
|
* Use safe_constantize where possible.José Valim2011-09-231-6/+3
|