aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix failing testsSean Griffin2017-07-252-2/+2
| | | | `bind_values` was removed from Arel
* Fix `dbconsole` test when tempdir is a long pathSean Griffin2017-07-251-1/+1
| | | | | | | | The output of `.databases` in SQLite will truncate to a certain size. This causes the test to fail when run locally from a mac, or anything which has a tempdir with more than a few characters. This pragma has the same output, but presented as a normal query, meaning no truncation will occur.
* Merge pull request #29928 from ↵Eileen M. Uchitelle2017-07-251-0/+2
|\ | | | | | | | | koic/fix_test_add_column_with_timestamp_type_oracle Fix `test_add_column_with_timestamp_type` when using Oracle
| * Fix `test_add_column_with_timestamp_type` when using OracleKoichi ITO2017-07-251-0/+2
| |
* | Merge pull request #29916 from lugray/stop_generating_application_recordEileen M. Uchitelle2017-07-2510-57/+66
|\ \ | | | | | | Stop creating ApplicationRecord on model generation
| * | Stop creating ApplicationRecord on model generationLisa Ugray2017-07-2410-57/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When generating models, we created ApplicationRecord in the default location if no file existed there. That was annoying for people who moved it to somewhere else in the autoload path. At this point, the vast majority of apps should have either run the upgrade script or generated a model since upgrading. For those that haven't the error message after generating a new model should be helpful: NameError: uninitialized constant ApplicationRecord To ease friction in that case, this also adds a generator for ApplicationRecord.
* | | 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