| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
There is test in has_one to test enum, but there is no for has_many.
[Rich Chen]
|
|\
| |
| | |
Follow up #33659
|
| |
| |
| |
| | |
Test `assert_no_broadcasts` failure
|
| |
| |
| |
| | |
See `git grep "= Logger.new(nil)"`
|
| | |
|
| |
| |
| |
| | |
Remove extra `:nodoc:` comment since private methods doesn't require that.
|
| |
| |
| |
| | |
`Topic` isn't loaded in this test file.
|
|\ \
| | |
| | | |
Use string lengths instead of regexp to extract path
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The regexp was introduced in 186ac4cdaa911a9af659a29f2179a19b99dea13b,
and looks cosmetic. While they should be functionally identical in
theory, in practice, case insensitive (but preserving) filesystems can
give results that are differently-cased from the pattern we supplied.
I don't know how to force the filesystem to do the surprising thing,
even when running in an environment that _could_, so no new test.
|
|\ \ \
| | | |
| | | | |
Omit BEGIN/COMMIT statements for empty transactions
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
If a transaction is opened and closed without any queries being run, we
can safely omit the `BEGIN` and `COMMIT` statements, as they only exist
to modify the connection's behaviour inside the transaction. This
removes the overhead of those statements when saving a record with no
changes, which makes workarounds like `save if changed?` unnecessary.
This implementation buffers transactions inside the transaction manager
and materializes them the next time the connection is used. For this to
work, the adapter needs to guard all connection use with a call to
`materialize_transactions`. Because of this, adapters must opt in to get
this new behaviour by implementing `supports_lazy_transactions?`.
If `raw_connection` is used to get a reference to the underlying
database connection, the behaviour is disabled and transactions are
opened eagerly, as we can't know how the connection will be used.
However when the connection is checked back into the pool, we can assume
that the application won't use the reference again and reenable lazy
transactions. This prevents a single `raw_connection` call from
disabling lazy transactions for the lifetime of the connection.
|
|\ \ \ \
| |_|_|/
|/| | | |
Use `say`/`error` instead of `puts`/`$stderr.puts`
|
| | | |
| | | |
| | | |
| | | | |
Follow up 44007c07098a3c633180881cae9285da4622e63f
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
cbothner/fail-gracefully-from-activestorage-file-not-found
Fail more gracefully from ActiveStorage missing file exceptions
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
`ActiveStorage::DiskController#show` generates a 404 Not Found response when
the requested file is missing from the disk service. It previously raised
`Errno::ENOENT`.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
`ActiveStorage::Blob#download` and `ActiveStorage::Blob#open` raise
`ActiveStorage::FileNotFoundError` when the corresponding file is missing
from the storage service. Services translate service-specific missing
object exceptions (e.g. `Google::Cloud::NotFoundError` for the GCS service
and `Errno::ENOENT` for the disk service) into
`ActiveStorage::FileNotFoundError`.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* Include form_with in form_helpers rails guide
* Include form_tag and form_for footnote
* Id and class attributes are not wrapped anymore
* Include note that all form_with forms are remote:true by default
* Underline most common use case of form_with is with arguments
* Form_with no longer accepts multiple hashes in form helper calls
* Review final sections
* Revert extra documentation
* Remove unnecessary link
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Remove extra execution of `uniq!` on action_methods
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Execution of `to_set` below should remove duplicated elements.
Follow up #33693
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
Update ParameterFilter to yield original parameters
|
| | |/ / /
| |/| | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Two fewer array allocations on action_methods
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Instead of creating new arrays for `uniq` and `map` we can instead modify the array in place.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Fix `rails initializers --help` and `rails dev:cache --help`
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- `rails initializers --help` should show description set by `desc`
See railties/lib/rails/command/base.rb:27
- Fix `rails dev:cache --help`
```
Traceback (most recent call last):
10: from bin/rails:4:in `<main>'
9: from bin/rails:4:in `require'
8: from /work/rails/railties/lib/rails/commands.rb:18:in `<top (required)>'
7: from /work/rails/railties/lib/rails/command.rb:46:in `invoke'
6: from /work/rails/railties/lib/rails/command/base.rb:65:in `perform'
5: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
4: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
3: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
2: from /work/rails/railties/lib/rails/command/base.rb:150:in `help'
1: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:170:in `command_help'
/home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/base.rb:497:in `handle_no_command_error': Could not find command "dev". (Thor::UndefinedCommandError)
```
Context https://github.com/rails/rails/pull/33694#issuecomment-415127304
Would be great to set a description to other commands.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Added explanation about new_framework_defaults.rb file [ci skip]
|
| | | | | | | |
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| |_|/ / / / /
|/| | | | | | |
Remove `rake initializers` from rake tasks list
|
|/ / / / / /
| | | | | |
| | | | | |
| | | | | | |
Context https://github.com/rails/rails/pull/33631#discussion_r210732565
|
|\ \ \ \ \ \
| |_|/ / / /
|/| | | | | |
Stop using Mocha
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
_Q.E.F._
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Six Mocha calls prove quite resistant to Minitestification. For example,
if we replace
```
ActiveRecord::Associations::HasManyAssociation
.any_instance
.expects(:reader)
.never
```
with `assert_not_called`, Minitest wisely raises
```
NameError: undefined method `reader' for class `ActiveRecord::Associations::HasManyAssociation'
```
as `:reader` comes from a deeply embedded abstract class,
`ActiveRecord::Associations::CollectionAssociation`.
This patch tackles this difficulty by adding
`ActiveSupport::Testing::MethodCallAsserts#assert_called_on_instance_of`
which injects a stubbed method into `klass`, and verifies the number of
times it is called, similar to `assert_called`. It also adds a convenience
method, `assert_not_called_on_instance_of`, mirroring
`assert_not_called`.
It uses the new method_call_assertions to replace the remaining Mocha
calls in `ActiveRecord` tests.
[utilum + bogdanvlviv + kspath]
|
| | |_|/ /
| |/| | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
This was introduced at 24f6bf0d96b58f2b2ef6a886c93d35cf8ce4f293.
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
Add database configuration to disable advisory locks.
|
| | | | |
| | | | |
| | | | |
| | | | | |
https://github.com/rails/rails/issues/31190
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | | |
Use public_send in value_for_collection
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Test that using private methods in `options_from_collection_for_select`
is deprecated.
Make the unused `secret` paramether in the `Post` Struct private to use
it in the test.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Instead of dropping it completely in case someone is relying (probably
inadvertenly) on it.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Avoid exposing private methods in view's helpers. However, as
`extract_values_from_collection` is only called from
`options_from_collection_for_select` where `value_for_collection` is
previously called, this case was already covered. The change makes
anyway sense for consistency and in case the code changes in the
future.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Avoid exposing private methods in view's helpers.
Fixes https://github.com/rails/rails/issues/33546
|
|\ \ \ \ \ \
| |_|/ / / /
|/| | | | | |
[WIP] Action cable testing
|
| | | | | | |
|
| | | | | | |
|
| |_|_|/ /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This patch corrects a duplicate method name introduced in #33635.
Also fixes typo in method names.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
[ci skip] Add ImageMagick to Brewfile
|
|/ / / / /
| | | | |
| | | | |
| | | | | |
In order to run ActiveStorage's tests successfully, you need imagemagick
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
[ci skip]
It seems to need an escape for the showing `ENV`.
https://api.rubyonrails.org/classes/AbstractController/Caching/Fragments.html#method-i-combined_fragment_cache_key
|