aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [ci skip] Add securing rails app guide link to credential sectionYoshiyuki Hirano2018-04-071-0/+3
| | | | * In 5.2 release note, added [securing rails app guide](http://edgeguides.rubyonrails.org/security.html#custom-credentials) link to [credentials section](http://edgeguides.rubyonrails.org/5_2_release_notes.html#credentials).
* Remove redundant type checkAndrew White2018-04-061-2/+1
| | | | All of Date, DateTime and Time respond to `iso8601`.
* Merge pull request #32462 from yhirano55/add_ujs_desc_to_rakefile_in_actionviewRafael França2018-04-041-2/+3
|\ | | | | Add ujs desc to rakefile in actionview
| * Use comment instead of desc in actionview's RakefileYoshiyuki Hirano2018-04-051-2/+2
| | | | | | | | | | * Seems the desc of Rake::TestTask.new is not displayed * Use comment instead of desc
| * Add :ujs desc to Rakefile in actionviewYoshiyuki Hirano2018-04-051-0/+1
|/
* Merge pull request #32441 from composerinteralia/refute-notRafael França2018-04-0420-27/+223
|\ | | | | Add custom RuboCop for `assert_not` over `refute`
| * Autocorrect `refute` RuboCop violationsDaniel Colson2018-04-0314-27/+27
| | | | | | | | | | | | 73e7aab behaved as expected on codeship, failing the build with exactly these RuboCop violations. Hopefully `rubocop -a` will have been enough to get a passing build!
| * Add custom RuboCop for `assert_not` over `refute`Daniel Colson2018-04-036-0/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since at least cf4afc4 we have preferred `assert_not` methods over `refute` methods. I have seen plenty of comments in PRs about this, and we have tried to fix it a few times (5294ad8, e45f176, 8910f12, 41f50be, d4cfd54, 48a183e, and 211adb4), but the `refute` methods keep sneaking back in. This custom RuboCop will take care of enforcing this preference, so we don't have to think about it again. I suspect there are other similar stylistic preferences that could be solved with some custom RuboCops, so I will definitely keep my eyes open. `assert_not` over `assert !` might be a good candidate, for example. I wasn't totally sure if `ci/custom_cops` was the best place to put this, but nothing else seemed quite right. At one point I had it set up as a gem, but I think custom cops like this would have limited value in another context. I want to see how code climate handles the new cops before autocorrecting the existing violations. If things go as expected, I will push another commit with those corrections.
* | Merge pull request #32444 from matrinox/fix-return-response-mutation-rack-loggerRafael Mendonça França2018-04-042-5/+21
|\ \ | | | | | | | | | Stop mutating body response
| * | Stop mutating body responseGeoff Lee2018-04-032-5/+21
| | | | | | | | | | | | | | | | | | If @app.call returns an object that is saved (for e.g., in a constant), the mutation results in a continuing cycle of wrapping the body in Rack::BodyProxy, eventually leading to SystemStackError ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ On branch fix-return-response-mutation-rack-logger - Tue 3 Apr 2018 19:54:28 PDT by Geoff Lee <geoff.lee@lendesk.com>
* | | Merge pull request #32446 from sinsoku/add_dig_to_sessionRafael França2018-04-042-0/+20
|\ \ \ | | | | | | | | Add #dig to ActionDispatch::Request::Session
| * | | Add #dig to ActionDispatch::Request::Sessionclaudiob2018-04-042-0/+20
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Summary The `session` object is not a real Hash but responds to many methods of Hash such as `[]`, `[]`, `fetch`, `has_key?`. Since Ruby 2.3, Hash also supports a `dig` method. This commit adds a `dig` method to `ActionDispatch::Request::Session` with the same behavior as `Hash#dig`. This is useful if you store a hash in your session, such as: ```ruby session[:user] = { id: 1, avatar_url: "http://example.org/nyancat.jpg" } ``` Then you can shorten your code from `session[:user][:avatar_url]` to `session.dig :user, :avatar_url`. ### Other Information I cherry-picked a commit from https://github.com/rails/rails/pull/23864, and modify a bit. The changes are below: * Converts only the first key to a string adjust to the `fetch` method. * Fixes a test case because we cannot use the indifferent access since ee5b621e2f8fde380ea4bc75b0b9d6f98499f511.
* | | Merge pull request #32447 from utilum/splatRafael França2018-04-042-3/+4
|\ \ \ | | | | | | | | 2.6 warnings: passing splat keyword arguments as a single Hash
| * | | passing splat keyword arguments as a single Hashutilum2018-04-042-3/+4
| |/ / | | | | | | | | | Ruby 2.6.0 warns about this.
* | | Merge pull request #32457 from yhirano55/add_private_option_to_delegation_docRafael França2018-04-041-1/+2
|\ \ \ | | | | | | | | [ci skip] Add :private option to delegation doc
| * | | [ci skip] Add :private option to delegation docYoshiyuki Hirano2018-04-051-1/+2
| | | |
* | | | Merge pull request #32414 from bogdan/query-cache-optimizationRafael França2018-04-042-12/+6
|\ \ \ \ | | | | | | | | | | Optimize the code inside AR::QueryCache middleware
| * | | | Optimize the code inside AR::QueryCache middlewareBogdan Gusiev2018-04-042-12/+6
| | | | |
* | | | | Merge pull request #32456 from EiNSTeiN-/patch-1Rafael França2018-04-041-1/+1
|\ \ \ \ \ | |_|/ / / |/| | | | Remove superfluous `ActionController::`
| * | | | Remove superfluous `ActionController::`Francois Chagnon2018-04-041-1/+1
|/ / / /
* | | | Merge pull request #32435 from ↵Eileen M. Uchitelle2018-04-043-7/+7
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | bogdanvlviv/add-missing-dots-at-the-end-of-comments Add missing dots at the end of comments in environment file templates
| * | | | Add missing dots at the end of comments in environment file templatesbogdanvlviv2018-04-033-7/+7
| | | | | | | | | | | | | | | | | | | | Add dots in order to keep consistency between other comments in these files.
* | | | | Merge pull request #32448 from ↵Eileen M. Uchitelle2018-04-041-0/+8
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | yhirano55/add_private_option_to_delegate_section_in_guide [ci skip] Add :private option to delegate section in guide
| * | | | [ci skip] Add :private option to delegate section in guideYoshiyuki Hirano2018-04-041-0/+8
| | | | |
* | | | | Class methods in the `class_methods` blocks are wrongly appeared in the docRyuta Kamizono2018-04-045-5/+5
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | It is wrongly appeared as instance public methods in the doc. http://api.rubyonrails.org/v5.1.6/classes/ActionCable/Channel/Callbacks.html http://api.rubyonrails.org/v5.1.6/classes/ActiveRecord/Timestamp.html
* | | | Merge pull request #32439 from yhirano55/fix_rendering_test_in_railtieYuji Yaginuma2018-04-041-1/+1
|\ \ \ \ | | | | | | | | | | Fix RenderingTest in railtie
| * | | | Fix RenderingTest in railtieYoshiyuki Hirano2018-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | Test class name is not `RoutingTest` but `RenderingTest`
* | | | | Merge pull request #32434 from bogdanvlviv/use-default-option-of-mattr_accessorAndrew White2018-04-031-2/+1
|\ \ \ \ \ | |/ / / / |/| | | | Use `:default` option in order to set default value of `finalize_compiled_template_methods`
| * | | | Use `:default` option in order to set default value of ↵bogdanvlviv2018-04-031-2/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `finalize_compiled_template_methods` Since we introduced default option for `class_attribute` and `mattr_accessor` family of methods and changed all occurrences of setting default values by using of `:default` option I think it would be fine to use `:default` option in order to set default value of `finalize_compiled_template_methods` since it expresses itself very well. Related to #29294, #32418
* | | | removes obsolete images in guides [ci skip]Xavier Noria2018-04-032-0/+0
| | | | | | | | | | | | | | | | Note that tab_yellow.gif exists, that is the one being used.
* | | | remove obsolete author imagesXavier Noria2018-04-036-0/+0
|/ / / | | | | | | | | | The credits page is gone after #32429, these images are now orphan.
* | | Merge pull request #32432 from prathamesh-sonpatki/credits-cleanupAndrew White2018-04-032-10/+1
|\ \ \ | | | | | | | | Cleanup credits related code as it is removed now in PR #32429
| * | | Cleanup credits related code as it is removed now in PR #32429Prathamesh Sonpatki2018-04-032-10/+1
|/ / /
* | | Merge pull request #32429 from yhirano55/remove_credits_html_from_rails_guidesKasper Timm Hansen2018-04-036-89/+1
|\ \ \ | | | | | | | | Remove credits.html from Rails Guides
| * | | Remove credits.html from Rails GuidesYoshiyuki Hirano2018-04-036-89/+1
| | | | | | | | | | | | | | | | * refs #32420
* | | | Merge pull request #32430 from yhirano55/display_db_drop_desc_in_activerecordRyuta Kamizono2018-04-031-1/+3
|\ \ \ \ | | | | | | | | | | Display db:drop description in ActiveRecord
| * | | | Display db:drop description in ActiveRecordYoshiyuki Hirano2018-04-031-1/+3
| |/ / /
* | | | Merge pull request #32427 from tjschuck/small_doc_fixesRyuta Kamizono2018-04-034-7/+7
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Small doc fixes [ci skip]
| * | | | Small doc fixesT.J. Schuck2018-04-024-7/+7
| |/ / / | | | | | | | | | | | | [ci skip]
* | | | Merge pull request #32428 from EarthSchlange/patch-1Ryuta Kamizono2018-04-031-1/+1
|\ \ \ \ | |/ / / |/| | | | | | | | | | | Doc fix added missing quote [ci skip]
| * | | Doc fix added missing quoteMichael H2018-04-021-1/+1
|/ / /
* | | Merge pull request #32418 from urbanautomaton/disable-template-finalizer-in-testRafael França2018-04-025-1/+33
|\ \ \ | | | | | | | | Disable ActionView::Template finalizers in test environment
| * | | Add `action_view.finalize_compiled_template_methods` config optionSimon Coffey2018-04-025-1/+33
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActionView::Template instances compile their source to methods on the ActionView::CompiledTemplates module. To prevent leaks in development mode, where templates can frequently change, a finalizer is added that undefines these methods[1] when the templates are garbage-collected. This is undesirable in the test environment, however, as templates don't change during the life of the test. Moreover, the cost of undefining a method is proportional to the number of descendants a class or module has, since the method cache must be cleared for all descendant classes. As ActionView::CompiledTemplates is mixed into every ActionView::TestCase (or in RSpec suites, every view spec example group), it can end up with a very large number of descendants, and undefining its methods can become very expensive. In large test suites, this results in a long delay at the end of the test suite as all template finalizers are run, only for the process to then exit. To avoid this unnecessary cost, this change adds a config option, `action_view.finalize_compiled_template_methods`, defaulting to true, and sets it to false in the test environment only. [1] https://github.com/rails/rails/blob/09b2348f7fc8d4e7191e70e06608c5909067e2aa/actionview/lib/action_view/template.rb#L118-L126
* | | Merge pull request #32336 from vincedevendra/allow_mutating_dig_return_valueAaron Patterson2018-04-022-1/+10
|\ \ \ | | | | | | | | Make mutating params#dig return value mutate underlying params
| * | | Make mutating params#dig mutate underlying paramsVince DeVendra2018-03-242-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #32404 from mathieumahe/masterGuillermo Iguaran2018-04-023-1/+39
|\ \ \ \ | | | | | | | | | | Extract the confirm call in its own, overridable method in rails_ujs
| * | | | Extract the confirm call in its own, overridable method in rails_ujsMathieu2018-04-013-1/+39
| | | | |
* | | | | Merge pull request #32415 from kamipo/remove_foreign_keys_moduleGuillermo Iguaran2018-04-024-15/+2
|\ \ \ \ \ | | | | | | | | | | | | Remove `ForeignKeys` module which was introduced at #32299
| * | | | | Remove `ForeignKeys` module which was introduced at #32299Ryuta Kamizono2018-04-024-15/+2
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | To solve the problem #32299, just enough to introduce `fk_ignore_pattern` option. I don't think there is a need to expose these constants.
* | | | | Merge pull request #32416 from yhirano55/not_generate_needless_files_in_guidesRafael França2018-04-021-25/+27
|\ \ \ \ \ | | | | | | | | | | | | Not generate needless files in guides