| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue #27852 reports that when `rails db:create` fails, it causes
leaking of user's DB credentials to $stderr.
We print a DB's configuration hash in order to help users more quickly
to figure out what could be wrong with his configuration.
This commit changes message from
"Couldn't create database for #{configuration.inspect}" to
"Couldn't create '#{configuration['database']}' database. Please check your configuration.".
There are two PRs that fixing it #27878, #27879, but they need a bit more work.
I decided help to finish this and added Author of those PRs credit in this commit.
Since it is a security issue, I think we should backport it to
`5-2-stable`, and `5-1-stable`.
Guided by https://edgeguides.rubyonrails.org/maintenance_policy.html#security-issues
Fixes #27852
Closes #27879
Related to #27878
[Alexander Marrs & bogdanvlviv]
|
|\
| |
| | |
Finish converting whitelist and blacklist references
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In the system test template, enter a value based on label.
However, since `label` method does not use `titleize` by default.
If generate a value including underscore, cannot find a label and the test
will fail.
```
$ ./bin/rails g scaffold user name:string phone_number:string
$ ./bin/rails t test/system/users_test.rb
E
Error:
UsersTest#test_creating_a_User:
Capybara::ElementNotFound: Unable to find field "Phone Number"
test/system/users_test.rb:18:in `block in <class:UsersTest>'
```
This removes unnecessary `titleize` so that the generated file will pass
even if the attribute contains an underscore.
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Use the HTTPS protocol for links to Edges Guides [ci skip]
|
| | |
| | |
| | |
| | | |
Edges Guides is now available in HTTPS, it would be better to use the HTTPS protocol directly.
|
|\ \ \
| |/ /
|/| | |
Mutation tracker should be cleared before continuing around callbacks
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`changes_applied` should be called before continuing around callback
chain. Otherwise the mutation tracker returns old value for methods like
`changed`? or `id_in_database` in around callbacks. Also methods depend
on `id_in_database`, like `update_column`, are not working in
`around_create` callbacks.
```
class Foo < ActiveRecord::Base
around_create :around_create_callback
def around_create_callback
...
yield
p id_in_database # => nil
update_column(:generated_column, generate_value) # silently fails
end
...
end
```
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Update the comments for TimeWithZone subtraction
While reading the description/documentation comments for the subtraction method, it was confusing. While in practical usage, the returned values make sense. It seems as though the explanation could be a bit clearer.
* Removed erroneous closing parenthesis
[ci skip]
[Rob Race + Ryuta Kamizono]
|
|\ \ \
| |/ /
|/| | |
Fix numericality validator to still use value before type cast except Active Record
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Record
The purpose of fe9547b is to work type casting to value from database.
But that was caused not to use the value before type cast even except
Active Record.
There we never guarantees that the value before type cast was going to
the used in this validation, but we should not change the behavior
unless there is some particular reason.
To restore original behavior, still use the value before type cast if
`came_from_user?` is undefined (i.e. except Active Record).
Fixes #33651.
Fixes #33686.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Call block to #redirect_to in controller context
The documentation for ActionController::Redirecting states that a Proc
argument "will be executed in the controller's context." However,
unless #instance_eval is used (removed in 6b3ad0ca), that statement is
false for procs defined outside of the controller instance.
This commit restores the documented behavior.
Fixes #33731.
* Move test proc into a constant in another class
Per @rafaelfranca's suggestion.
[Steven Peckins + Rafael Mendonça França]
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Add documentation for `:collation` option
The table definition supports a `:collation` option for string and text columns, but this is not documented anywhere that I could find.
I'm not sure if the "If not specified" part is accurate. From [this PR](https://github.com/rails/rails/commit/1515c4d98da3f730ef971fa5a13cad828bd9bef4), it looks like it passes `nil` and lets the database handle the collation, but I'm happy to change it if I misread the code.
[ci skip]
* FIX remove whitespace
[Nate Pinsky + Rafael Mendonça França]
|
|\ \ \
| | | |
| | | | |
Update "Action View Form Helpers" guide
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
Follow up #33523 [ci skip]
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit is the next work after #33523.
Also, this commit removes mention about hidden `utf8` input. Since
form helpers don't generate this input by default since #32125.
Note that I also had created PR #31972 with improvements to
"Action View Form Helpers" guide, but I'll rebase it after merging the
current PR.
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Clarify example of the test [ci skip]
|
|/ / / /
| | | |
| | | | |
ActionDispatch::TestProcess::FixtureFile
|
|\ \ \ \
| |/ / /
|/| | | |
Add test case to test enum in has_many
|
| |/ /
| | |
| | |
| | |
| | |
| | | |
There is test in has_one to test enum, but there is no for has_many.
[Rich Chen]
|
|\ \ \
| | | |
| | | | |
Format respond_to method as code in doc [ci skip]
|
|/ / /
| | |
| | |
| | |
| | | |
This updates the `respond_to` method to be code formatted rather than
plain text (as it refers to the method)
|
| |/
|/|
| |
| |
| |
| |
| |
| | |
Because there are tests that fail due to the influence of the
`async_exec` deprecate message.
https://travis-ci.org/rails/rails/jobs/420345370
Related to #33188.
|
|\ \
| | |
| | | |
Handle only specifically relevant Azure HTTPErrors ActiveStorage::Service::AzureStorageService#upload and #delete
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
The Azure gem uses `Azure::Core::Http::HTTPError` for everything:
checksum mismatch, missing object, network unavailable, and many more.
(https://www.rubydoc.info/github/yaxia/azure-storage-ruby/Azure/Core/Http/HTTPError).
Rescuing that class obscures all sorts of configuration errors. We
should check the type of error in those rescue blocks, and reraise when
needed.
|
| |
| |
| |
| |
| |
| |
| | |
cbothner/azure-service-swallowing-all-errors"
This reverts commit b204d167c5cfebd59f771d406178e371811ac43a, reversing
changes made to de6a200f82a3de399fa685d583503bc88dbc5e9f.
|
|\ \
| | |
| | | |
Handle only specifically relevant Azure HTTPErrors in ActiveStorage::Service::AzureStorageService
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
The Azure gem uses `Azure::Core::Http::HTTPError` for everything:
checksum mismatch, missing object, network unavailable, and many more.
(https://www.rubydoc.info/github/yaxia/azure-storage-ruby/Azure/Core/Http/HTTPError).
Rescuing that class obscures all sorts of configuration errors. We
should check the type of error in those rescue blocks, and reraise when
needed.
|
|\ \
| | |
| | | |
[ci skip] change all instances of blacklist and whitelist to denylist…
|
| | |
| | |
| | |
| | | |
restricted list and consistently use permitted
|
| | | |
|
| | |
| | |
| | |
| | | |
allowlist
|
| | | |
|
| | |
| | |
| | |
| | | |
allowlist
|
|\ \ \
| |_|/
|/| | |
Prevent deadlocks when waiting for connection from pool.
|
| | |
| | |
| | |
| | |
| | | |
When a thread that had the load interlock but was blocked waiting to check a connection out of the connection pool but all of the threads using the available connections were blocked waiting to obtain the load interlock an `ActiveRecord::ConnectionTimeoutError` exception was be thrown by the thread waiting for the connection.
When waiting for the connection to check out we should allow loading to proceed to avoid this deadlock.
|
|\ \ \
| | | |
| | | | |
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.
|