aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused `queries_predicates`Ryuta Kamizono2017-07-251-12/+0
| | | | Since 213796f, `queries_predicates` is no longer used.
* Merge pull request #29930 from JagdeepSingh/add-callbacks-documentationप्रथमेश Sonpatki2017-07-251-0/+29
|\ | | | | [ci skip] Add documentation for after_create_commit and after_update_commit callbacks
| * [ci skip] Add documentation for after_create_commit and after_update_commit ↵jagdeepsingh2017-07-251-0/+29
|/ | | | callbacks
* Merge pull request #29919 from kirs/actionpack-frozen-friendlyRafael França2017-07-249-10/+26
|\ | | | | Make actionpack frozen string friendly
| * Make actionpack frozen string friendlyKir Shatrov2017-07-249-10/+26
| |
* | Merge pull request #29924 from y-yagi/fix_ruby_warningRafael França2017-07-241-1/+1
|\ \ | | | | | | Fix `warning: ambiguous first argument`
| * | Fix `warning: ambiguous first argument`yuuji.yaginuma2017-07-251-1/+1
|/ / | | | | | | | | | | | | | | This fixes the following warning: ``` railties/test/application/rake/dbs_test.rb:265: warning: ambiguous first argument; put parentheses or a space even after `/' operator ```
* | Merge pull request #29866 from rlue/masterRafael França2017-07-241-4/+4
|\ \ | | | | | | [API DOCUMENTATION] [MINOR] Correct description of ActionController::Parameters#delete
| * | Fix typo in API docsRyan Lue2017-07-201-1/+1
| | |
| * | Correct API documentation for ActionController::Parameters#deleteRyan Lue2017-07-201-4/+4
| | |
* | | Merge pull request #29921 from xtina-starr/remove-depreciated-assertionRafael França2017-07-241-1/+1
|\ \ \ | | | | | | | | remove depreciated assertion to eliminate warning
| * | | remove depreciated assertion to eliminate warningChristina Thompson2017-07-241-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Yuki Nishijima <yk.nishijima@gmail.com>
* | | | Merge pull request #29898 from ↵Rafael França2017-07-244-1/+65
|\ \ \ \ | |/ / / |/| | | | | | | | | | | deivid-rodriguez/follow_up_to_multiple_location_engine_mounting Fix regression introduced by fixing mounting the same engine in multiple locations
| * | | Fix regression from multiple mountpoint supportDavid Rodríguez2017-07-244-1/+65
| | | |
* | | | Merge pull request #29859 from dwightwatson/feature/rack-testRafael Mendonça França2017-07-242-66/+71
|\ \ \ \ | | | | | | | | | | | | | | | Update rack-test dependency constraint
| * | | | Update rack-test dependency constraintDwight Watson2017-07-242-69/+78
| | | | |
* | | | | Merge pull request #29918 from ↵Rafael França2017-07-241-1/+1
|\ \ \ \ \ | |_|_|_|/ |/| | | | | | | | | | | | | | xtina-starr/suppress-warning-from-actionview-controller-helper Suppress warning from actionview controller helper.
| * | | | Suppress warning from actionview controller helper.Christina Thompson2017-07-241-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | Explicitly pass a destructed array to the delegate method. Signed-off-by: Yuki Nishijima <yk.nishijima@gmail.com>
* | | | Merge pull request #29897 from kirs/frozen-actionviewRafael França2017-07-24178-1/+354
|\ \ \ \ | | | | | | | | | | Use frozen string literal in actionview/
| * | | | Use frozen string literal in actionview/Kir Shatrov2017-07-24178-1/+354
| | | | |
* | | | | Merge pull request #29908 from deivid-rodriguez/fix_warnings_in_railties_testsRafael França2017-07-242-11/+21
|\ \ \ \ \ | | | | | | | | | | | | Fix warnings in railties tests
| * | | | | Fix warnings in railties testsDavid Rodríguez2017-07-242-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | This warning has been fixed in sass-rails. This change picks up the fix.
* | | | | | Merge pull request #29848 from kamipo/fix_distinct_count_with_order_and_limitRafael França2017-07-247-45/+87
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix `COUNT(DISTINCT ...)` with `ORDER BY` and `LIMIT`
| * | | | | | Extract `Account` model to the dedicated fileRyuta Kamizono2017-07-222-34/+35
| | | | | | |
| * | | | | | Should keep the table name qualified `*` for distinct subqueryRyuta Kamizono2017-07-222-1/+13
| | | | | | |
| * | | | | | Fix `COUNT(DISTINCT ...)` with `ORDER BY` and `LIMIT`Ryuta Kamizono2017-07-225-11/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since #26972, `ORDER BY` is kept if `LIMIT` is presented for performance. But in most SQL servers (e.g. PostgreSQL, SQL Server, etc), `ORDER BY` expressions must appear in select list for `SELECT DISTINCT`. We should not replace existing select list in that case.
* | | | | | | Merge pull request #29915 from kamipo/fix_warning_assigned_but_unused_variableRafael França2017-07-241-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix `warning: assigned but unused variable - comment`
| * | | | | | | Fix `warning: assigned but unused variable - comment`Ryuta Kamizono2017-07-251-1/+1
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` % ARCONN=sqlite3 be ruby -w -Itest test/cases/associations/belongs_to_associations_test.rb -n test_multiple_counter_cache_with_after_create_update test/cases/associations/belongs_to_associations_test.rb:1181: warning: assigned but unused variable - comment Using sqlite3 Run options: -n test_multiple_counter_cache_with_after_create_update --seed 49644 . Finished in 0.114266s, 8.7515 runs/s, 17.5030 assertions/s. 1 runs, 2 assertions, 0 failures, 0 errors, 0 skips ```
* | | | | | | Merge pull request #29902 from y-yagi/fix_29880Rafael França2017-07-241-2/+6
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Do not show URL in boot info when using Puma
| * | | | | | | Do not show URL in boot info when using Pumayuuji.yaginuma2017-07-241-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Puma has its own configuration file(e.g. `config/puma.rb`). Can define a port and a URL to bind in the configuration file. Therefore, on Rails side, can not grasp which URI to bind finally. Because of that, it may show a URL different from the actually bound URL, so I think that it is better not to show it. Fixes #29880
* | | | | | | | Merge pull request #29853 from lugray/move_generator_namespacing_to_baseRafael França2017-07-242-36/+37
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Move generator namespacing to Base
| * | | | | | | | Move generator namespacing to BaseLisa Ugray2017-07-192-36/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generators need to be aware of namespace to work properly in engines. Methods to help with this lived in Rails::Generators::NamedBase. Moving them to Rails::Generators::Base (which NamedBase inherits from) allows a follow-up in which a namespace aware unnamed generator can be created.
* | | | | | | | | Merge pull request #29792 from lugray/delegate_respond_toRafael França2017-07-242-2/+21
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Delegate respond_to? in ActionView::Helpers::ControllerHelper
| * | | | | | | | | Delegate respond_to? in ActionView::Helpers::ControllerHelperLisa Ugray2017-07-192-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since methods defined in the controller helper are mostly delegated to the controller, delegate respond_to? as well, so that for example `respond_to?(:params)` behaves as expected.
* | | | | | | | | | Merge pull request #29765 from lugray/fix_counter_cacheRafael França2017-07-244-4/+18
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Fix `counter_cache` double increment
| * | | | | | | | | | Add test for fixed `counter_cache` double incrementLisa Ugray2017-07-194-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an `after_create` callback did `update_attributes` on a record with multiple `belongs_to` associations with counter caches, even numbered associations would have their counters double-incremented. Fixes to `ActiveModel::Dirty` in 020abad fixed this. This adds regression tests for this bug fixed incidentally in the other commit, which also removed the need for the workaround using @_after_create_counter_called.
* | | | | | | | | | | Merge pull request #29912 from rails/revert-29911-schneems/rack-mini-profilerRafael França2017-07-242-7/+0
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Revert "Include rack-mini-profiler by default"
| * | | | | | | | | | | Revert "Include rack-mini-profiler by default"Rafael França2017-07-242-7/+0
|/ / / / / / / / / / /
* | | | | | | | | | | Merge pull request #29911 from schneems/schneems/rack-mini-profilerSean Griffin2017-07-242-0/+7
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Include rack-mini-profiler by default
| * | | | | | | | | | | Include rack-mini-profiler by defaultschneems2017-07-242-0/+7
|/ / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've used many development related performance tools, but the single most consistently helpful tool is `rack-mini-profiler`. The tool provides a lightweight UI element for each page, that shows the server response time. When clicked it expands to show more detail: ![](https://www.dropbox.com/s/0aciw4mk8c059n0/Screenshot%202017-07-24%2010.24.24.png?dl=1) This can be used to detect expensive queries, N+1 issues and general performance related problems.
* | | | | | | | | | | Fix test failures when prepared statements are disabledSean Griffin2017-07-243-14/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts the change to enable prepared statements by default on MySQL (though I suspect we could enable them and it'd be great). This change brings back a collector closer to the old `Bind` collector in Arel. However, this one lives in AR, since this is an AR specific need. Additionally, we only use it for statement caching, since the new substitute collector in Arel is higher performance for most cases.
* | | | | | | | | | | Fix build failures on PGSean Griffin2017-07-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Honestly I don't think the tests that are fixed by this change should have been merged. Passing a range or an array to `where` has a special meaning. We need to solve the problem more concretely without overriding the behavior that is present for *every* other type. However, the damage has been done. These changes were in 5.1, so we need a deprecation cycle to remove it.
* | | | | | | | | | | Merge pull request #29905 from kamipo/remove_duplicated_assertionSean Griffin2017-07-241-16/+2
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Remove duplicated assertion in `test_count_with_join`
| * | | | | | | | | | | Remove duplicated assertion in `test_count_with_join`Ryuta Kamizono2017-07-241-16/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The queries both `res2` and `res3` are completely the same. And also, `assert_nothing_raised` is covered by following assertion.
* | | | | | | | | | | | Fix build failures on MySQLSean Griffin2017-07-242-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's an actual bug in 213796fb4936dce1da2f0c097a054e1af5c25c2c around prepared statements being disabled. I'm looking into it, but in the mean time this gets the build green so it doesn't block other PRs
* | | | | | | | | | | | Refactor Active Record to let Arel manage bind paramsSean Griffin2017-07-2437-459/+283
| |_|_|_|_|_|_|_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common source of bugs and code bloat within Active Record has been the need for us to maintain the list of bind values separately from the AST they're associated with. This makes any sort of AST manipulation incredibly difficult, as any time we want to potentially insert or remove an AST node, we need to traverse the entire tree to find where the associated bind parameters are. With this change, the bind parameters now live on the AST directly. Active Record does not need to know or care about them until the final AST traversal for SQL construction. Rather than returning just the SQL, the Arel collector will now return both the SQL and the bind parameters. At this point the connection adapter will have all the values that it had before. A bit of this code is janky and something I'd like to refactor later. In particular, I don't like how we're handling associations in the predicate builder, the special casing of `StatementCache::Substitute` in `QueryAttribute`, or generally how we're handling bind value replacement in the statement cache when prepared statements are disabled. This also mostly reverts #26378, as it moved all the code into a location that I wanted to delete. /cc @metaskills @yahonda, this change will affect the adapters Fixes #29766. Fixes #29804. Fixes #26541. Close #28539. Close #24769. Close #26468. Close #26202. There are probably other issues/PRs that can be closed because of this commit, but that's all I could find on the first few pages.
* | | | | | | | | | | Merge pull request #29894 from eugeneius/check_schema_file_dup_stringKasper Timm Hansen2017-07-242-1/+8
|\ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|/ / / / |/| | | | | | | | | | Avoid modifying frozen string in check_schema_file
| * | | | | | | | | | Avoid modifying frozen string in check_schema_fileEugene Kenny2017-07-232-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was missed when the frozen string literal pragma was added to this file because the string is only modified when running in the context of a full Rails app, which wasn't covered by the test suite.
* | | | | | | | | | | Merge pull request #29907 from deivid-rodriguez/fix_flaky_message_verifier_testKasper Timm Hansen2017-07-241-1/+1
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Fix test failure in message verifier tests
| * | | | | | | | | | | Fix test failure in message verifier testsDavid Rodríguez2017-07-241-1/+1
| | |_|_|_|_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this, I get the following result on my machine ``` # Running: F Failure: MessageVerifierTest#test_backward_compatibility_messages_signed_without_metadata [/home/deivid/Code/rails/activesupport/test/message_verifier_test.rb:91]: --- expected +++ actual @@ -1 +1 @@ -{:some=>"data", :now=>2010-01-01 00:00:00 +0100} +{:some=>"data", :now=>2010-01-01 00:00:00 +0000} bin/test test/message_verifier_test.rb:89 ```