- 12 3月, 2020 6 次提交
-
-
由 Rafael França 提交于
Disable colorize logging of SQL and reduce unnecessary invocation of sql_color matching
-
由 Rafael França 提交于
Removed unnecessary require 'core_ext/numeric/time'.
-
由 Madogiwa 提交于
Previously it depended on `core_ext/numeric/time`, but now it doesn't, so we removed require. Previous code ``` ruby class Integer def months ActiveSupport::Duration.new(self * 30.days, [[:months, self]]) end alias :month :months def years ActiveSupport::Duration.new(self * 365.25.days, [[:years, self]]) end alias :year :years end ``` Now the code ``` ruby class Integer def months ActiveSupport::Duration.months(self) end alias :month :months def years ActiveSupport::Duration.years(self) end alias :year :years end ```
-
由 Rafael França 提交于
Updates to ActiveJob::Exceptions.retry_on with jitter documentation [skip ci]
-
由 Rafael França 提交于
AJ `perform_enqueued_jobs` shouldn't perform job retries:
-
由 Aditya Narsapurkar 提交于
- Changelog updated - Method documentation updated
-
- 11 3月, 2020 5 次提交
-
-
由 Abhay Nikam 提交于
When the `colorize_logging` is disabled, logs do not colorize the SQL queries. But the `sql_color` method is always invoked which due to regex matching results in slow queries. This PR fixes #38685 and removes unnecessary invokation of `sql_color` method when `colorize_logging` is disabled
-
由 Rafael França 提交于
[skip ci] How to run Action View and Action Pack unit test in serial
-
由 Rafael França 提交于
Fix exceptions raised/rescued in dev by IPAddr
-
由 Nate Berkopec 提交于
Putting ".localhost" at the end causes 4 IPAddr::InvalidAddressError exceptions to be raised and rescued during every request when the HostAuthorization middleware attempts to compare an IPAddr with a "localhost" string.
-
由 Dino Maric 提交于
This PR adds `image/webp` to the default array of variable content types. Without this commit if we want to "handle" webp images overwriting `config.active_storage.variable_content_types` was necessary.
-
- 10 3月, 2020 9 次提交
-
-
由 Yasuo Honda 提交于
Follow up #38613 and #38094 Action View and Action Pack unit tests run in parallel by default and the number of parallel workers is defined by `PARALLEL_WORKERS` value. To investigate some random failures with SEED, Disabling Parallel testing sometimes helps to isolate these failures.
-
由 Ryuta Kamizono 提交于
-
由 Rafael França 提交于
Clarify index_by and index_with docs [ci skip]
-
由 Edouard CHIN 提交于
- ### Problem If we use `perform_enqueued_jobs` without a block, a job that uses a retry mechanism to reeenqueue itself would get performed right away. This behaviour make sense when using `perform_enqueued_jobs` with a block. However I'm expecting `perform_enqueued_jobs` without a block to perform jobs that are **already** in the queue not the ones that will get enqueued afterwards. ### Solution Dup the array of jobs given to avoid future mutation.
-
由 Edouard CHIN 提交于
- ### Problem If we use `perform_enqueued_jobs` without a block, a job that raises an error wouldn't be appended to the list of `performed_jobs`. ### Solution Push the job in the array before it is actually performed.
-
由 Eugene Kenny 提交于
Make it clearer how the key and value are derived in both cases, and use the same sentence structure so that it's easier understand one method in terms of the other. Also add an example of passing a default value to `index_with`.
-
由 Rafael França 提交于
Stop recommending RailsInstaller in favor of RubyInstaller
-
由 Eileen M. Uchitelle 提交于
Refactor schema migration on connection
-
- 09 3月, 2020 1 次提交
-
-
由 eileencodes 提交于
This method was jumping through extra hoops to find the name of the class the connection is stored on when we can get it from the connection itself. Since we already have the connection we don't need to loop through the pools. In addition, this was using the wrong class name. The class name for the schema migration should come from the connection owner class, not from the `db_config.name`. In this case, `db_config.name` is the name of the configuration in the database.yml. Rails uses the class name to lookup connections, not the db config name, so we should be consistent here. While working on this I noticed that we were generating an extra schema migration class for `ActiveRecord::Base`. Since `ActiveRecord::Base` can and should use the default and we don't want to create a new one for single db applications, we should skip creating this if the spec name is `ActiveRecord::Base`. I added an additional test that ensures the class generation is correct.
-
- 08 3月, 2020 1 次提交
-
-
由 Atul Bhosale 提交于
Add method ActionCable::Channel#stream_or_reject_for to stream if record is present, otherwise reject the connection (#38375)
-
- 07 3月, 2020 6 次提交
-
-
由 Eileen M. Uchitelle 提交于
Remove owner_name
-
由 eileencodes 提交于
We don't actually need this since the only reason it exists is to pass the owning class name down to the `handler`. This removes a level of indirection and an unnecessary accessor on db_config. db_config shouldn't have to know what class owns it, so we can just remove this and pass it to the handler. The Symbol case is needed to preserve current behavior. This doesn't need a changelog because it's changing un-released behavior. Co-authored-by: NJohn Crepezzi <john.crepezzi@gmail.com>
-
由 Eileen M. Uchitelle 提交于
Remove unnecessary creation of new hash config
-
由 eileencodes 提交于
This line was creating a new hash config, but we should always have a hash config to lookup at this point. Previously we needed this code because the pool name was merged into the hash. Now it's an accessor on the db_config, so we have no reason to create a new hash config. Also, change env_name to name since it's only an env in a single db application or an application with no arguments for establish_connection.
-
由 eileencodes 提交于
`config_or_env` can only be `nil` if called by `establish_connection`. If `connects_to` had a `connects_to database: { writing: nil }` that would make no sense. This is a really minor refactoring that moves the assignment if `nil` into the only method that can actually receive nil. Then `resolve_config_for_connection` will never get nil passed to it.
-
由 eileencodes 提交于
If I had had these tests previously I would have not created PR #38658 and then promptly realize I needed to revert it. We need to load and parse the configurations twice. Once before the environment is loaded to create the named tasks and once after the environment is loaded to have the real configurations. The configs loaded before the env have the ERB stripped out and aren't valid configs.
-
- 06 3月, 2020 12 次提交
-
-
由 eileencodes 提交于
Wow this is embarrassing. I literally named this FIXME so I'd remember to give it some name that made sense and then I totally did not.
-
由 eileencodes 提交于
The key, value is `replica: true` not `readonly: true`. Fix the database configuration to be correct.
-
由 Eileen M. Uchitelle 提交于
Add tests for --master app_generator
-
由 Olivier Lacan 提交于
RailsInstaller is no longer maintained and its latest supported Ruby version is 2.3 which Rails no longer supports. In contrast, RubyInstaller supports Ruby 2.7, 2.6, 2.5, 2.4, 2.3, and 2.2 which are the only Ruby versions necessary for Rails 6.x and 5.x at this point. Fixes #38654 [ci skip]
-
由 Eileen M. Uchitelle 提交于
Revert "Merge pull request #38658 from eileencodes/refactor-for-each-…
-
由 eileencodes 提交于
This reverts commit 9a5bc246, reversing changes made to 227ff44e. I realized afterwards that this was written this way for a reason and it wasn't accidental. The databases loaded in `for_each` are not complete database configs because these are generated from the database yaml before the Rails env is loaded. So we actually do need to refetch the correct database configuration objects after we've loaded the Rails env.
-
由 Rafael Mendonça França 提交于
Closes #38648
-
由 Rafael França 提交于
Use optimized subclass of StringInquirer for Rails.env
-
These tests verify is added the entry into the Gemfile using `branch: "master"` for Rails and web-console from Github for :development
-
由 Charles Oliver Nutter 提交于
This adds a StringInquirer subclass EnvironmentInquirer that predefines the three default environments as query methods, in order to avoid dispatching through `method_missing` for every call to those methods. The original StringInquirer was not modified due to the side effects of having new env-related methods on it. This new class was not implemented using lazy method definition to avoid the open-ended possibility of defining a new method for all query calls. The three default environments should cover a high percentage of real-world uses, and users with custom environments could add their own to this class. Fixes #37803.
-
由 Eileen M. Uchitelle 提交于
Refactor for_each(databases) code
-
由 eileencodes 提交于
While working on something else I noticed this code was duplicated. It was returning `name` from `for_each` and then we'd have to lookup the `db_config` again from the `name` and `env`. We can instead just return `db_config` from `for_each` and clean up these tasks a little bit.
-