| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
```
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
Fix typo in ActionCable::Connection::TestCase reference [ci-skip]
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Don't load app environment when editing credentials
|
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Recommend adding the requested domain to hosts whitelist only in deve…
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Action Cable: move channel_name to Channel.broadcasting_for
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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
```
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Prefer strings over regex expressions
|
| | |_|_|_|/ /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Fix partial renderer assuming `locals` responds to `symbolize_keys`
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
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`.
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Make `And` and `Case` into expression nodes
|
|/ / / / / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | | |
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`.
|
|\ \ \ \ \ \ \ \
| |/ / / / / / /
|/| | | | | | | |
Fix deeply nested namespace command printing
|
| | | | | | | | |
|
| |_|_|_|_|/ /
|/| | | | | |
| | | | | | |
| | | | | | | |
Don't upsize images smaller than the specified dimensions.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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.
|
|\ \ \ \ \ \ \
| |_|/ / / / /
|/| | | | | | |
Fix document formatting on Action Text docs [ci skip]
|
|/ / / / / /
| | | | | |
| | | | | |
| | | | | | |
Use `+` instead of backquote.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Pass the view around instead of using an ivar
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
If we pass the view instance around it's easier to understand the flow
control.
|
| |/ / / / /
|/| | | | | |
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
activerecord: Fix statement cache for strictly cast attributes
|
|/ / / / / |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Subdomains of localhost are safe against DNS rebinding
|
| | |/ / /
| |/| | | |
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
Fix attribute typo in ActionCable connection test request
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Corrected spelling of ActionCable::Connection::TestCase [ci skip]
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Revert ensure external redirects are explicitly allowed
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix NumericalityValidator on object responding to `to_f`:
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- 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.
|
|\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | | |
MySQL 8.0.14 adds `ER_FK_INCOMPATIBLE_COLUMNS`
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Actionpack typo fixes.
|
| | |_|/ / /
| |/| | | |
| | | | | |
| | | | | | |
2. Typo fixes.
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
Template Handler Refactoring
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
We always want to include this module. It'll be used in production
(maybe)
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This patch removes the instance writer of view_context_class.
Subclasses may override it, but it doesn't need to be written. This
also eliminates the need to cache the return value of the class level
`view_context_class` method.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
It's always called with 0 params, so just remove the parameter
|
| | | | | | |
|