aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add Brewfile to make easier to install all dependencies we need to run testsRafael Mendonça França2018-04-061-0/+13
| | | | This way we don't need to remember which packages we need to install.
* Merge pull request #32481 from ↵Rafael França2018-04-061-0/+3
|\ | | | | | | | | yhirano55/add_securing_rails_app_guide_link_to_credential_section [ci skip] Add securing rails app guide link to credential section
| * [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).
* | Merge pull request #32355 from kamipo/delegate_to_klass_in_a_scopeRafael França2018-04-065-1/+30
|\ \ | | | | | | Bring back private class methods accessibility in named scope
| * | Deprecate accessibility of private/protected class methods in named scopeRyuta Kamizono2018-03-304-4/+16
| | |
| * | Bring back private class methods accessibility in named scopeRyuta Kamizono2018-03-274-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The receiver in a scope was changed from `klass` to `relation` itself for all scopes (named scope, default_scope, and association scope) behaves consistently. In addition. Before 5.2, if both an AR model class and a Relation instance have same named methods (e.g. `arel_attribute`, `predicate_builder`, etc), named scope doesn't respect relation instance information. For example: ```ruby class Post < ActiveRecord::Base has_many :comments1, class_name: "RecentComment1" has_many :comments2, class_name: "RecentComment2" end class RecentComment1 < ActiveRecord::Base self.table_name = "comments" default_scope { where(arel_attribute(:created_at).gteq(2.weeks.ago)) } end class RecentComment2 < ActiveRecord::Base self.table_name = "comments" default_scope { recent_updated } scope :recent_updated, -> { where(arel_attribute(:updated_at).gteq(2.weeks.ago)) } end ``` If eager loading `Post.eager_load(:comments1, :comments2).to_a`, `:comments1` (default_scope) respects aliased table name, but `:comments2` (using named scope) may not work correctly since named scope doesn't respect relation instance information. See also 801ccab. But this is a breaking change between releases without deprecation. I decided to bring back private class methods accessibility in named scope. Fixes #31740. Fixes #32331.
* | | Merge pull request #32472 from Edouard-chin/ec-activesupport-teardownRafael França2018-04-062-1/+42
|\ \ \ | | | | | | | | `SetupAndTeardown#teardown` should call any subsequent after_teardown:
| * | | Rename the class as there is already an existing class with that nameEdouard CHIN2018-04-061-1/+1
| | | |
| * | | `SetupAndTeardown#teardown` should call any subsequent after_teardown:Edouard CHIN2018-04-062-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you have a regular test that have a teardown block, and for any reason an exception get raised, ActiveSupport will not run subsequent after_teardown method provided by other module or gems. One of them being the ActiveRecord::TestFixtures which won't rollback the transation when the test ends making all subsequent test to be in a weird state. The default implementation of minitest is to run all teardown methods from the user's test, rescue all exceptions, run all after_teardown methods provided by libraries and finally re-raise the exception that happened in the user's teardown method. Rails should do the same.
* | | | Merge pull request #32479 from ↵Javan Makhmali2018-04-062-2/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | kylekeesling/ie11-activestorage-direct-upload-bug-fix Fixes a bug in IE11 that broke ActiveStorage direct uploads
| * | | | fixes a bug in IE11 that broke direct uploadskylekeesling2018-04-062-2/+2
| | | | |
* | | | | Merge pull request #32480 from bogdanvlviv/add-changelog-about-dig-session-23864Rafael França2018-04-062-2/+6
|\ \ \ \ \ | |/ / / / |/| | | | Add changelog entry for #32446
| * | | | Add changelog entry for #32446bogdanvlviv2018-04-062-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In #32446 was added method `dig` to `session`. Improve docs of method `dig`. [ci skip]
* | | | | Fix structure:dump for multiple databaseseileencodes2018-04-061-2/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | ccea4cf broke multiple database structure:dump, the current_config line should have been deleted instead. I'm struggling to write a test for this since the confings are passed from rake to the structure_dump method rather than the other way around. Hoping to come up with a test while I work on structure:load commands for multiple databases.
* | | | Merge pull request #32477 from bogdanvlviv/fix-test-added-in-32444Eileen M. Uchitelle2018-04-061-2/+4
|\ \ \ \ | | | | | | | | | | Fix test added in #32444
| * | | | Fix test added in #32444bogdanvlviv2018-04-061-2/+4
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | Currently test `#test_logger_does_not_mutate_app_return` doesn't test mutation of response and the test passes with and without changes added in #32444. `#freeze` response in the test in order to test mutation.
* | | / Fix broken `ServerTest` with Capybara 3.0.0yuuji.yaginuma2018-04-062-14/+10
| |_|/ |/| | | | | | | | | | | | | | | | | It seems that it is no longer possible to specify the value held by `Capybara.server` as sever. Ref: https://github.com/teamcapybara/capybara/commit/ba7674086cbcd3b22d3614011815bc5d483e5960
* | | 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