rails 5.2.2
Active Support
-
Fix bug where
#to_optionsforActiveSupport::HashWithIndifferentAccesswould not act as alias for#symbolize_keys.Nick Weiland
-
Improve the logic that detects non-autoloaded constants.
Jan Habermann, Xavier Noria
-
Fix bug where
URI.unescapewould fail with mixed Unicode/escaped character input:URI.unescape("\xe3\x83\x90") # => "バ" URI.unescape("%E3%83%90") # => "バ" URI.unescape("\xe3\x83\x90%E3%83%90") # => Encoding::CompatibilityErrorAshe Connor, Aaron Patterson
Active Model
-
Fix numericality validator to still use value before type cast except Active Record.
Fixes #33651, #33686.
Ryuta Kamizono
Active Record
-
Do not ignore the scoping with query methods in the scope block.
Ryuta Kamizono
-
Allow aliased attributes to be used in
#update_columnsand#update.Gannon McGibbon
-
Allow spaces in postgres table names.
Fixes issue where "user post" is misinterpreted as ""user"."post"" when quoting table names with the postgres adapter.
Gannon McGibbon
-
Cached columns_hash fields should be excluded from ResultSet#column_types
PR #34528 addresses the inconsistent behaviour when attribute is defined for an ignored column. The following test was passing for SQLite and MySQL, but failed for PostgreSQL:
class DeveloperName < ActiveRecord::Type::String def deserialize(value) "Developer: #{value}" end end class AttributedDeveloper < ActiveRecord::Base self.table_name = "developers" attribute :name, DeveloperName.new self.ignored_columns += ["name"] end developer = AttributedDeveloper.create developer.update_column :name, "name" loaded_developer = AttributedDeveloper.where(id: developer.id).select("*").first puts loaded_developer.name # should be "Developer: name" but it's just "name"Dmitry Tsepelev
-
Values of enum are frozen, raising an error when attempting to modify them.
Emmanuel Byrd
-
update_columnsnow correctly raisesActiveModel::MissingAttributeErrorif the attribute does not exist.Sean Griffin
-
Do not use prepared statement in queries that have a large number of binds.
Ryuta Kamizono
-
Fix query cache to load before first request.
Eileen M. Uchitelle
-
Fix collection cache key with limit and custom select to avoid ambiguous timestamp column error.
Fixes #33056.
Federico Martinez
-
Fix duplicated record creation when using nested attributes with
create_with.Darwin Wu
-
Fix regression setting children record in parent
before_savecallback.Guo Xiang Tan
-
Prevent leaking of user's DB credentials on
rails db:createfailure.bogdanvlviv
-
Clear mutation tracker before continuing the around callbacks.
Yuya Tanaka
-
Prevent deadlocks when waiting for connection from pool.
Brent Wheeldon
-
Avoid extra scoping when using
Relation#updatethat was causing this method to change the current scope.Ryuta Kamizono
-
Fix numericality validator not to be affected by custom getter.
Ryuta Kamizono
-
Fix bulk change table ignores comment option on PostgreSQL.
Yoshiyuki Kinjo
Action View
- No changes.
Action Pack
-
Reset Capybara sessions if failed system test screenshot raising an exception.
Reset Capybara sessions if
take_failed_screenshotraise exception in system testafter_teardown.Maxim Perepelitsa
-
Use request object for context if there's no controller
There is no controller instance when using a redirect route or a mounted rack application so pass the request object as the context when resolving dynamic CSP sources in this scenario.
Fixes #34200.
Andrew White
-
Apply mapping to symbols returned from dynamic CSP sources
Previously if a dynamic source returned a symbol such as :self it would be converted to a string implicity, e.g:
policy.default_src -> { :self }would generate the header:
Content-Security-Policy: default-src selfand now it generates:
Content-Security-Policy: default-src 'self'Andrew White
-
Fix
rails routes -cfor controller name consists of multiple word.Yoshiyuki Kinjo
-
Call the
#redirect_toblock in controller context.Steven Peckins
Active Job
-
Make sure
assert_enqueued_with()&assert_performed_with()work reliably with hash arguments.Sharang Dashputre
-
Restore
ActionController::Parameterssupport toActiveJob::Arguments.serialize.Bernie Chiu
-
Restore
HashWithIndifferentAccesssupport toActiveJob::Arguments.deserialize.Gannon McGibbon
-
Include deserialized arguments in job instances returned from
assert_enqueued_withandassert_performed_withAlan Wu
-
Increment execution count before deserialize arguments.
Currently, the execution count increments after deserializes arguments. Therefore, if an error occurs with deserialize, it retries indefinitely.
Yuji Yaginuma
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
-
Support multiple submit buttons in Active Storage forms.
Chrıs Seelus
-
Fix
ArgumentErrorwhen uploading to amazon s3Hiroki Sanpei
-
Add a foreign-key constraint to the
active_storage_attachmentstable for blobs.George Claghorn
-
Discard
ActiveStorage::PurgeJobsfor missing blobs.George Claghorn
-
Fix uploading Tempfiles to Azure Storage.
George Claghorn
Railties
-
Disable content security policy for mailer previews.
Dylan Reile
-
Log the remote IP address of clients behind a proxy.
Atul Bhosale