aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* `get_value` and `set_value` in `Relation` are no longer used externallyRyuta Kamizono2017-07-251-9/+10
|
* `Relation::Merger` should not fill `values` with empty valuesRyuta Kamizono2017-07-252-10/+20
| | | | | | | | | Currently `Relation#merge` will almost fill `values` with empty values (e.g. `other.order_values` is always true, it should be `other.order_values.any?`). This means that `Relation#merge` always changes `values` even if actually `values` is nothing changed. This behavior will makes `Relation#empty_scope?` fragile. So `Relation#merge` should avoid unnecessary changes.
* 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 ```
* | | | | | | | Merge pull request #29906 from assain/add_more_tests_to_message_verifierKasper Timm Hansen2017-07-241-0/+15
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Add tests to MessageVerifier
| * | | | | | | add metadata tests: verify methodAssain2017-07-241-0/+15
|/ / / / / / /
* | | | | | | [ci skip] Remove superfluous paragraphs; fully qualify constants.Kasper Timm Hansen2017-07-241-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The paragraphs retread ground covered by the title and the usage examples, so let's just remove them. [ Assain Jaleel & Kasper Timm Hansen ]
* | | | | | | Merge pull request #29892 from assain/documenation_for_metadataKasper Timm Hansen2017-07-243-0/+100
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Document metadata support for MessageEncryptor
| * | | | | | | add to changelog: purpose and expiry supportAssain2017-07-241-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
| * | | | | | | document metadata support added to message encryptor and message verifierAssain2017-07-242-0/+72
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | | | Merge pull request #29860 from georgeclaghorn/travel-back-automaticallyRafael França2017-07-243-8/+8
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | Remove time stubs after each test
| * | | | | | Remove time stubs after each testGeorge Claghorn2017-07-223-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverts 7abb6e0.
* | | | | | | Merge pull request #29820 from kirs/frozen-actioncableSean Griffin2017-07-2381-1/+159
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Use frozen string literal in actioncable/
| * | | | | | | Use frozen string literal in actioncable/Kir Shatrov2017-07-2381-1/+159
| | |_|_|_|_|/ | |/| | | | |
* | | | | | | Merge pull request #29900 from kirs/actionview-frozen-friendlySean Griffin2017-07-231-1/+2
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Make actionview ready for frozen strings
| * | | | | | Make actionview ready for frozen stringsKir Shatrov2017-07-231-1/+2
| | | | | | |
* | | | | | | Merge pull request #29901 from kirs/actioncable-frozen-friendlySean Griffin2017-07-231-1/+5
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Make actioncable ready for frozen strings
| * | | | | | Make actioncable ready for frozen stringsKir Shatrov2017-07-231-1/+5
| | | | | | |
* | | | | | | Merge pull request #29896 from kirs/frozen-actionmailerRichard Schneeman2017-07-2343-0/+84
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Use frozen string literal in actionmailer/
| * | | | | | Use frozen string literal in actionmailer/Kir Shatrov2017-07-2343-0/+84
|/ / / / / /
* | | | | | Merge branch 'verify-release'Kasper Timm Hansen2017-07-234-96/+138
|\ \ \ \ \ \
| * | | | | | Update release instructions in light of new tasks.Kasper Timm Hansen2017-07-221-44/+46
| | | | | | |
| * | | | | | Support multiple versions in release announcement.Kasper Timm Hansen2017-07-222-51/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So releasing 5.1 and 5.0 together won't require manual copy and paste.
| * | | | | | Add task to verify a release.Kasper Timm Hansen2017-07-222-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basically revises the release flow to: * Update the version in RAILS_VERSION + rake changelog:header * Run rake all:verify (click around in the booted app) * If that checks out, run rake release.
* | | | | | | Merge pull request #29867 from koic/fix_a_failed_ar_test_when_using_oracleKasper Timm Hansen2017-07-231-2/+10
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix a failued AR test when using OracleAdapter
| * | | | | | | Fix a failued AR test when using OracleAdapterKoichi ITO2017-07-201-2/+10
| | | | | | | |
* | | | | | | | Let Metadata instance handle purpose coercion.Kasper Timm Hansen2017-07-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ Assain Jaleel & Kasper Timm Hansen ]
* | | | | | | | Remove dependency on `from_now` extension.Kasper Timm Hansen2017-07-231-1/+1
| |_|_|/ / / / |/| | | | | | | | | | | | | | | | | | | | [ Assain Jaleel & Kasper Timm Hansen ]
* | | | | | | Merge pull request #29768 from janpieper/sort-enabled-extensions-in-dumpEileen M. Uchitelle2017-07-222-1/+15
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | Sort enabled adapter extensions in schema dump
| * | | | | | Sort enabled adapter extensions in schema dumpJan Pieper2017-07-122-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The list of enabled adapter extensions in the schema dump isn't sorted by default, so it may happen that the sorting changes over time. If you're using a VCS, a change to the sorting results in a diff without any real change. Sorting the list should solve this problem.