To prevent errors from being raise in environments where credentials is unnecessary.
Context: https://github.com/rails/rails/issues/31283#issuecomment-348801489
Fixes #31283
I found assert_in_epsilon is not be in "2.4 Available Assertions".
So I Added them.
https://github.com/seattlerb/minitest/blob/master/lib/minitest/assertions.rb#L204-L2…
It seems that it raise error on example code in ActiveJob::Core.
Before:
class DeliverWebhookJob < ActiveJob::Base
def serialize
super.merge('attempt_number' => (@attempt_number || 0) + 1)
end
def deseria...
In previous versions of Rails, running rails new app_name; cd app_name; rails server
was all it took to see something up and running in your browser at localhost:3000.
This had a great impact on newcomers, who would get excited abo…
With the current code, a failing test shows this error, which is missing
the number of times called and has two periods at the end.
/railties$ be ruby -Itest test/generators/app_generator_test.rb -n test_active_storage_install
...
When loading schema cache, fetch current migration version.
However, if database does not exist, connection acquisition will cause an error. This is a problem when create database.
When databas is not yet, schema cache is unnecessary, …
# Before:
Rails.application.routes.draw do
get 'account/bar'
end
# After:
Rails.application.routes.draw do
get 'account/bar'
end
I think it would be better to use quote method for SQL statements, because an evaluation of quote varies depending on the RDBMS.
Example code:
"INSERT INTO #{ActiveRecord::Base.connection.quote_table_name('schema_migra...
This quiet the following log.
create app/mailers/notifier_mailer.rb
invoke erb
create app/views/notifier_mailer
identical app/views/layouts/mailer.text.erb
identical app/views/layouts/mailer.html.erb
c...
Hash#compact of Ruby native returns new hash.
Therefore, in order to return HWIDA as in the past version, need to
define own #compact to HWIDA.
Related: #26868
Rails::LineFiltering is not automatically loaded, need to load it explicitly.
Ref: 797f1dd, b6f935b
This PR is backporting of https://github.com/rails/rails/commit/fd87169eb11fc4cfd9082dabe0a85f3bfa385c29.
Here's an alternative implementation of Array#sum.
Current Array#sum unwantedly exposes our own internal orig_sum method to the outside world.
Ruby 2's probably most unused new feature "Refinements" is provided exactly for this…
$ git grep namespaced_file_path
railties/lib/rails/generators/named_base.rb: def namespaced_file_path
railties/lib/rails/generators/named_base.rb: @namespaced_file_path ||= namespaced_class_path.join("/")
This fixes the following warning.
Expected boolean default value for '--rc'; got "~/.railsrc" (string)
This fixes the following warning.
test/caching_test.rb:986: warning: parentheses after method name is interpreted as
test/caching_test.rb:986: warning: an argument list, not a decomposed argument
test/cases/adapters/mysql2/re...
This fixes the following error when executing rails new command.
(erb):9:in `block in template': undefined method `comment' for nil:NilClass (NoMethodError)
Follow up to #27288