Open
Conversation
115e0de to
4c9b6aa
Compare
4c9b6aa to
7453aab
Compare
7453aab to
bea68e7
Compare
bea68e7 to
d609bab
Compare
d609bab to
38eda82
Compare
38eda82 to
1c30255
Compare
1c30255 to
7a45fe9
Compare
7a45fe9 to
a63f4a2
Compare
a63f4a2 to
d644957
Compare
d644957 to
25b2c85
Compare
25b2c85 to
8f8ea08
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
6.0.3->6.1.7Release Notes
rails/rails (@rails/ujs)
v6.1.7Compare Source
Active Support
Active Model
Active Record
Symbol is allowed by default for YAML columns
Étienne Barrié
Fix
ActiveRecord::Storeto serialize as a regular HashPreviously it would serialize as an
ActiveSupport::HashWithIndifferentAccesswhich is wasteful and cause problem with YAML safe_load.
Jean Boussier
Fix PG.connect keyword arguments deprecation warning on ruby 2.7
Fixes #44307.
Nikita Vasilevsky
Action View
Action Pack
Active Job
Action Mailer
Action Cable
Active Storage
Respect Active Record's primary_key_type in Active Storage migrations. Backported from 7.0.
fatkodima
Action Mailbox
Action Text
Railties
v6.1.6: 6.1.6Compare Source
Active Support
Fix and add protections for XSS in
ActionView::HelpersandERB::Util.Add the method
ERB::Util.xml_name_escapeto escape dangerous charactersin names of tags and names of attributes, following the specification of XML.
Álvaro Martín Fraguas
Active Model
Active Record
Action View
Fix and add protections for XSS in
ActionView::HelpersandERB::Util.Escape dangerous characters in names of tags and names of attributes in the
tag helpers, following the XML specification. Rename the option
:escape_attributesto:escape, to simplify by applying the option to thewhole tag.
Álvaro Martín Fraguas
Action Pack
Allow Content Security Policy DSL to generate for API responses.
Tim Wade
Active Job
Action Mailer
Action Cable
Active Storage
Action Mailbox
Action Text
Railties
v6.1.5: 6.1.5Compare Source
Active Support
Fix
ActiveSupport::Duration.buildto support negative values.The algorithm to collect the
partsof theActiveSupport::Durationignored the sign of the
valueand accumulated incorrect part values. Thisimpacted
ActiveSupport::Duration#sum(which is dependent onparts) butnot
ActiveSupport::Duration#eql?(which is dependent onvalue).Caleb Buxton, Braden Staudacher
Time#changeand methods that call it (eg.Time#advance) will nowreturn a
Timewith the timezone argument provided, if the caller wasinitialized with a timezone argument.
Fixes #42467.
Alex Ghiculescu
Clone to keep extended Logger methods for tagged logger.
Orhan Toy
assert_changesworks on includingActiveSupport::Assertionsmodule.Pedro Medeiros
Active Model
Clear secure password cache if password is set to
nilBefore:
user.password = 'something'
user.password = nil
user.password # => 'something'
Now:
user.password = 'something'
user.password = nil
user.password # => nil
Markus Doits
Fix delegation in
ActiveModel::Type::Registry#lookupandActiveModel::Type.lookupPassing a last positional argument
{}would be incorrectly considered as keyword argument.Benoit Daloze
Fix
to_jsonafterchanges_appliedforActiveModel::Dirtyobject.Ryuta Kamizono
Active Record
Fix
ActiveRecord::ConnectionAdapters::SchemaCache#deep_deduplicatefor Ruby 2.6.Ruby 2.6 and 2.7 have slightly different implementations of the
String#@​-method.In Ruby 2.6, the receiver of the
String#@​-method is modified under certain circumstances.This was later identified as a bug (https://bugs.ruby-lang.org/issues/15926) and only
fixed in Ruby 2.7.
Before the changes in this commit, the
ActiveRecord::ConnectionAdapters::SchemaCache#deep_deduplicatemethod, which internallycalls the
String#@​-method, could also modify an input string argument in Ruby 2.6 --changing a tainted, unfrozen string into a tainted, frozen string.
Fixes #43056
Eric O'Hanlon
Fix migration compatibility to create SQLite references/belongs_to column as integer when
migration version is 6.0.
reference/belongs_toin migrations with version 6.0 were creating columns asbigint instead of integer for the SQLite Adapter.
Marcelo Lauxen
Fix dbconsole for 3-tier config.
Eileen M. Uchitelle
Better handle SQL queries with invalid encoding.
Would cause all adapters to fail in a non controlled way in the code
responsible to detect write queries.
The query is now properly passed to the database connection, which might or might
not be able to handle it, but will either succeed or failed in a more correct way.
Jean Boussier
Ignore persisted in-memory records when merging target lists.
Kevin Sjöberg
Fix regression bug that caused ignoring additional conditions for preloading
has_manythrough relations.Fixes #43132
Alexander Pauly
Fix
ActiveRecord::InternalMetadatato not be broken byconfig.active_record.record_timestamps = falseSince the model always create the timestamp columns, it has to set them, otherwise it breaks
various DB management tasks.
Fixes #42983
Jean Boussier
Fix duplicate active record objects on
inverse_of.Justin Carvalho
Fix duplicate objects stored in has many association after save.
Fixes #42549.
Alex Ghiculescu
Fix performance regression in
CollectionAssocation#build.Alex Ghiculescu
Fix retrieving default value for text column for MariaDB.
fatkodima
Action View
preload_link_tagproperly insertsasattributes for files withimageMIMEtypes, such as JPG or SVG.
Nate Berkopec
Add
autocomplete="off"to all generated hidden fields.Fixes #42610.
Ryan Baumann
Fix
current_page?when URL has trailing slash.This fixes the
current_page?helper when the given URL has a trailing slash,and is an absolute URL or also has query params.
Fixes #33956.
Jonathan Hefner
Action Pack
Fix
content_security_policyreturning invalid directives.Directives such as
self,unsafe-evaland few others were notsingle quoted when the directive was the result of calling a lambda
returning an array.
With this fix the policy generated from above will now be valid.
Edouard Chin
Update
HostAuthorizationmiddleware to render debug info onlywhen
config.consider_all_requests_localis set to true.Also, blocked host info is always logged with level
error.Fixes #42813.
Nikita Vyrko
Dup arrays that get "converted".
Fixes #43681.
Aaron Patterson
Don't show deprecation warning for equal paths.
Anton Rieder
Fix crash in
ActionController::Instrumentationwith invalid HTTP formats.Fixes #43094.
Alex Ghiculescu
Add fallback host for SystemTestCase driven by RackTest.
Fixes #42780.
Petrik de Heus
Add more detail about what hosts are allowed.
Alex Ghiculescu
Active Job
Action Mailer
Action Cable
The Action Cable client now ensures successful channel subscriptions:
the server confirms the subscription or the channel is torn down.
by a subscribe (on the same channel identifier) and the requests are
handled out of order by the ActionCable server, thereby ignoring the
subscribe command.
Daniel Spinosa
Truncate broadcast logging messages.
J Smith
Active Storage
Attachments can be deleted after their association is no longer defined.
Fixes #42514
Don Sisco
Action Mailbox
Add
attachmentsto the list of permitted parameters for inbound emails conductor.When using the conductor to test inbound emails with attachments, this prevents an
unpermitted parameter warning in default configurations, and prevents errors for
applications that set:
David Jones, Dana Henke
Action Text
Fix Action Text extra trix content wrapper.
Alexandre Ruban
Railties
In
zeitwerkmode, setup theonceautoloader first, and themainautoloader after it.This order plays better with shared namespaces.
Xavier Noria
Handle paths with spaces when editing credentials.
Alex Ghiculescu
Support Psych 4 when loading secrets.
Nat Morcos
v6.1.4: 6.1.4Compare Source
Active Support
MemCacheStore: convert any underlying value (including
false) to anEntry.See #42559.
Alex Ghiculescu
Fix bug in
number_with_precisionwhen using largeBigDecimalvalues.Fixes #42302.
Federico Aldunate, Zachary Scott
Check byte size instead of length on
secure_compare.Tietew
Fix
Time.atto not lose:inoption.Ryuta Kamizono
Require a path for
config.cache_store = :file_store.Alex Ghiculescu
Avoid having to store complex object in the default translation file.
Rafael Mendonça França
Active Model
Fix
to_jsonforActiveModel::Dirtyobject.Exclude +mutations_from_database+ attribute from json as it lead to recursion.
Anil Maurya
Active Record
Do not try to rollback transactions that failed due to a
ActiveRecord::TransactionRollbackError.Jamie McCarthy
Raise an error if
pool_configisnilinset_pool_config.Eileen M. Uchitelle
Fix compatibility with
psych >= 4.Starting in Psych 4.0.0
YAML.loadbehaves likeYAML.safe_load. To preserve compatibilityActive Record's schema cache loader and
YAMLColumnnow usesYAML.unsafe_loadif available.Jean Boussier
Support using replicas when using
rails dbconsole.Christopher Thornton
Restore connection pools after transactional tests.
Eugene Kenny
Change
upsert_allto fails cleanly for MySQL when:unique_byis used.Bastian Bartmann
Fix user-defined
self.default_scopeto respect table alias.Ryuta Kamizono
Clear
@cache_keyscache afterupdate_all,delete_all,destroy_all.Ryuta Kamizono
Changed Arel predications
containsandoverlapsto usequoted_nodeso that PostgreSQL arrays are quoted properly.Bradley Priest
Fix
mergewhen thewhereclauses have string contents.Ryuta Kamizono
Fix rollback of parent destruction with nested
dependent: :destroy.Jacopo Beschi
Fix binds logging for
"WHERE ... IN ..."statements.Ricardo Díaz
Handle
falsein relation strict loading checks.Previously when a model had strict loading set to true and then had a
relation set
strict_loadingto false the false wasn't considered whendeciding whether to raise/warn about strict loading.
In the example,
dog.treatswould still raise even thoughstrict_loadingwas set to false. This is a bug effecting more thanActive Storage which is why I made this PR superceeding #41461. We need
to fix this for all applications since the behavior is a little
surprising. I took the test from ##41461 and the code suggestion from #41453
with some additions.
Eileen M. Uchitelle, Radamés Roriz
Fix numericality validator without precision.
Ryuta Kamizono
Fix aggregate attribute on Enum types.
Ryuta Kamizono
Fix
CREATE INDEXstatement generation for PostgreSQL.eltongo
Fix where clause on enum attribute when providing array of strings.
Ryuta Kamizono
Fix
unprepared_statementto work it when nesting.Ryuta Kamizono
Action View
The
translatehelper now passesdefaultvalues that aren'ttranslation keys through
I18n.translatefor interpolation.Jonathan Hefner
Don't attach UJS form submission handlers to Turbo forms.
David Heinemeier Hansson
Allow both
current_page?(url_hash)andcurrent_page?(**url_hash)on Ruby 2.7.Ryuta Kamizono
Action Pack
Ignore file fixtures on
db:fixtures:loadKevin Sjöberg
Fix ActionController::Live controller test deadlocks by removing the body buffer size limit for tests.
Dylan Thacker-Smith
Correctly place optional path parameter booleans.
Previously, if you specify a url parameter that is part of the path as false it would include that part
of the path as parameter for example:
After this change, true and false will be treated the same when used as optional path parameters. Meaning now:
Adam Hess
Add support for 'private, no-store' Cache-Control headers.
Previously, 'no-store' was exclusive; no other directives could be specified.
Alex Smith
Active Job
Action Mailer
Action Cable
Fix
ArgumentErrorwith ruby 3.0 onRemoteConnection#disconnect.Vladislav
Active Storage
The parameters sent to
ffmpegfor generating a video preview image are nowconfigurable under
config.active_storage.video_preview_arguments.Brendon Muir
Fix Active Storage update task when running in an engine.
Justin Malčić*
Don't raise an error if the mime type is not recognized.
Fixes #41777.
Alex Ghiculescu
ActiveStorage::PreviewErroris raised when a previewer is unable to generate a preview image.Alex Robbin
respond with 404 given invalid variation key when asking for representations.
George Claghorn
Blobcreation shouldn't crash if no service selected.Alex Ghiculescu
Action Mailbox
Action Text
Always render attachment partials as HTML with
:htmlformat inside trix editor.James Brooks
Railties
Fix compatibility with
psych >= 4.Starting in Psych 4.0.0
YAML.loadbehaves likeYAML.safe_load. To preserve compatibilityRails.application.config_fornow usesYAML.unsafe_loadif available.Jean Boussier
Ensure
Rails.application.config_foralways cast hashes toActiveSupport::OrderedOptions.Jean Boussier
Fix create migration generator with
--pretendoption.euxx
v6.1.3: 6.1.3Compare Source
Active Support
Active Model
Active Record
Fix the MySQL adapter to always set the right collation and charset
to the connection session.
Rafael Mendonça França
Fix MySQL adapter handling of time objects when prepared statements
are enabled.
Rafael Mendonça França
Fix scoping in enum fields using conditions that would generate
an
INclause.Ryuta Kamizono
Skip optimised #exist? query when #include? is called on a relation
with a having clause
Relations that have aliased select values AND a having clause that
references an aliased select value would generate an error when
#include? was called, due to an optimisation that would generate
call #exists? on the relation instead, which effectively alters
the select values of the query (and thus removes the aliased select
values), but leaves the having clause intact. Because the having
clause is then referencing an aliased column that is no longer
present in the simplified query, an ActiveRecord::InvalidStatement
error was raised.
An sample query affected by this problem:
This change adds an addition check to the condition that skips the
simplified #exists? query, which simply checks for the presence of
a having clause.
Fixes #41417
Michael Smart
Increment postgres prepared statement counter before making a prepared statement, so if the statement is aborted
without Rails knowledge (e.g., if app gets kill -9d during long-running query or due to Rack::Timeout), app won't end
up in perpetual crash state for being inconsistent with Postgres.
wbharding, Martin Tepper
Action View
Action Pack
Re-define routes when not set correctly via inheritance.
John Hawthorn
Active Job
Action Mailer
Action Cable
Active Storage
Action Mailbox
Action Text
Railties
v6.1.2: 6.1.2Compare Source
Active Support
ActiveSupport::Cache::MemCacheStorenow accepts an explicitnilfor itsaddressesargument.is now equivalent to
and is also equivalent to
which is the fallback behavior of Dalli
Active Model
Active Record
Fix timestamp type for sqlite3.
Eileen M. Uchitelle
Make destroy async transactional.
An active record rollback could occur while enqueuing a job. In this
case the job would enqueue even though the database deletion
rolledback putting things in a funky state.
Now the jobs are only enqueued until after the db transaction has been committed.
Cory Gwin
Fix malformed packet error in MySQL statement for connection configuration.
robinroestenburg
Connection specification now passes the "url" key as a configuration for the
adapter if the "url" protocol is "jdbc", "http", or "https". Previously only
urls with the "jdbc" prefix were passed to the Active Record Adapter, others
are assumed to be adapter specification urls.
Fixes #41137.
Jonathan Bracy
Fix granular connection swapping when there are multiple abstract classes.
Eileen M. Uchitelle
Fix
find_bywith custom primary key for belongs_to association.Ryuta Kamizono
Add support for
rails console --sandboxfor multiple database applications.alpaca-tc
Fix
whereon polymorphic association with empty array.Ryuta Kamizono
Fix preventing writes for
ApplicationRecord.Eileen M. Uchitelle
Action View
Action Pack
Fix error in
ActionController::LogSubscriberthat would happen when throwing inside a controller action.Janko Marohnić
Fix
fixture_file_uploaddeprecation whenfile_fixture_pathis a relative path.Eugene Kenny
Active Job
Action Mailer
Action Cable
Active Storage
Action Mailbox
Action Text
Railties
v6.1.1: 6.1.1Compare Source
Active Support
Change
IPAddr#to_jsonto match the behavior of the json gem returning the string representationinstead of the instance variables of the object.
Before:
=> "{"addr":2130706433,"family":2,"mask_addr":4294967295}"
=> ""127.0.0.1""
Active Model
Active Record
Fix fixtures loading when strict loading is enabled for the association.
Alex Ghiculescu
Fix
wherewith custom primary key for belongs_to association.Ryuta Kamizono
Fix
wherewith aliased associations.Ryuta Kamizono
Fix
composed_ofwith symbol mapping.Ryuta Kamizono
Don't skip money's type cast for pluck and calculations.
Ryuta Kamizono
Fix
whereon polymorphic association with non Active Record object.Ryuta Kamizono
Make sure
db:prepareworks even the schema file doesn't exist.Rafael Mendonça França
Fix complicated
has_many :throughwith nested where condition.Ryuta Kamizono
Handle STI models for
has_many dependent: :destroy_async.Muhammad Usman
Restore possibility of passing
falseto :polymorphic option ofbelongs_to.Previously, passing
falsewould trigger the option validation logicto throw an error saying :polymorphic would not be a valid option.
glaszig
Allow adding nonnamed expression indexes to be revertible.
Fixes #40732.
Previously, the following code would raise an error, when executed while rolling back,
and the index name should be specified explicitly. Now, the index name is inferred
automatically.
fatkodima
Action View
Fix lazy translation in partial with block.
Marek Kasztelnik
Avoid extra
SELECT COUNTqueries when rendering Active Record collections.aar0nr
Link preloading keep integrity hashes in the header.
Étienne Barrié
Add
config.action_view.preload_links_headerto allow disabling ofthe
Linkheader being added by default when usingstylesheet_link_tagand
javascript_include_tag.Andrew White
The
translatehelper now resolvesdefaultvalues when anilkey isspecified, instead of always returning
nil.Jonathan Hefner
Action Pack
Fix nil translation key lookup in controllers/
Jan Klimo
Quietly handle unknown HTTP methods in Action Dispatch SSL middleware.
Alex Robbin
Change the request method to a
GETwhen passing failed requests down toconfig.exceptions_app.Alex Robbin
Active Job
Make
retry_jobreturn the job that was created.Rafael Mendonça França
Include
ActiveSupport::Testing::AssertionsinActiveJob::TestHelpers.Mikkel Malmberg
Action Mailer
Sets default mailer queue to
"default"in the mail assertions.Paul Keen
Action Cable
Active Storage
Fix S3 multipart uploads when threshold is larger than file.
Matt Muller
Action Mailbox
Action Text
Railties
Allow spaces in path to Yarn binstub and only run on precompile if needed.
Markus Doits
Populate ARGV for app template.
Fixes #40945.
Jonathan Hefner
v6.1.0: 6.1.0Compare Source
Active Support
Ensure
MemoryStoredisables compression by default. Reverts behavior ofMemoryStoreto its prior rails5.1behavior.Max Gurewitz
Calling
iso8601on negative durations retains the negative sign on individualdigits instead of prepending it.
This change is required so we can interoperate with PostgreSQL, which prefers
negative signs for each component.
Compatibility with other iso8601 parsers which support leading negatives as well
as negatives per component is still retained.
Before:
=> "-P1Y1D"
=> "P-1Y-1D"
Remove deprecated
ActiveSupport::Notifications::Instrumenter#end=.Rafael Mendonça França
Deprecate
ActiveSupport::Multibyte::Unicode.default_normalization_form.Rafael Mendonça França
Remove deprecated
ActiveSupport::Multibyte::Unicode.pack_graphemes,ActiveSupport::Multibyte::Unicode.unpack_graphemes,ActiveSupport::Multibyte::Unicode.normalize,ActiveSupport::Multibyte::Unicode.downcase,ActiveSupport::Multibyte::Unicode.upcaseandActiveSupport::Multibyte::Unicode.swapcase.Rafael Mendonça França
Remove deprecated
ActiveSupport::Multibyte::Chars#consumes?andActiveSupport::Multibyte::Chars#normalize.Rafael Mendonça França
Remove deprecated file
active_support/core_ext/range/include_range.Rafael Mendonça França
Remove deprecated file
active_support/core_ext/hash/transform_values.Rafael Mendonça França
Remove deprecated file
active_support/core_ext/hash/compact.Rafael Mendonça França
Remove deprecated file
active_support/core_ext/array/prepend_and_append.Rafael Mendonça França
Remove deprecated file
active_support/core_ext/numeric/inquiry.Rafael Mendonça França
Remove deprecated file
active_support/core_ext/module/reachable.Rafael Mendonça França
Remove deprecated
Module#parent_name,Module#parentandModule#parents.Rafael Mendonça França
Remove deprecated
ActiveSupport::LoggerThreadSafeLevel#after_initialize.Rafael Mendonça França
Remove deprecated
LoggerSilenceconstant.Rafael Mendonça França
Remove deprecated fallback to
I18n.default_localwhenconfig.i18n.fallbacksis empty.Rafael Mendonça França
Remove entries from local cache on
RedisCacheStore#delete_matchedFixes #38627
ojab
Speed up
ActiveSupport::SecurityUtils.fixed_length_secure_compareby usingOpenSSL.fixed_length_secure_compare, if available.Nate Matykiewicz
ActiveSupport::Cache::MemCacheStorenow checksENV["MEMCACHE_SERVERS"]before falling back to"localhost:11211"if configured without any addresses.is now equivalent to
instead of
ActiveSupport::Subscriber#attach_tonow accepts aninherit_all:argument. When set to true,it allows a subscriber to receive events for methods defined in the subscriber's ancestor class(es).
We detach ActionControllerSubscriber from the :action_controller namespace so that our CustomActionControllerSubscriber
can provide its own instrumentation for certain events in the namespace
=> CustomActionControllerSubscriber will process events for "start_processing.action_controller" notifications
using its own #start_processing implementation, while retaining ActionControllerSubscriber's instrumentation
for "redirect_to.action_controller" notifications
Allow the digest class used to generate non-sensitive digests to be configured with
config.active_support.hash_digest_class.config.active_support.use_sha1_digestsis deprecated in favour ofconfig.active_support.hash_digest_class = ::Digest::SHA1.Dirkjan Bussink
Fix bug to make memcached write_entry expire correctly with unless_exist
Jye Lee
Add
ActiveSupport::Durationconversion methodsin_seconds,in_minutes,in_hours,in_days,in_weeks,in_months, andin_yearsreturn the respective duration covered.Jason York
Fixed issue in
ActiveSupport::Cache::RedisCacheStorenot passing optionsto
read_multicausingfetch_multito not work properlyRajesh Sharma
Fixed issue in
ActiveSupport::Cache::MemCacheStorewhich caused duplicate compression,and caused the provided
compression_thresholdto not be respected.Max Gurewitz
Prevent
RedisCacheStoreandMemCacheStorefrom performing compressionwhen reading entries written with
raw: true.Max Gurewitz
URI.parseris deprecated and will be removed in Rails 6.2. UseURI::DEFAULT_PARSERinstead.Jean Boussier
require_dependencyhas been documented to be obsolete in:zeitwerkmode. The method is not deprecated as such (yet), but applications are
encouraged to not use it.
In
:zeitwerkmode, semantics match Ruby's and you do not need to bedefensive with load order. Just refer to classes and modules normally. If
the constant name is dynamic, camelize if needed, and constantize.
Xavier Noria
Add 3rd person aliases of
Symbol#start_with?andSymbol#end_with?.Ryuta Kamizono
Add override of unary plus for
ActiveSupport::Duration.+ 1.secondis now identical to+1.secondto prevent errorswhere a seemingly innocent change of formatting leads to a change in the code behavior.
Before:
=> ActiveSupport::Duration
=> Integer
=> ActiveSupport::Duration
=> ActiveSupport::Duration
Add subsec to
ActiveSupport::TimeWithZone#inspect.Before:
=> "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
=> "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
=> "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
=> "Thu, 22 Jun 2017 02:39:00.000000000 UTC +00:00"
=> "Thu, 22 Jun 2017 02:39:00.123456780 UTC +00:00"
=> "Thu, 22 Jun 2017 02:39:00.333333333 UTC +00:00"
Calling
ActiveSupport::TaggedLogging#taggedwithout a block now returns a tagged logger.Eugene Kenny
Align
Range#cover?extension behavior with Ruby behavior for backwards ranges.(1..10).cover?(5..3)now returnsfalse, as it does in plain Ruby.Also update
#include?and#===behavior to match.Michael Groeneman
Update to TZInfo v2.0.0.
This changes the output of
ActiveSupport::TimeZone.utc_to_local, butcan be controlled with the
ActiveSupport.utc_to_local_returns_utc_offset_timesconfig.New Rails 6.1 apps have it enabled by default, existing apps can upgrade
via the config in config/initializers/new_framework_defaults_6_1.rb
See the
utc_to_local_returns_utc_offset_timesdocumentation for details.Phil Ross, Jared Beck
Add Date and Time
#yesterday?and#tomorrow?alongside#today?.Aliased to
#prev_day?and#next_day?to match the existing#prev/next_daymethods.Jatin Dhankhar
Add
Enumerable#pickto complementActiveRecord::Relation#pick.Eugene Kenny
[Breaking change]
ActiveSupport::Callbacks#halted_callback_hooknow receive a 2nd argument:ActiveSupport::Callbacks#halted_callback_hooknow receive the name of the callbackbeing halted as second argument.
This change will allow you to differentiate which callbacks halted the chain
and act accordingly.
Edouard Chin
Support
prependwithActiveSupport::Concern.Allows a module with
extend ActiveSupport::Concernto be prepended.Same as
included, except only run when prepended.Deprecate using
Range#include?method to check the inclusion of a valuein a date time range. It is recommended to use
Range#cover?methodinstead of
Range#include?to check the inclusion of a valuein a date time range.
Vishal Telangre
Support added for a
round_modeparameter, in all number helpers. (See:BigDecimal::mode.)Tom Lord
Array#to_sentenceno longer returns a frozen string.Before:
=> true
=> false
When an instance of
ActiveSupport::Durationis converted to aniso8601duration string, ifweeksare mixed withdateparts, theweekpart will be converted to days.This keeps the parser and serializer on the same page.
1 week, 4 days, 13 hours, 46 minutes, and 40.0 seconds
P11DT13H46M40S
11 days, 13 hours, 46 minutes, and 40 seconds
1 week
P1W
1 week
Add block support to
ActiveSupport::Testing::TimeHelpers#travel_back.Tim Masliuchenko
Update
ActiveSupport::Messages::Metadata#fresh?to work for cookies with expiry set whenActiveSupport.parse_json_times = true.Christian Gregg
Support symbolic links for
content_pathinActiveSupport::EncryptedFile.Takumi Shotoku
Improve
Range#===,Range#include?, andRange#cover?to work with beginless (startless)and endless range targets.
Allen Hsu, Andrew Hodgkinson
Don't use
Process#clock_gettime(CLOCK_THREAD_CPUTIME_ID)on Solaris.Iain Beeston
Prevent
ActiveSupport::Duration.build(value)from creating instances ofActiveSupport::Durationunlessvalueis of typeNumeric.Addresses the errant set of behaviours described in #37012 where
ActiveSupport::Durationcomparisons would fail confusinglyor return unexpected results when comparing durations built from instances of
String.Before:
=> false
=> false
=> ArgumentError (comparison of ActiveSupport::Duration::Scalar with ActiveSupport::Duration failed)
=> ArgumentError (comparison of String with ActiveSupport::Duration failed)
=> TypeError (can't build an ActiveSupport::Duration from a String)
Add
ActiveSupport::Cache::Store#delete_multimethod to delete multiple keys from the cache store.Peter Zhu
Support multiple arguments in
HashWithIndifferentAccessformergeandupdatemethods, tofollow Ruby 2.6 addition.
Wojciech Wnętrzak
Allow initializing
thread_mattr_*attributes via:defaultoption.Guilherme Mansur
Add
compact_blankfor those times when you want to remove #blank? values froman Enumerable (also
compact_blank!on Hash, Array, ActionController::Parameters).Dana Sherson
Make ActiveSupport::Logger Fiber-safe.
Use
Fiber.current.__id__inActiveSupport::Logger#local_level=in orderto make log level local to Ruby Fibers in addition to Threads.
Example:
Before:
After:
Fixes #36752.
Alexander Varnin
Allow the
on_rotationproc used when decrypting/verifying a message to bepassed at the constructor level.
Before:
After:
Edouard Chin
delegate_missing_towould raise aDelegationErrorif the objectdelegated to was
nil. Now theallow_niloption has been added to enablethe user to specify they want
nilreturned in this case.Matthew Tanous
truncatewould return the original string if it was too short to be truncatedand a frozen string if it were long enough to be truncated. Now truncate will
consistently return an unfrozen string regardless. This behavior is consistent
with
gsubandstrip.Before:
=> true
=> false
=> false
=> false
Active Model
Pass in
baseinstead ofbase_classto Error.human_attribute_nameThis is useful in cases where the
human_attribute_namemethod dependson other attributes' values of the class under validation to derive what the
attribute name should be.
Filipe Sabella
Deprecate marshalling load from legacy attributes format.
Ryuta Kamizono
*_previously_changed?accepts:fromand:tokeyword arguments like*_changed?.=> true
Raise FrozenError when trying to write attributes that aren't backed by the database on an object that is frozen:
Josh Brody
Add
*_previously_wasattribute methods when dirty tracking. Example:DHH
Encapsulate each validation error as an Error object.
The
ActiveModel’serrorscollection is now an array of these Errorobjects, instead of messages/details hash.
For each of these
Errorobject, itsmessageandfull_messagemethodsare for generating error messages. Its
detailsmethod would return error’sextra parameters, found in the original
detailshash.The change tries its best at maintaining backward compatibility, however
some edge cases won’t be covered, like
errors#firstwill returnActiveModel::Errorand manipulatingerrors.messagesanderrors.detailshashes directly will have no effect. Moving forward,please convert those direct manipulations to use provided API methods instead.
The list of deprecated methods and their planned future behavioral changes at the next major release are:
errors#slice!will be removed.errors#eachwith thekey, valuetwo-arguments block will stop working, while theerrorsingle-argument block would returnErrorobject.errors#valueswill be removed.errors#keyswill be removed.errors#to_xmlwill be removed.errors#to_hwill be removed, and can be replaced witherrors#to_hash.errorsitself as a hash will have no effect (e.g.errors[:foo] = 'bar').errors#messages(e.g.errors.messages[:foo] = 'bar') will have no effect.errors#details(e.g.errors.details[:foo].clear) will have no effect.lulalala
Active Record
Only warn about negative enums if a positive form that would cause conflicts exists.
Fixes #39065.
Alex Ghiculescu
Change
attribute_for_inspectto takefilter_attributesin consideration.Rafael Mendonça França
Fix odd behavior of inverse_of with multiple belongs_to to same class.
Fixes #35204.
Tomoyuki Kai
Build predicate conditions with objects that delegate
#idand primary key:Sean Doyle
Add
connected_to_manyAPI.This API allows applications to connect to multiple databases at once without switching all of them or implementing a deeply nested stack.
Before:
AnimalsRecord.connected_to(role: :reading) do
MealsRecord.connected_to(role: :reading) do
Dog.first # read from animals replica
Dinner.first # read from meals replica
Person.first # read from primary writer
end
end
After:
ActiveRecord::Base.connected_to_many([AnimalsRecord, MealsRecord], role: :reading) do
Dog.first # read from animals replica
Dinner.first # read from meals replica
Person.first # read from primary writer
end
Eileen M. Uchitelle, John Crepezzi
Add option to raise or log for
ActiveRecord::StrictLoadingViolationError.Some applications may not want to raise an error in production if using
strict_loading. This would allow an application to set strict loading to log for the production environment while still raising in development and test environments.Set
config.active_record.action_on_strict_loading_violationto:logerrors instead of raising.Eileen M. Uchitelle
Allow the inverse of a
has_oneassociation that was previously autosaved to be loaded.Fixes #34255.
Steven Weber
Optimise the length of index names for polymorphic references by using the reference name rather than the type and id column names.
Because the default behaviour when adding an index with multiple columns is to use all column names in the index name, this could frequently lead to overly long index names for polymorphic references which would fail the migration if it exceeded the database limit.
This change reduces the chance of that happening by using the reference name, e.g.
index_my_table_on_my_reference.Fixes #38655.
Luke Redpath
MySQL: Uniqueness validator now respects default database collation,
no longer enforce case sensitive comparison by default.
Ryuta Kamizono
Remove deprecated methods from
ActiveRecord::ConnectionAdapters::DatabaseLimits.column_name_lengthtable_name_lengthcolumns_per_tableindexes_per_tablecolumns_per_multicolumn_indexsql_query_lengthjoins_per_queryRafael Mendonça França
Remove deprecated
ActiveRecord::ConnectionAdapters::AbstractAdapter#supports_multi_insert?.Rafael Mendonça França
Remove deprecated
ActiveRecord::ConnectionAdapters::AbstractAdapter#supports_foreign_keys_in_create?.Rafael Mendonça França
Remove deprecated
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#supports_ranges?.Rafael Mendonça França
Remove deprecated
ActiveRecord::Base#update_attributesandActiveRecord::Base#update_attributes!.Rafael Mendonça França
Remove deprecated
migrations_pathargument inActiveRecord::ConnectionAdapter::SchemaStatements#assume_migrated_upto_version.Rafael Mendonça França
Remove deprecated
config.active_record.sqlite3.represent_boolean_as_integer.Rafael Mendonça França
relation.createdoes no longer leak scope to class level querying methodsin initialization block and callbacks.
Before:
After:
Ryuta Kamizono
Named scope chain does no longer leak scope to class level querying methods.
Before:
SELECT * FROM users WHERE name = 'John' AND name = 'David'
SELECT * FROM users WHERE name = 'David'
Remove deprecated methods from
ActiveRecord::DatabaseConfigurations.fetcheachfirstvalues[]=Rafael Mendonça França
where.notnow generates NAND predicates instead of NOR.Before:
SELECT * FROM users WHERE name != 'Jon' AND role != 'admin'
SELECT * FROM users WHERE NOT (name == 'Jon' AND role == 'admin')
Remove deprecated
ActiveRecord::Result#to_hashmethod.Rafael Mendonça França
Deprecate
ActiveRecord::Base.allow_unsafe_raw_sql.Rafael Mendonça França
Remove deprecated support for using unsafe raw SQL in
ActiveRecord::Relationmethods.Rafael Mendonça França
Allow users to silence the "Rails couldn't infer whether you are using multiple databases..."
message using
config.active_record.suppress_multiple_database_warning.Omri Gabay
Connections can be granularly switched for abstract classes when
connected_tois called.This change allows
connected_toto switch aroleand/orshardfor a single abstract class instead of all classes globally. Applications that want to use the new feature need to setconfig.active_record.legacy_connection_handlingtofalsein their application configuration.Example usage:
Given an application we have a
Usermodel that inherits fromApplicationRecordand aDogmodel that inherits fromAnimalsRecord.AnimalsRecordandApplicationRecordhave writing and reading connections as well as sharddefault,one, andtwo.Eileen M. Uchitelle, John Crepezzi
Allow double-dash comment syntax when querying read-only databases
James Adam
Add
values_atmethod.Returns an array containing the values associated with the given methods.
=> ["Budget", "Jason"]
Fix
read_attribute_before_type_castto consider attribute aliases.Marcelo Lauxen
Support passing record to uniqueness validator
:conditionscallable:Eliot Sykes
BatchEnumerator#update_allandBatchEnumerator#delete_allnow return thetotal number of rows affected, just like their non-batched counterparts.
Fixes #40287.
Eugene Kenny
Add support for PostgreSQL
intervaldata type with conversion toActiveSupport::Durationwhen loading records from database andserialization to ISO 8601 formatted duration string on save.
Add support to define a column in migrations and get it in a schema dump.
Optional column precision is supported.
To use this in 6.1, you need to place the next string to your model file:
To keep old behavior until 6.2 is released:
Example:
Andrey Novikov
Allow associations supporting the
dependent:key to takedependent: :destroy_async.:destroy_asyncwill enqueue a job to destroy associated records in the background.DHH, George Claghorn, Cory Gwin, Rafael Mendonça França, Adrianna Chang
Add
SKIP_TEST_DATABASEenvironment variable to disable modifying the test database whenrails db:createandrails db:dropare called.Jason Schweier
connects_tocan only be called onActiveRecord::Baseor abstract classes.Ensure that
connects_tocan only be called fromActiveRecord::Baseor abstract classes. This protects the application from opening duplicate or too many connections.Eileen M. Uchitelle, John Crepezzi
All connection adapters
executenow raisesActiveRecord::ConnectionNotEstablishedrather thanActiveRecord::StatementInvalidwhen they encounter a connection error.Jean Boussier
Mysql2Adapter#quote_stringnow raisesActiveRecord::ConnectionNotEstablishedrather thanActiveRecord::StatementInvalidwhen it can't connect to the MySQL server.Jean Boussier
Add support for check constraints that are
NOT VALIDviavalidate: false(PostgreSQL-only).Alex Robbin
Ensure the default configuration is considered primary or first for an environment
If a multiple database application provides a configuration named primary, that will be treated as default. In applications that do not have a primary entry, the default database configuration will be the first configuration for an environment.
Eileen M. Uchitelle
Allow
wherereferences association names as joined table name aliases.... FROM comments LEFT OUTER JOIN comments children ON ... WHERE children.label = 1
Support storing demodulized class name for polymorphic type.
Before Rails 6.1, storing demodulized class name is supported only for STI type
by `store_full_sti_clas
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.