aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | Switch queue_classic back to origin repositoryLars Kanis2019-01-252-9/+8
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | It has been moved to the a fork as part of https://github.com/rails/rails/pull/31671 . That was since to that time a required PR was not yet merged. Now the queue_classic master branch is compatible to recent pg versions, so that there's no need to keep using a fork.
* | | | | Merge pull request #35049 from yuki24/fix-33414Aaron Patterson2019-01-253-13/+34
|\ \ \ \ \ | |/ / / / |/| | | | Fixed a bug where the debug view does not show the error page properly
| * | | | Fixed a bug where the debug view does not show the error page properlyYuki Nishijima2019-01-243-13/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two cases where the debug view does not show the error details properly: * When the cause is mapped to an HTTP status code the last exception is unexpectedly uwrapped * When the last error is thrown from a view template the debug view is not using the `rescues/template_error.html.erb` to generate the view Both the cases could be fixed by not unwrapping the exception. The only case where the exception should be unwrapped is when the last error is an `ActionView::Template::Error` object. In this case the HTTP status code is determined based on the cause. There are actually more wrapper exceptions that are intentionally thrown. However, there is a consistent pattern of setting the original message and original backtrace to the wrapper exception implemented, so the debug view will not lose the information about what went wrong eariler.
* | | | | Merge pull request #35042 from eileencodes/fix-error-message-for-missing-handlerEileen M. Uchitelle2019-01-254-8/+21
|\ \ \ \ \ | | | | | | | | | | | | Fix error raised when handler doesn't exist
| * | | | | Fix error raised when handler doesn't existEileen Uchitelle2019-01-254-8/+21
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While working on another feature for multiple databases (auto-switching) I observed that in development the first request won't autoload the application record connection for the primary database and may not yet know about the replica connection. In my test application this caused the application to thrown an error if I tried to send the first request to the replica before the replica was connected. This wouldn't be an issue in production because the application is preloaded. In order to fix this I decided to leave the original error message and delete the new error message. I updated the original error message to include the `role` to make it a bit clearer that the connection isn't established for that particular role. The error now reads: ``` No connection pool with 'primary' found for the 'reading' role. ``` A single database application will continue uisng the original error message: ``` No connection pool with 'primary' found. ```
* | | | | Merge pull request #35050 from ricardotk002/fix-typo-rails-testing-guidesGuillermo Iguaran2019-01-241-1/+1
|\ \ \ \ \ | |_|/ / / |/| | | | Fix typo in ActionCable::Connection::TestCase reference [ci-skip]
| * | | | Fix typo in ActionCable::Connection::TestCase referenceRicardo Diaz2019-01-241-1/+1
|/ / / /
* | | | Merge pull request #34789 from christos/fix-editing-new-environment-credentialsKasper Timm Hansen2019-01-253-2/+20
|\ \ \ \ | | | | | | | | | | Don't load app environment when editing credentials
| * | | | Don't load app environment when editing credentialsChristos Zisopoulos2018-12-263-2/+20
| | | | | | | | | | | | | | | | | | | | This avoids missing key exceptions caused by code that tries to read the credentials before they have been added to the encrypted file, for example when editing the credentials for a new environment.
* | | | | Merge pull request #34994 from schuetzm/host-authorization-only-in-developmentRafael França2019-01-242-4/+4
|\ \ \ \ \ | | | | | | | | | | | | Recommend adding the requested domain to hosts whitelist only in deve…
| * | | | | Recommend adding the requested domain to hosts whitelist only in developmentMarc Schütz2019-01-232-4/+4
| | | | | |
* | | | | | Merge pull request #35021 from palkan/refactor/broadcasting-for-testingKasper Timm Hansen2019-01-247-21/+84
|\ \ \ \ \ \ | | | | | | | | | | | | | | Action Cable: move channel_name to Channel.broadcasting_for
| * | | | | | fix fixture syntax in cable docs and guidesVladimir Dementyev2019-01-222-6/+6
| | | | | | |
| * | | | | | Add note about broadcast_to/broadcasting_for to change logVladimir Dementyev2019-01-222-1/+25
| | | | | | |
| * | | | | | Add Channel#broadcast_toVladimir Dementyev2019-01-222-2/+2
| | | | | | |
| * | | | | | Move `channel_name` to Channel.broadcasting_forVladimir Dementyev2019-01-225-14/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That would allow us to test broadcasting made with channel, e.g.: ```ruby class ChatRelayJob < ApplicationJob def perform_later(room, msg) ChatChannel.broadcast_to room, message: msg end end ``` To test this functionality we need to know the underlying stream name (to use `assert_broadcasts`), which relies on `channel_name`. We had to use the following code: ```ruby assert_broadcasts(ChatChannel.broadcasting_for([ChatChannel.channel_name, room]), 1) do ChatRelayJob.perform_now end ``` The problem with this approach is that we use _internal_ API (we shouldn't care about `channel_name` prefix in our code). With this commit we could re-write the test as following: ```ruby assert_broadcasts(ChatChannel.broadcasting_for(room), 1) do ChatRelayJob.perform_now end ```
* | | | | | | Merge pull request #35047 from yuki24/prefer-strings-over-regexRafael França2019-01-241-22/+20
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Prefer strings over regex expressions
| * | | | | | | Prefer strings over regex expressionsYuki Nishijima2019-01-241-22/+20
| | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this case statement, there are two patterns that start with the same line: when %r{/not_found} ... when %r{/not_found_original_exception} ... Because the string "/not_found_original_exception" does match the first one, it is never routed to what it is supposed to be routed, causing one of the tests for DebugExceptions to happen to be passing. After changing the regex expressions back to strings, I noticed that the test setup is not complete (the template object needs to be a proper template object). Once I fixed it all the tests started padding.
* | | | | | | Merge pull request #35045 from paracycle/uk-fix-partial-rendererRafael França2019-01-242-6/+6
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix partial renderer assuming `locals` responds to `symbolize_keys`
| * | | | | | | Add test for Hash-like object being passed to partial `locals`Ufuk Kayserilioglu2019-01-241-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test passes an instance of `ActionController::Parameters` that acts like a Hash but does not respond to some Hash methods like `symbolize_keys`. Moreover, if someone were to call `to_h` on the value it would fail since the parameter is not permitted. So this is a great way to ensure that the partial rendering pipeline does not mess with `locals`.
| * | | | | | | Revert "Allow usage of strings as locals for partial renderer"Ufuk Kayserilioglu2019-01-242-11/+1
| | | | | | | |
* | | | | | | | Merge pull request #35046 from kddeisz/make-and-and-case-node-expressionsRafael França2019-01-243-4/+11
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Make `And` and `Case` into expression nodes
| * | | | | | | | Make `And` and `Case` into expression nodesKevin Deisz2019-01-243-4/+11
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | Allows aliasing, predications, ordering, and various other functions on `And` and `Case` nodes. This brings them in line with other nodes like `Binary` and `Unary`.
* | | | | | | | Merge pull request #35033 from gmcgibbon/multilevel_command_root_namespaceRafael França2019-01-243-3/+18
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Fix deeply nested namespace command printing
| * | | | | | | Fix deeply nested namespace command printingGannon McGibbon2019-01-243-3/+18
| | | | | | | |
* | | | | | | | Prefer ImageProcessing's resize_to_limit macro over resize_to_fitGeorge Claghorn2019-01-249-20/+20
| |_|_|_|_|/ / |/| | | | | | | | | | | | | | | | | | | | Don't upsize images smaller than the specified dimensions.
* | | | | | | Allow `column_exists?` to be passed `type` argument as a stringRyuta Kamizono2019-01-242-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently `conn.column_exists?("testings", "created_at", "datetime")` returns false even if the table has the `created_at` column. That reason is that `column.type` is a symbol but passed `type` is not normalized to symbol unlike `column_name`, it is surprising behavior to me. I've improved that to normalize a value before comparison.
* | | | | | | Merge pull request #35040 from colorbox/fix_formatting_in_action_text_docsYuji Yaginuma2019-01-242-4/+4
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | Fix document formatting on Action Text docs [ci skip]
| * | | | | | Fix document formatting on Action Text docs [ci skip]colorbox2019-01-242-4/+4
|/ / / / / / | | | | | | | | | | | | | | | | | | Use `+` instead of backquote.
* | | | | | Merge pull request #35031 from rails/view-ivarAaron Patterson2019-01-232-9/+7
|\ \ \ \ \ \ | | | | | | | | | | | | | | Pass the view around instead of using an ivar
| * | | | | | Pass the view around instead of using an ivarAaron Patterson2019-01-232-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we pass the view instance around it's easier to understand the flow control.
* | | | | | | Tell the user what to use instead of update_attributes/!Xavier Noria2019-01-231-2/+2
| |/ / / / / |/| | | | |
* | | | | | Merge pull request #35029 from dylanahsmith/fix-strictly-cast-attribute-typesRyuta Kamizono2019-01-242-1/+7
|\ \ \ \ \ \ | |/ / / / / |/| | | | | activerecord: Fix statement cache for strictly cast attributes
| * | | | | activerecord: Fix statement cache for strictly cast attributesDylan Thacker-Smith2019-01-232-1/+7
|/ / / / /
* | | | | Merge pull request #34993 from schuetzm/allow-subdomains-of-localhostRafael França2019-01-232-1/+6
|\ \ \ \ \ | | | | | | | | | | | | Subdomains of localhost are safe against DNS rebinding
| * | | | | Subdomains of localhost are safe against DNS rebindingMarc Schütz2019-01-232-1/+6
| | |/ / / | |/| | |
* | | | | Merge pull request #35027 from sponomarev/chore/fix-ac-test-typoKasper Timm Hansen2019-01-231-2/+0
|\ \ \ \ \ | |_|_|_|/ |/| | | | Fix attribute typo in ActionCable connection test request
| * | | | Fix attribute typo in ActionCable connection test requestSergey Ponomarev2019-01-231-2/+0
|/ / / /
* | | | Merge pull request #35024 from calasyr/patch-1George Claghorn2019-01-221-1/+1
|\ \ \ \ | | | | | | | | | | Corrected spelling of ActionCable::Connection::TestCase [ci skip]
| * | | | Corrected spelling of ActionCable::Connection::TestCaseAlan Brown2019-01-221-1/+1
|/ / / /
* | | | Merge pull request #35018 from gmcgibbon/revert_redirect_to_allow_other_hostRafael França2019-01-228-79/+21
|\ \ \ \ | | | | | | | | | | Revert ensure external redirects are explicitly allowed
| * | | | Revert ensure external redirects are explicitly allowedGannon McGibbon2019-01-228-79/+21
| | | | |
* | | | | Merge pull request #35010 from Edouard-chin/ec-numericality-validator-fixRafael França2019-01-222-8/+16
|\ \ \ \ \ | | | | | | | | | | | | Fix NumericalityValidator on object responding to `to_f`:
| * | | | | Fix NumericalityValidator on object responding to `to_f`:Edouard CHIN2019-01-222-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - If you had a PORO that acted like a Numeric, the validator would work correctly because it was previously using `Kernel.Float` which is implicitely calling `to_f` on the passed argument. Since rails/rails@d126c0d , we are now using `BigDecimal` which does not implicitely call `to_f` on the argument, making the validator fail with an underlying `TypeError` exception. This patch replate the `is_decimal?` check with `Kernel.Float`. Using `Kernel.Float` as argument for the BigDecimal call has two advantages: 1. It calls `to_f` implicetely for us. 2. It's also smart enough to detect that `Kernel.Float("a")` isn't a Numeric and will raise an error. We don't need the `is_decimal?` check thanks to that. Passing `Float::DIG` as second argument to `BigDecimal` is mandatory because the precision can't be omitted when passing a Float. `Float::DIG` is what is used internally by ruby when calling `123.to_d` https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/lib/bigdecimal/util.rb#L47 - Another small issue introduced in https://github.com/rails/rails/pull/34693 would now raise a TypeError because `Regexp#===` will just return false if the passed argument isn't a string or symbol, whereas `Regexp#match?` will.
* | | | | | Merge pull request #35017 from yahonda/mysql8014Ryuta Kamizono2019-01-231-1/+2
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | MySQL 8.0.14 adds `ER_FK_INCOMPATIBLE_COLUMNS`
| * | | | | MySQL 8.0.14 adds `ER_FK_INCOMPATIBLE_COLUMNS`Yasuo Honda2019-01-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-14.html > Error messages relating to creating and dropping foreign keys > were improved to be more specific and informative. (Bug #28526309, Bug #92087) https://dev.mysql.com/doc/refman/8.0/en/server-error-reference.html > Error number: 3780; Symbol: ER_FK_INCOMPATIBLE_COLUMNS; SQLSTATE: HY000 > Message: Referencing column '%s' and referenced column '%s' in foreign key constraint '%s' are incompatible. > ER_FK_INCOMPATIBLE_COLUMNS was added in 8.0.14.
* | | | | | Merge pull request #35020 from alkesh26/ationpack-typo-fixesRafael França2019-01-223-6/+6
|\ \ \ \ \ \ | | | | | | | | | | | | | | Actionpack typo fixes.
| * | | | | | 1. Replaced unused variables by `_`.alkesh262019-01-223-6/+6
| | |_|/ / / | |/| | | | | | | | | | | | | | | | 2. Typo fixes.
* | | | | | Merge pull request #34952 from rails/template-stuffAaron Patterson2019-01-2211-82/+43
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Template Handler Refactoring
| * | | | | Ask the view for its method containerAaron Patterson2019-01-182-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than doing is_a? checks, ask the view object for its compiled method container. This gives us the power to replace the method container depending on the instance of the view.