| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
Using `included` to define `attr_acessor` and `attr_writer` is causing
these methods to not show up in the documentation.
|
|\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | | |
Add documentation to run tests with specific seed [ci skip]
|
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | | |
This commit documents how to run all tests or a single test file with a
specific randomization seed.
|
|\ \ \ \ \ \ \ \ \ \ \ \
| |_|_|_|_|_|_|_|/ / / /
|/| | | | | | | | | | | |
Remove bundler warnings from bin/setup output
|
| |/ / / / / / / / / / |
|
|\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | | |
Parameterized mailers can configure delivery job
|
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | | |
Setting parameterized_delivery_job on a mailer class will cause Parameterized::MessageDelivery to use
the specified job instead of ActionMailer::Parameterized::DeliveryJob:
class MyMailer < ApplicationMailer
self.parameterized_delivery_job = MyCustomDeliveryJob
...
end
|
|\ \ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | |
| | | | | | | | | | | | | |
Remove some autolabeling globs
|
| | |/ / / / / / / / / /
| |/| | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | | |
[ci skip]
|
|/ / / / / / / / / / / |
|
|\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | | |
prathamesh-sonpatki/exclude-node-modules-for-rubocop
Skip node_modules dir in the rubocop check
|
|/ / / / / / / / / / /
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
- Otherwise it is running the check against all files in node_modules
|
|\ \ \ \ \ \ \ \ \ \ \
| |/ / / / / / / / / /
|/| | | | | | | | | | |
Fix tests related to new JavaScript path for generators
|
| | |_|_|_|_|_|_|/ /
| |/| | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
- Followup of https://github.com/rails/rails/commit/4838c1716a0340137d858fab49bf460e23be5a4b
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
23% faster Nil#try
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
is passed:
```ruby
class FooNew
def try(method_name = nil, *args)
nil
end
end
class FooOld
def try(*args)
nil
end
end
require 'benchmark/ips'
foo_new = FooNew.new
foo_old = FooOld.new
Benchmark.ips do |x|
x.report("new") { foo_new.try(:anything) }
x.report("old") { foo_old.try(:anything) }
x.compare!
end
# Warming up --------------------------------------
# new 250.633k i/100ms
# old 232.322k i/100ms
# Calculating -------------------------------------
# new 6.476M (± 4.8%) i/s - 32.332M in 5.005777s
# old 5.258M (± 3.2%) i/s - 26.485M in 5.042589s
# Comparison:
# new: 6476002.5 i/s
# old: 5257912.5 i/s - 1.23x slower
```
It's worth noting that checking for nil separately as in https://github.com/rails/rails/pull/34067 seems to be MUCH faster. It might be worth it to apply a blanket `&.` to every internal `try` call.
|
|\ \ \ \ \ \ \ \ \ \ \
| |_|/ / / / / / / / /
|/| | | | | | | | | | |
Exercise stringify of database configurations
|
|/ / / / / / / / / /
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Since #33968 we stringify keys of database configuration
This commit adds more assertions in order to ensure that and prevent any
regression in the future.
Currently, if remove `to_s` added in #33968 from `env_name.to_s` on the
line
(activerecord/lib/active_record/database_configurations.rb:107), there is
no test that would fail. One of the added assertions should emphasize why we need
this `to_s`.
Follow up #33968
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Add retry_on/discard suggestions for common cases to ApplicationJob for new apps.
|
|/ / / / / / / / / /
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
This adds the same suggestions added here:
https://github.com/rails/rails/blob/01a69e27a4e55504af8fe776826d659550e6f89e/activejob/lib/rails/generators/job/templates/application_job.rb
These appear when `app/jobs/application_job.rb` doesn't exist, but not
for new applications.
|
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Since this is a test to check the behavior of `load_defaults`,
webpacker is unnecessary.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
encrypted files (#34014)
* Fix reading comment only encrypted files
When a encrypted file contains only comments then reading that files raises an error:
NoMethodError: undefined method `deep_symbolize_keys' for false:FalseClass
activesupport/lib/active_support/encrypted_configuration.rb:33:in `config'
test/encrypted_configuration_test.rb:52:in `block in <class:EncryptedConfigurationTest>'
This happens because the previous implementation returned a `{}` fallback for blank YAML strings. But it did not handle YAML strings that are present but still do not contain any _usefull_ YAML - like the file created by `Rails::Generators::EncryptedFileGenerator` which looks like this:
# aws:
# access_key_id: 123
# secret_access_key: 345
* Fix coding style violation
* Add backwardscompatible with Psych versions that were shipped with Ruby <2.5
* Do not rely on railties for Active Support test
* Simplify error handling
* Improve test naming
* Simplify file creation in test
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Wrap custom id of a header attribute into \" in rails guides
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
Related to https://github.com/rails/rails/pull/33953
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
Follow up 811be477786455d144819a5e9fbb7f9f54b8da69.
|
| |_|_|/ / / / / / /
|/| | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
`test_update_does_not_run_sql_if_record_has_not_changed` would pass
without #18501 since `assert_queries` ignores BEGIN/COMMIT unless
`ignore_none: true` is given.
Since #32647, empty BEGIN/COMMIT is ommited. So we no longer need to use
`assert_queries(0)` to ignore BEGIN/COMMIT in the queries.
|
| | | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
schneems/schneems/revert-7f870a5ba2aa9177aa4a0e03a9d027928ba60e49
Revert "Merge pull request #33970 from rails/eager-url-helpers"
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
Until #34050 can be resolved
This reverts commit 7f870a5ba2aa9177aa4a0e03a9d027928ba60e49, reversing
changes made to 6556898884d636c59baae008e42783b8d3e16440.
|
| |_|_|_|_|_|/ / / /
|/| | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Since the above comment is for the `preloaders_for_one`.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
cherry-picked from https://github.com/rails/rails/pull/33763
|
|\ \ \ \ \ \ \ \ \ \
| |_|_|_|_|_|_|_|/ /
|/| | | | | | | | | |
ActiveRecord::Associations::Preloader should not fail to preload through missing records
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
missing records
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Escape table name so that it can be used in regular expression
|
|/ / / / / / / / / / |
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Remove unreachable database warning
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
`establish_connection` will never raise `ActiveRecord::NoDatabaseError`,
because it doesn't connect to a database; it sets up a connection pool.
|
|\ \ \ \ \ \ \ \ \ \ \
| |/ / / / / / / / / /
|/| | | | | | | | | | |
Decrease memory allocations in cache.rb
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
The `merged_options` method is private and the output is never mutated.
Using this info we can get rid of the `dup` behavior. We can also
eliminate the `merge` call in the case where all the options being merged are the same.
Returned results are frozen as an extra layer of protection against
mutation.
Before
```
Total allocated: 741749 bytes (6642 objects)
```
After
```
Total allocated: 734039 bytes (6648 objects)
```
Diff
```
(741749 - 734039) / 741749.0 => ~ 1.0 %
```
If you don't feel comfortable modifying this method, we could rename it
and only use it internally.
|
| |_|/ / / / / / / /
|/| | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Fix the LoggerSilence to work as described:
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
- Following the Rails guide which state that a logger needs to include
the `ActiveSupport::LoggerSilence` as well as
`ActiveSupport::LoggerThreadSafe` modules isn't enough and won't
work.
Here is a test cases with 3 tests that all fails
https://gist.github.com/Edouard-chin/4a72930c2b1eafbbd72a80c66f102010
The problems are the following:
1) The logger needs to call `after_initialize` in order to setup
some instance variables.
2) The silence doesn't actually work because the bare ruby Logger
`add` method checks for the instance variable `@logger`. We need to
override the `add` (like we used to in the ActiveSupport::Logger
class).
3) Calling `debug?` `info?` etc... doesn't work as the bare ruby
methods will check for the instance variable. Again we need to
override this methods (like we used to in the ActiveSupport::Logger
class)
The LoggerSilence won't work without LoggerThreadSafe, but the later
is not public API, the user shouldn't have to include it so I
modified to include it automatically.
Same for the `after_initialize` method. I find unuintitive to have
to call it directly. I modified to instance the variables when the
module get included.
|
|\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | | |
Fix rubocop issue
|
| | |_|_|/ / / / / / /
| |/| | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
Fixes: `Layout/TrailingWhitespace: Trailing whitespace detected.
See https://codeclimate.com/github/rails/rails/issues
Releted to b707a6d0eb7
|
|\ \ \ \ \ \ \ \ \ \ \
| |/ / / / / / / / / /
|/| | | | | | | | | | |
Move test_fixtures and render_context to separate files
|
|/ / / / / / / / / / |
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
- Followup of https://github.com/rails/rails/pull/34051
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
the document has been disappeared since the method became private at c2bfe6cbc8cab9caeab418472a1e12a3ed3e75e2
|
| |_|_|_|_|_|_|_|/
|/| | | | | | | | |
|