aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | | | 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.
* | | | | | | | Merge pull request #29870 from kamipo/use_true_false_literalsSean Griffin2017-07-222-14/+4
|\ \ \ \ \ \ \ \ | |_|_|_|_|_|_|/ |/| | | | | | | Use `TRUE` and `FALSE` boolean literals for MySQL
| * | | | | | | Use `TRUE` and `FALSE` boolean literals for MySQLRyuta Kamizono2017-07-202-14/+6
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since #29699, abstract boolean serialization has been changed to use `TRUE` and `FALSE` literals. MySQL also support the literals. So we can use the abstract boolean serialization even for MySQL.
* | | | | | | Merge pull request #29858 from ↵Rafael França2017-07-212-19/+18
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | y-yagi/use_argument_error_instead_of_own_error_class Use `ArgumentError` instead of own error class
| * | | | | | | Use `ArgumentError` instead of own error classyuuji.yaginuma2017-07-202-19/+18
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the argument is invalid, I think that it is more intuitive to use `ArgumentError` than its own error class.
* | | | | | | Merge pull request #29869 from kamipo/make_type_map_to_privateRafael França2017-07-219-31/+28
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Make `type_map` to private because it is only used in the connection adapter
| * | | | | | | Make `type_map` to private because it is only used in the connection adapterRyuta Kamizono2017-07-209-31/+28
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `type_map` is an internal API and it is only used in the connection adapter. And also, some type map initializer methods requires passed `type_map`, but those instances already has `type_map` in itself. So we don't need explicit passing `type_map` to the initializers.
* | | | | | | Merge pull request #29884 from padi/update_rails_5_upgrade_guideRafael França2017-07-212-2/+12
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Updates Rails upgrade guide on `ActionView::Helpers::RecordTagHelper`
| * | | | | | | Suppress documentation for content_tag_for and div_for since they were ↵Marc Rendl Ignacio2017-07-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | removed already
| * | | | | | | Updates Rails upgrade guide for 4.2 to 5.0 regarding the removal of ↵Marc Rendl Ignacio2017-07-211-0/+10
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | `ActionView::Helpers::RecordTagHelper`
* | | | | | | Merge pull request #29885 from freeletics/fix-false-positive-testRafael França2017-07-211-11/+11
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix false positive test related to wrong app root path.
| * | | | | | | Fix false positive test related to wrong app root path.Wojciech Wnętrzak2017-07-211-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without setting root config, `config.paths["config/secrets"]` located in https://github.com/rails/rails/blob/84eb498f84ebc5d1be0b0db6f7bca9da3d679ca6/railties/lib/rails/application.rb#L390 always returned empty list.
* | | | | | | | Merge pull request #29855 from lugray/has_one_destroyed_by_associationRafael França2017-07-213-0/+42
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Match destroyed_by_association for has_one to has_many
| * | | | | | | | Match destroyed_by_association for has_one to has_manyLisa Ugray2017-07-213-0/+42
| | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a has_many association is destroyed by `dependent: destroy`, destroyed_by_association is set to the reflection, and this can be checked in callbacks. This matches that behaviour for has_one associations.