Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Update dependency @rails/activestorage to v6.1.3 #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Jun 28, 2021

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@rails/activestorage (source) 6.0.3 -> 6.1.3 age adoption passing confidence

Release Notes

rails/rails

v6.1.3

Compare Source

Active Support

  • No changes.

Active Model

  • No changes.

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 IN clause.

    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:

    Author.select('COUNT(*) as total_posts', 'authors.*')
          .joins(:posts)
          .group(:id)
          .having('total_posts > 2')
          .include?(Author.first)

    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

  • No changes.

Action Pack

  • Re-define routes when not set correctly via inheritance.

    John Hawthorn

Active Job

  • No changes.

Action Mailer

  • No changes.

Action Cable

  • No changes.

Active Storage

  • No changes.

Action Mailbox

  • No changes.

Action Text

  • No changes.

Railties

  • No changes.

v6.1.2

Compare Source

Active Support
  • ActiveSupport::Cache::MemCacheStore now accepts an explicit nil for its addresses argument.

    config.cache_store = :mem_cache_store, nil
is now equivalent to
config.cache_store = :mem_cache_store
and is also equivalent to
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
which is the fallback behavior of Dalli
```

This helps those migrating from `:dalli_store`, where an explicit `nil` was permitted.

*Michael Overmeyer*
Active Model
  • No changes.
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_by with custom primary key for belongs_to association.

    Ryuta Kamizono

  • Add support for rails console --sandbox for multiple database applications.

    alpaca-tc

  • Fix where on polymorphic association with empty array.

    Ryuta Kamizono

  • Fix preventing writes for ApplicationRecord.

    Eileen M. Uchitelle

Action View
  • No changes.
Action Pack
  • Fix error in ActionController::LogSubscriber that would happen when throwing inside a controller action.

    Janko Marohnić

  • Fix fixture_file_upload deprecation when file_fixture_path is a relative path.

    Eugene Kenny

Active Job
  • No changes.
Action Mailer
  • No changes.
Action Cable
  • No changes.
Active Storage
  • No changes.
Action Mailbox
  • No changes.
Action Text
  • No changes.
Railties
  • No changes.

v6.1.1

Compare Source

Active Support

  • Change IPAddr#to_json to match the behavior of the json gem returning the string representation
    instead of the instance variables of the object.

    Before:

    IPAddr.new("127.0.0.1").to_json

=> "{"addr":2130706433,"family":2,"mask_addr":4294967295}"

```

After:

```ruby
IPAddr.new("127.0.0.1").to_json

=> ""127.0.0.1""

```

Active Model

  • No changes.

Active Record

  • Fix fixtures loading when strict loading is enabled for the association.

    Alex Ghiculescu

  • Fix where with custom primary key for belongs_to association.

    Ryuta Kamizono

  • Fix where with aliased associations.

    Ryuta Kamizono

  • Fix composed_of with symbol mapping.

    Ryuta Kamizono

  • Don't skip money's type cast for pluck and calculations.

    Ryuta Kamizono

  • Fix where on polymorphic association with non Active Record object.

    Ryuta Kamizono

  • Make sure db:prepare works even the schema file doesn't exist.

    Rafael Mendonça França

  • Fix complicated has_many :through with nested where condition.

    Ryuta Kamizono

  • Handle STI models for has_many dependent: :destroy_async.

    Muhammad Usman

  • Restore possibility of passing false to :polymorphic option of belongs_to.

    Previously, passing false would trigger the option validation logic
    to 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.

    add_index(:items, "to_tsvector('english', description)")

    fatkodima

Action View

  • Fix lazy translation in partial with block.

    Marek Kasztelnik

  • Avoid extra SELECT COUNT queries when rendering Active Record collections.

    aar0nr

  • Link preloading keep integrity hashes in the header.

    Étienne Barrié

  • Add config.action_view.preload_links_header to allow disabling of
    the Link header being added by default when using stylesheet_link_tag
    and javascript_include_tag.

    Andrew White

  • The translate helper now resolves default values when a nil key is
    specified, 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 GET when passing failed requests down to config.exceptions_app.

    Alex Robbin

Active Job

  • Make retry_job return the job that was created.

    Rafael Mendonça França

  • Include ActiveSupport::Testing::Assertions in ActiveJob::TestHelpers.

    Mikkel Malmberg

Action Mailer

  • Sets default mailer queue to "default" in the mail assertions.

    Paul Keen

Action Cable

  • No changes.

Active Storage

  • Fix S3 multipart uploads when threshold is larger than file.

    Matt Muller

Action Mailbox

  • No changes.

Action Text

  • No changes.

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

Compare Source

Active Support

  • Ensure MemoryStore disables compression by default. Reverts behavior of
    MemoryStore to its prior rails 5.1 behavior.

    Max Gurewitz

  • Calling iso8601 on negative durations retains the negative sign on individual
    digits 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:

    (-1.year - 1.day).iso8601
    

=> "-P1Y1D"

After:

    (-1.year - 1.day).iso8601

=> "P-1Y-1D"

*Vipul A M*
  • 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.upcase and ActiveSupport::Multibyte::Unicode.swapcase.

    Rafael Mendonça França

  • Remove deprecated ActiveSupport::Multibyte::Chars#consumes? and ActiveSupport::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#parent and Module#parents.

    Rafael Mendonça França

  • Remove deprecated ActiveSupport::LoggerThreadSafeLevel#after_initialize.

    Rafael Mendonça França

  • Remove deprecated LoggerSilence constant.

    Rafael Mendonça França

  • Remove deprecated fallback to I18n.default_local when config.i18n.fallbacks is empty.

    Rafael Mendonça França

  • Remove entries from local cache on RedisCacheStore#delete_matched

    Fixes #​38627

    ojab

  • Speed up ActiveSupport::SecurityUtils.fixed_length_secure_compare by using
    OpenSSL.fixed_length_secure_compare, if available.

    Nate Matykiewicz

  • ActiveSupport::Cache::MemCacheStore now checks ENV["MEMCACHE_SERVERS"] before falling back to "localhost:11211" if configured without any addresses.

    config.cache_store = :mem_cache_store

is now equivalent to

config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"

instead of

config.cache_store = :mem_cache_store, "localhost:11211" # ignores ENV["MEMCACHE_SERVERS"]
```

*Sam Bostock*
  • ActiveSupport::Subscriber#attach_to now accepts an inherit_all: argument. When set to true,
    it allows a subscriber to receive events for methods defined in the subscriber's ancestor class(es).

    class ActionControllerSubscriber < ActiveSupport::Subscriber
      attach_to :action_controller
    
      def start_processing(event)
        info "Processing by #{event.payload[:controller]}##{event.payload[:action]} as #{format}"
      end
    
      def redirect_to(event)
        info { "Redirected to #{event.payload[:location]}" }
      end
    end

We detach ActionControllerSubscriber from the :action_controller namespace so that our CustomActionControllerSubscriber

can provide its own instrumentation for certain events in the namespace

ActionControllerSubscriber.detach_from(:action_controller)

class CustomActionControllerSubscriber < ActionControllerSubscriber
  attach_to :action_controller, inherit_all: true

  def start_processing(event)
    info "A custom response to start_processing events"
  end

=> 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

end
```

*Adrianna Chang*
  • 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_digests is deprecated in favour of config.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::Duration conversion methods

    in_seconds, in_minutes, in_hours, in_days, in_weeks, in_months, and in_years return the respective duration covered.

    Jason York

  • Fixed issue in ActiveSupport::Cache::RedisCacheStore not passing options
    to read_multi causing fetch_multi to not work properly

    Rajesh Sharma

  • Fixed issue in ActiveSupport::Cache::MemCacheStore which caused duplicate compression,
    and caused the provided compression_threshold to not be respected.

    Max Gurewitz

  • Prevent RedisCacheStore and MemCacheStore from performing compression
    when reading entries written with raw: true.

    Max Gurewitz

  • URI.parser is deprecated and will be removed in Rails 6.2. Use
    URI::DEFAULT_PARSER instead.

    Jean Boussier

  • require_dependency has been documented to be obsolete in :zeitwerk
    mode. The method is not deprecated as such (yet), but applications are
    encouraged to not use it.

    In :zeitwerk mode, semantics match Ruby's and you do not need to be
    defensive 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? and Symbol#end_with?.

    :foo.starts_with?("f") # => true
    :foo.ends_with?("o")   # => true

    Ryuta Kamizono

  • Add override of unary plus for ActiveSupport::Duration.

    + 1.second is now identical to +1.second to prevent errors
    where a seemingly innocent change of formatting leads to a change in the code behavior.

    Before:

    +1.second.class

=> ActiveSupport::Duration

(+ 1.second).class

=> Integer

```

After:
```ruby
+1.second.class

=> ActiveSupport::Duration

(+ 1.second).class

=> ActiveSupport::Duration

```

Fixes #&#8203;39079.

*Roman Kushnir*
  • Add subsec to ActiveSupport::TimeWithZone#inspect.

    Before:

    Time.at(1498099140).in_time_zone.inspect
    

=> "Thu, 22 Jun 2017 02:39:00 UTC +00:00"

    Time.at(1498099140, 123456780, :nsec).in_time_zone.inspect

=> "Thu, 22 Jun 2017 02:39:00 UTC +00:00"

    Time.at(1498099140 + Rational("1/3")).in_time_zone.inspect

=> "Thu, 22 Jun 2017 02:39:00 UTC +00:00"

After:

    Time.at(1498099140).in_time_zone.inspect

=> "Thu, 22 Jun 2017 02:39:00.000000000 UTC +00:00"

    Time.at(1498099140, 123456780, :nsec).in_time_zone.inspect

=> "Thu, 22 Jun 2017 02:39:00.123456780 UTC +00:00"

    Time.at(1498099140 + Rational("1/3")).in_time_zone.inspect

=> "Thu, 22 Jun 2017 02:39:00.333333333 UTC +00:00"

*akinomaeni*
  • Calling ActiveSupport::TaggedLogging#tagged without a block now returns a tagged logger.

    logger.tagged("BCX").info("Funky time!") # => [BCX] Funky time!

    Eugene Kenny

  • Align Range#cover? extension behavior with Ruby behavior for backwards ranges.

    (1..10).cover?(5..3) now returns false, 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, but
    can be controlled with the
    ActiveSupport.utc_to_local_returns_utc_offset_times config.

    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_times documentation 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_day methods.

    Jatin Dhankhar

  • Add Enumerable#pick to complement ActiveRecord::Relation#pick.

    Eugene Kenny

  • [Breaking change] ActiveSupport::Callbacks#halted_callback_hook now receive a 2nd argument:

    ActiveSupport::Callbacks#halted_callback_hook now receive the name of the callback
    being halted as second argument.
    This change will allow you to differentiate which callbacks halted the chain
    and act accordingly.

      class Book < ApplicationRecord
        before_save { throw(:abort) }
        before_create { throw(:abort) }
    
        def halted_callback_hook(filter, callback_name)
          Rails.logger.info("Book couldn't be #{callback_name}d")
        end
    
        Book.create # => "Book couldn't be created"
        book.save # => "Book couldn't be saved"
      end

    Edouard Chin

  • Support prepend with ActiveSupport::Concern.

    Allows a module with extend ActiveSupport::Concern to be prepended.

    module Imposter
      extend ActiveSupport::Concern
    

Same as included, except only run when prepended.

      prepended do
      end
    end

    class Person
      prepend Imposter
    end

Class methods are prepended to the base class, concerning is also
updated: `concerning :Imposter, prepend: true do`.

*Jason Karns*, *Elia Schito*
  • Deprecate using Range#include? method to check the inclusion of a value
    in a date time range. It is recommended to use Range#cover? method
    instead of Range#include? to check the inclusion of a value
    in a date time range.

    Vishal Telangre

  • Support added for a round_mode parameter, in all number helpers. (See: BigDecimal::mode.)

    number_to_currency(1234567890.50, precision: 0, round_mode: :half_down) # => "$1,234,567,890"
    number_to_percentage(302.24398923423, precision: 5, round_mode: :down) # => "302.24398%"
    number_to_rounded(389.32314, precision: 0, round_mode: :ceil) # => "390"
    number_to_human_size(483989, precision: 2, round_mode: :up) # => "480 KB"
    number_to_human(489939, precision: 2, round_mode: :floor) # => "480 Thousand"
    
    485000.to_s(:human, precision: 2, round_mode: :half_even) # => "480 Thousand"

    Tom Lord

  • Array#to_sentence no longer returns a frozen string.

    Before:

    ['one', 'two'].to_sentence.frozen?
    

=> true

After:

    ['one', 'two'].to_sentence.frozen?

=> false

*Nicolas Dular*
  • When an instance of ActiveSupport::Duration is converted to an iso8601 duration string, if weeks are mixed with date parts, the week part will be converted to days.
    This keeps the parser and serializer on the same page.

    duration = ActiveSupport::Duration.build(1000000)

1 week, 4 days, 13 hours, 46 minutes, and 40.0 seconds

duration_iso = duration.iso8601

P11DT13H46M40S

ActiveSupport::Duration.parse(duration_iso)

11 days, 13 hours, 46 minutes, and 40 seconds

duration = ActiveSupport::Duration.build(604800)

1 week

duration_iso = duration.iso8601

P1W

ActiveSupport::Duration.parse(duration_iso)

1 week

```

*Abhishek Sarkar*
  • Add block support to ActiveSupport::Testing::TimeHelpers#travel_back.

    Tim Masliuchenko

  • Update ActiveSupport::Messages::Metadata#fresh? to work for cookies with expiry set when
    ActiveSupport.parse_json_times = true.

    Christian Gregg

  • Support symbolic links for content_path in ActiveSupport::EncryptedFile.

    Takumi Shotoku

  • Improve Range#===, Range#include?, and Range#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 of
    ActiveSupport::Duration unless value is of type Numeric.

    Addresses the errant set of behaviours described in #​37012 where
    ActiveSupport::Duration comparisons would fail confusingly
    or return unexpected results when comparing durations built from instances of String.

    Before:

    small_duration_from_string = ActiveSupport::Duration.build('9')
    large_duration_from_string = ActiveSupport::Duration.build('100000000000000')
    small_duration_from_int = ActiveSupport::Duration.build(9)
    
    large_duration_from_string > small_duration_from_string
    

=> false

    small_duration_from_string == small_duration_from_int

=> false

    small_duration_from_int < large_duration_from_string

=> ArgumentError (comparison of ActiveSupport::Duration::Scalar with ActiveSupport::Duration failed)

    large_duration_from_string > small_duration_from_int

=> ArgumentError (comparison of String with ActiveSupport::Duration failed)

After:

    small_duration_from_string = ActiveSupport::Duration.build('9')

=> TypeError (can't build an ActiveSupport::Duration from a String)

*Alexei Emam*
  • Add ActiveSupport::Cache::Store#delete_multi method to delete multiple keys from the cache store.

    Peter Zhu

  • Support multiple arguments in HashWithIndifferentAccess for merge and update methods, to
    follow Ruby 2.6 addition.

    Wojciech Wnętrzak

  • Allow initializing thread_mattr_* attributes via :default option.

    class Scraper
      thread_mattr_reader :client, default: Api::Client.new
    end
    

    Guilherme Mansur

  • Add compact_blank for those times when you want to remove #blank? values from
    an Enumerable (also compact_blank! on Hash, Array, ActionController::Parameters).

    Dana Sherson

  • Make ActiveSupport::Logger Fiber-safe.

    Use Fiber.current.__id__ in ActiveSupport::Logger#local_level= in order
    to make log level local to Ruby Fibers in addition to Threads.

    Example:

    logger = ActiveSupport::Logger.new(STDOUT)
    logger.level = 1
    puts "Main is debug? #{logger.debug?}"
    
    Fiber.new {
      logger.local_level = 0
      puts "Thread is debug? #{logger.debug?}"
    }.resume
    
    puts "Main is debug? #{logger.debug?}"
    

    Before:

    Main is debug? false
    Thread is debug? true
    Main is debug? true
    

    After:

    Main is debug? false
    Thread is debug? true
    Main is debug? false
    

    Fixes #​36752.

    Alexander Varnin

  • Allow the on_rotation proc used when decrypting/verifying a message to be
    passed at the constructor level.

    Before:

    crypt = ActiveSupport::MessageEncryptor.new('long_secret')
    crypt.decrypt_and_verify(encrypted_message, on_rotation: proc { ... })
    crypt.decrypt_and_verify(another_encrypted_message, on_rotation: proc { ... })
    

    After:

    crypt = ActiveSupport::MessageEncryptor.new('long_secret', on_rotation: proc { ... })
    crypt.decrypt_and_verify(encrypted_message)
    crypt.decrypt_and_verify(another_encrypted_message)
    

    Edouard Chin

  • delegate_missing_to would raise a DelegationError if the object
    delegated to was nil. Now the allow_nil option has been added to enable
    the user to specify they want nil returned in this case.

    Matthew Tanous

  • truncate would return the original string if it was too short to be truncated
    and 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 gsub and strip.

    Before:

    'foobar'.truncate(5).frozen?
    

=> true

    'foobar'.truncate(6).frozen?

=> false

After:

    'foobar'.truncate(5).frozen?

=> false

    'foobar'.truncate(6).frozen?

=> false

*Jordan Thomas*

Active Model

  • Pass in base instead of base_class to Error.human_attribute_name

    This is useful in cases where the human_attribute_name method depends
    on 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 :from and :to keyword arguments like *_changed?.

    topic.update!(status: :archived)
    topic.status_previously_changed?(from: "active", to: "archived")
    

=> true

*George Claghorn*
  • Raise FrozenError when trying to write attributes that aren't backed by the database on an object that is frozen:

    class Animal
      include ActiveModel::Attributes
      attribute :age
    end
    
    animal = Animal.new
    animal.freeze
    animal.age = 25 # => FrozenError, "can't modify a frozen Animal"
    

    Josh Brody

  • Add *_previously_was attribute methods when dirty tracking. Example:

    pirate.update(catchphrase: "Ahoy!")
    pirate.previous_changes["catchphrase"] # => ["Thar She Blows!", "Ahoy!"]
    pirate.catchphrase_previously_was # => "Thar She Blows!"
    

    DHH

  • Encapsulate each validation error as an Error object.

    The ActiveModel’s errors collection is now an array of these Error
    objects, instead of messages/details hash.

    For each of these Error object, its message and full_message methods
    are for generating error messages. Its details method would return error’s
    extra parameters, found in the original details hash.

    The change tries its best at maintaining backward compatibility, however
    some edge cases won’t be covered, like errors#first will return ActiveModel::Error and manipulating
    errors.messages and errors.details hashes 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#each with the key, value two-arguments block will stop working, while the error single-argument block would return Error object.
    • errors#values will be removed.
    • errors#keys will be removed.
    • errors#to_xml will be removed.
    • errors#to_h will be removed, and can be replaced with errors#to_hash.
    • Manipulating errors itself as a hash will have no effect (e.g. errors[:foo] = 'bar').
    • Manipulating the hash returned by errors#messages (e.g. errors.messages[:foo] = 'bar') will have no effect.
    • Manipulating the hash returned by 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_inspect to take filter_attributes in 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 #id and primary key:

    class AdminAuthor
      delegate_missing_to :@&#8203;author
    
      def initialize(author)
        @&#8203;author = author
      end
    end
    
    Post.where(author: AdminAuthor.new(author))

    Sean Doyle

  • Add connected_to_many API.

    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_violation to :log errors instead of raising.

    Eileen M. Uchitelle

  • Allow the inverse of a has_one association 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_length
    table_name_length
    columns_per_table
    indexes_per_table
    columns_per_multicolumn_index
    sql_query_length
    joins_per_query

    Rafael 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_attributes and ActiveRecord::Base#update_attributes!.

    Rafael Mendonça França

  • Remove deprecated migrations_path argument in ActiveRecord::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.create does no longer leak scope to class level querying methods
    in initialization block and callbacks.

    Before:

    User.where(name: "John").create do |john|
      User.find_by(name: "David") # => nil
    end
    

    After:

    User.where(name: "John").create do |john|
      User.find_by(name: "David") # => #<User name: "David", ...>
    end
    

    Ryuta Kamizono

  • Named scope chain does no longer leak scope to class level querying methods.

    class User < ActiveRecord::Base
      scope :david, -> { User.where(name: "David") }
    end
    

    Before:

    User.where(name: "John").david
    

SELECT * FROM users WHERE name = 'John' AND name = 'David'

After:

    User.where(name: "John").david

SELECT * FROM users WHERE name = 'David'

*Ryuta Kamizono*
  • Remove deprecated methods from ActiveRecord::DatabaseConfigurations.

    fetch
    each
    first
    values
    []=

    Rafael Mendonça França

  • where.not now generates NAND predicates instead of NOR.

    Before:

     User.where.not(name: "Jon", role: "admin")
    

SELECT * FROM users WHERE name != 'Jon' AND role != 'admin'

 After:

     User.where.not(name: "Jon", role: "admin")

SELECT * FROM users WHERE NOT (name == 'Jon' AND role == 'admin')

*Rafael Mendonça França*
  • Remove deprecated ActiveRecord::Result#to_hash method.

    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::Relation methods.

    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_to is called.

    This change allows connected_to to switch a role and/or shard for a single abstract class instead of all classes globally. Applications that want to use the new feature need to set config.active_record.legacy_connection_handling to false in their application configuration.

    Example usage:

    Given an application we have a User model that inherits from ApplicationRecord and a Dog model that inherits from AnimalsRecord. AnimalsRecord and ApplicationRecord have writing and reading connections as well as shard default, one, and two.

    ActiveRecord::Base.connected_to(role: :reading) do
      User.first # reads from default replica
      Dog.first # reads from default replica
    
      AnimalsRecord.connected_to(role: :writing, shard: :one) do
        User.first # reads from default replica
        Dog.first # reads from shard one primary
      end
    
      User.first # reads from default replica
      Dog.first # reads from default replica
    
      ApplicationRecord.connected_to(role: :writing, shard: :two) do
        User.first # reads from shard two primary
        Dog.first # reads from default replica
      end
    end

    Eileen M. Uchitelle, John Crepezzi

  • Allow double-dash comment syntax when querying read-only databases

    James Adam

  • Add values_at method.

    Returns an array containing the values associated with the given methods.

    topic = Topic.first
    topic.values_at(:title, :author_name)

=> ["Budget", "Jason"]

```

Similar to `Hash#values_at` but on an Active Record instance.

*Guillaume Briday*
  • Fix read_attribute_before_type_cast to consider attribute aliases.

    Marcelo Lauxen

  • Support passing record to uniqueness validator :conditions callable:

    class Article < ApplicationRecord
      validates_uniqueness_of :title, conditions: ->(article) {
        published_at = article.published_at
        where(published_at: published_at.beginning_of_year..published_at.end_of_year)
      }
    end

    Eliot Sykes

  • BatchEnumerator#update_all and BatchEnumerator#delete_all now return the
    total number of rows affected, just like their non-batched counterparts.

    Person.in_batches.update_all("first_name = 'Eugene'") # => 42
    Person.in_batches.delete_all # => 42

    Fixes #​40287.

    Eugene Kenny

  • Add support for PostgreSQL interval data type with conversion to
    ActiveSupport::Duration when loading records from database and
    serialization 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:

    attribute :duration, :interval
    

    To keep old behavior until 6.2 is released:

    attribute :duration, :string
    

    Example:

    create_table :events do |t|
      t.string   :name
      t.interval :duration
    end
    
    class Event < ApplicationRecord
      attribute :duration, :interval
    end
    
    Event.create!(name: 'Rock Fest', duration: 2.days)
    Event.last.duration # => 2 days
    Event.last.duration.iso8601 # => "P2D"
    Event.new(duration: 'P1DT12H3S').duration # => 1 day, 12 hours, and 3 seconds
    Event.new(duration: '1 day') # Unknown value will be ignored and NULL will be written to database
    

    Andrey Novikov

  • Allow associations supporting the dependent: key to take dependent: :destroy_async.

    class Account < ActiveRecord::Base
        belongs_to :supplier, dependent: :destroy_async
    end

    :destroy_async will 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_DATABASE environment variable to disable modifying the test database when rails db:create and rails db:drop are called.

    Jason Schweier

  • connects_to can only be called on ActiveRecord::Base or abstract classes.

    Ensure that connects_to can only be called from ActiveRecord::Base or abstract classes. This protects the application from opening duplicate or too many connections.

    Eileen M. Uchitelle, John Crepezzi

  • All connection adapters execute now raises ActiveRecord::ConnectionNotEstablished rather than
    ActiveRecord::StatementInvalid when they encounter a connection error.

    Jean Boussier

  • Mysql2Adapter#quote_string now raises ActiveRecord::ConnectionNotEstablished rather than
    ActiveRecord::StatementInvalid when it can't connect to the MySQL server.

    Jean Boussier

  • Add support for check constraints that are NOT VALID via validate: 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 where references association names as joined table name aliases.

    class Comment < ActiveRecord::Base
      enum label: [:default, :child]
      has_many :children, class_name: "Comment", foreign_key: :parent_id
    end

... FROM comments LEFT OUTER JOIN comments children ON ... WHERE children.label = 1

Comment.includes(:children).where("children.label": "child")
```

*Ryuta Kamizono*
  • 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_class class attribute.

    Now store_full_class_name class attribute can handle both STI and polymorphic types.

    Ryuta Kamizono

  • Deprecate rails db:structure:{load, dump} tasks and extend
    rails db:schema:{load, dump} tasks to work with either :ruby or :sql format,
    depending on config.active_record.schema_format configuration value.

    fatkodima

  • Respect the select values for eager loading.

    post = Post.select("UPPER(title) AS title").first
    post.title # => "WELCOME TO THE WEBLOG"
    post.body  # => ActiveModel::MissingAttributeError

Rails 6.0 (ignore the select values)

post = Post.select("UPPER(title) AS title").eager_load(:comments).first
post.title # => "Welcome to the weblog"
post.body  # => "Such a lovely day"

Rails 6.1 (respect the select values)

post = Post.select("UPPER(title) AS title").eager_load(:comments).first
post.title # => "WELCOME TO THE WEBLOG"
post.body  # => ActiveModel::MissingAttributeError
```

*Ryuta Kamizono*
  • Allow attribute's default to be configured but keeping its own type.

    class Post < ActiveRecord::Base
      attribute :written_at, default: -> { Time.now.utc }
    end

Rails 6.0

Post.type_for_attribute(:written_at) # => #<Type::Value ... precision: nil, ...>

Rails 6.1

Post.type_for_attribute(:written_at) # => #<Type::DateTime ... precision: 6, ...>
```

*Ryuta Kamizono*
  • Allow default to be configured for Enum.

    class Book < ActiveRecord::Base
      enum status: [:proposed, :written, :published], _default: :published
    end
    
    Book.new.status # => "published"

    Ryuta Kamizono

  • Deprecate YAML loading from legacy format older than Rails 5.0.

    Ryuta Kamizono

  • Added the setting ActiveRecord::Base.immutable_strings_by_default, which
    allows you to specify that all string columns should be frozen unless
    otherwise specified. This will reduce memory pressure for applications which
    do not generally mutate string properties of Active Record objects.

    Sean Griffin, Ryuta Kamizono

  • Deprecate map! and collect! on ActiveRecord::Result.

    Ryuta Kamizono

  • Support relation.and for intersection as Set theory.

    david_and_mary = Author.where(id: [david, mary])
    mary_and_bob   = Author.where(id: [mary, bob])
    
    david_and_mary.merge(mary_and_bob) # => [mary, bob]
    
    david_and_mary.and(mary_and_bob) # => [mary]
    david_and_mary.or(mary_and_bob)  # => [david, mary, bob]

    Ryuta Kamizono

  • Merging conditions on the same column no longer maintain both conditions,
    and will be consistently replaced by the latter condition in Rails 6.2.
    To migrate to Rails 6.2's behavior, use relation.merge(other, rewhere: true).

Rails 6.1 (IN clause is replaced by merger side equality condition)

Author.where(id: [david.id, mary.id]).merge(Author.where(id: bob)) # => [bob]

Rails 6.1 (both conflict conditions exists, deprecated)

Author.where(id: david.id..mary.id).merge(Author.where(id: bob)) # => []

Rails 6.1 with rewhere to migrate to Rails 6.2's behavior

Author.where(id: david.id..mary.id).merge(Author.where(id: bob), rewhere: true) # => [bob]

Rails 6.2 (same behavior with IN clause, mergee side condition is consistently replaced)

Author.where(id: [david.id, mary.id]).merge(Author.where(id: bob)) # => [bob]
Author.where(id: david.id..mary.id).merge(Author.where(id: bob)) # => [bob]
```

*Ryuta Kamizono*
  • Do not mark Postgresql MAC address and UUID attributes as changed when the assigned value only varies by case.

    Peter Fry

  • Resolve issue with insert_all unique_by option when used with expression index.

    When the :unique_by option of ActiveRecord::Persistence.insert_all and
    ActiveRecord::Persistence.upsert_all was used with the name of an expression index, an error
    was raised. Adding a guard around the formatting behavior for the :unique_by corrects this.

    Usage:

    create_table :books, id: :integer, force: true do |t|
      t.column :name, :string
      t.index "lower(name)", unique: true
    end
    
    Book.insert_all [{ name: "MyTest" }], unique_by: :index_books_on_lower_name

    Fixes #​39516.

    Austen Madden

  • Add basic support for CHECK constraints to database migrations.

    Usage:

    add_check_constraint :products, "price > 0", name: "price_check"
    remove_check_constraint :products, name: "price_check"

    fatkodima

  • Add ActiveRecord::Base.strict_loading_by_default and ActiveRecord::Base.strict_loading_by_default=
    to enable/disable strict_loading mode by default for a model. The configuration's value is
    inheritable by subclasses, but they can override that value and it will not impact parent class.

    Usage:

    class Developer < ApplicationRecord
      self.strict_loading_by_default = true
    
      has_many :projects
    end
    
    dev = Developer.first
    dev.projects.first

=> ActiveRecord::StrictLoadingViolationError Exception: Developer is marked as strict_loading and Project cannot be lazily loaded.

```

*bogdanvlviv*
  • Deprecate passing an Active Record object to quote/type_cast directly.

    Ryuta Kamizono

  • Default engine ENGINE=InnoDB is no longer dumped to make schema more agnostic.

    Before:

    create_table "accounts", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", force: :cascade do |t|
    end

    After:

    create_table "accounts", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    end

    Ryuta Kamizono

  • Added delegated type as an alternative to single-table inheritance for representing class hierarchies.
    See ActiveRecord::DelegatedType for the full description.

    DHH

  • Deprecate aggregations with group by duplicated fields.

    To migrate to Rails 6.2's behavior, use uniq!(:group) to deduplicate group fields.

    accounts = Account.group(:firm_id)

duplicated group fields, deprecated.

accounts.merge(accounts.where.not(credit_limit: nil)).sum(:credit_limit)

=> {

[1, 1] => 50,

[2, 2] => 60

}

use uniq!(:group) to deduplicate group fields.

accounts.merge(accounts.where.not(credit_limit: nil)).uniq!(:group).sum(:credit_limit)

=> {

1 => 50,

2 => 60

}

```

*Ryuta Kamizono*
  • Deprecate duplicated query annotations.

    To migrate to Rails 6.2's behavior, use uniq!(:annotate) to deduplicate query annotations.

    accounts = Account.where(id: [1, 2]).annotate("david and mary")

duplicated annotations, deprecated.

accounts.merge(accounts.rewhere(id: 3))

SELECT accounts.* FROM accounts WHERE accounts.id = 3 /* david and mary / / david and mary */

use uniq!(:annotate) to deduplicate annotations.

accounts.merge(accounts.rewhere(id: 3)).uniq!(:annotate)

SELECT accounts.* FROM accounts WHERE accounts.id = 3 /* david and mary */

```

*Ryuta Kamizono*
  • Resolve conflict between counter cache and optimistic locking.

    Bump an Active Record instance's lock version after updating its counter
    cache. This avoids raising an unnecessary ActiveRecord::StaleObjectError
    upon subsequent transactions by maintaining parity with the corresponding
    database record's lock_version column.

    Fixes #​16449.

    Aaron Lipman

  • Support merging option :rewhere to allow mergee side condition to be replaced exactly.

    david_and_mary = Author.where(id: david.id..mary.id)

both conflict conditions exists

david_and_mary.merge(Author.where(id: bob)) # => []

mergee side condition is replaced by rewhere

david_and_mary.merge(Author.rewhere(id: bob)) # => [bob]

mergee side condition is replaced by rewhere option

david_and_mary.merge(Author.where(id: bob), rewhere: true) # => [bob]
```

*Ryuta Kamizono*
  • Add support for finding records based on signed ids, which are tamper-proof, verified ids that can be
    set to expire and scoped with a purpose. This is particularly useful for things like password reset
    or email verification, where you want the bearer of the signed id to be able to interact with the
    underlying record, but usually only within a certain time period.

    signed_id = User.first.signed_id expires_in: 15.minutes, purpose: :password_reset
    
    User.find_signed signed_id # => nil, since the purpose does not match
    
    travel 16.minutes
    User.find_signed signed_id, purpose: :password_reset # => nil, since the signed id has expired
    
    travel_back
    User.find_signed signed_id, purpose: :password_reset # => User.first
    
    User.find_signed! "bad data" # => ActiveSupport::MessageVerifier::InvalidSignature

    DHH

  • Support ALGORITHM = INSTANT DDL option for index operations on MySQL.

    Ryuta Kamizono

  • Fix index creation to preserve index comment in bulk change table on MySQL.

    Ryuta Kamizono

  • Allow unscope to be aware of table name qualified values.

    It is possible to unscope only the column in the specified table.

    posts = Post.joins(:comments).group(:"posts.hidden")
    posts = posts.where("posts.hidden": false, "comments.hidden": false)
    
    posts.count

=> { false => 10 }

unscope both hidden columns

posts.unscope(where: :hidden).count

=> { false => 11, true => 1 }

unscope only comments.hidden column

posts.unscope(where: :"comments.hidden").count

=> { false => 11 }

```

*Ryuta Kamizono*, *Slava Korolev*
  • Fix rewhere to truly overwrite collided where clause by new where clause.

    steve = Person.find_by(name: "Steve")
    david = Author.find_by(name: "David")
    
    relation = Essay.where(writer: steve)

Before

relation.rewhere(writer: david).to_a # => []

After

relation.rewhere(writer: david).to_a # => [david]
```

*Ryuta Kamizono*
  • Inspect time attributes with subsec and time zone offset.

    p Knot.create
    => #<Knot id: 1, created_at: "2016-05-05 01:29:47.116928000 +0000">

    akinomaeni, Jonathan Hefner

  • Deprecate passing a column to type_cast.

    Ryuta Kamizono

  • Deprecate in_clause_length and allowed_index_name_length in DatabaseLimits.

    Ryuta Kamizono

  • Support bulk insert/upsert on relation to preserve scope values.

    Josef Šimánek, Ryuta Kamizono

  • Preserve column comment value on changing column name on MySQL.

    Islam Taha

  • Add support for if_exists option for removing an index.

    The remove_index method can take an if_exists option. If this is set to true an error won't be raised if the index doesn't exist.

    Eileen M. Uchitelle

  • Remove ibm_db, informix, mssql, oracle, and oracle12 Arel visitors which are not used in the code base.

    Ryuta Kamizono

  • Prevent build_association from touching a parent record if the record isn't persisted for has_one associations.

    Fixes #​38219.

    Josh Brody

  • Add support for if_not_exists option for adding index.

    The add_index method respects if_not_exists option. If it is set to true
    index won't be added.

    Usage:

      add_index :users, :account_id, if_not_exists: true

    The if_not_exists option passed to create_table also gets propagated to indexes
    created within that migration so that if table and its indexes exist then there is no
    attempt to create them again.

    Prathamesh Sonpatki

  • Add ActiveRecord::Base#previously_new_record? to show if a record was new before the last save.

    Tom Ward

  • Support descending order for find_each, find_in_batches, and in_batches.

    Batch processing methods allow you to work with the records in batches, greatly reducing memory consumption, but records are always batched from oldest id to newest.

    This change allows reversing the order, batching from newest to oldest. This is useful when you need to process newer batches of records first.

    Pass order: :desc to yield batches in descending order. The default remains order: :asc.

    Person.find_each(order: :desc) do |person|
      person.party_all_night!
    end

    Alexey Vasiliev

  • Fix insert_all with enum values.

    Fixes #​38716.

    Joel Blum

  • Add support for db:rollback:name for multiple database applications.

    Multiple database applications will now raise if db:rollback is call and recommend using the db:rollback:[NAME] to rollback migrations.

    Eileen M. Uchitelle

  • Relation#pick now uses already loaded results instead of making another query.

    Eugene Kenny

  • Deprecate using return, break or throw to exit a transaction block after writes.

    Dylan Thacker-Smith

  • Dump the schema or structure of a database when calling db:migrate:name.

    In previous versions of Rails, rails db:migrate would dump the schema of the database. In Rails 6, that holds true (rails db:migrate dumps all databases' schemas), but rails db:migrate:name does not share that behavior.

    Going forward, calls to rails db:migrate:name will dump the schema (or structure) of the database being migrated.

    Kyle Thompson

  • Reset the ActiveRecord::Base connection after rails db:migrate:name.

    When rails db:migrate has finished, it ensures the ActiveRecord::Base connection is reset to its original configuration. Going forward, rails db:migrate:name will have the same behavior.

    Kyle Thompson

  • Disallow calling connected_to on subclasses of ActiveRecord::Base.

    Behavior has not changed here but the previous API could be misleading to people who thought it would switch connections for only that class. connected_to switches the context from which we are getting connections, not the connections themselves.

    Eileen M. Uchitelle, John Crepezzi

  • Add support for horizontal sharding to connects_to and connected_to.

    Applications can now connect to multiple shards and switch between their shards in an application. Note that the shard swapping is still a manual process as this change does not include an API for automatic shard swapping.

    Usage:

    Given the following configuration:

config/database.yml

production:
  primary:
    database: my_database
  primary_shard_one:
    database: my_database_shard_one
```

Connect to multiple shards:

```ruby
class ApplicationRecord < ActiveRecord::Base
  self.abstract_class = true

  connects_to shards: {
    default: { writing: :primary },
    shard_one: { writing: :primary_shard_one }
  }
```

Swap between shards in your controller / model code:

```ruby
ActiveRecord::Base.connected_to(shard: :shard_one) do

Read from shard one

end
```

The horizontal sharding API also supports read replicas. See guides for more details.

*Eileen M. Uchitelle*, *John Crepezzi*
  • Deprecate spec_name in favor of name on database configurations.

    The accessors for spec_name on configs_for and DatabaseConfig are deprecated. Please use name instead.

    Deprecated behavior:

    db_config = ActiveRecord::Base.configs_for(env_name: "development", spec_name: "primary")
    db_config.spec_name

    New behavior:

    db_config = ActiveRecord::Base.configs_for(env_name: "development", name: "primary")
    db_config.name

    Eileen M. Uchitelle

  • Add additional database-specific rake tasks for multi-database users.

    Previously, rails db:create, rails db:drop, and rails db:migrate were the only rails tasks that could operate on a single
    database. For example:

    rails db:create
    rails db:create:primary
    rails db:create:animals
    rails db:drop
    rails db:drop:primary
    rails db:drop:animals
    rails db:migrate
    rails db:migrate:primary
    rails db:migrate:animals
    

    With these changes, rails db:schema:dump, rails db:schema:load, rails db:structure:dump, rails db:structure:load and
    rails db:test:prepare can additionally operate on a single database. For example:

    rails db:schema:dump
    rails db:schema:dump:primary
    rails db:schema:dump:animals
    rails db:schema:load
    rails db:schema:load:primary
    rails db:schema:load:animals
    rails db:structure:dump
    rails db:structure:dump:primary
    rails db:structure:dump:animals
    rails db:structure:load
    rails db:structure:load:primary
    rails db:structure:load:animals
    rails db:test:prepare
    rails db:test:prepare
    

Configuration

📅 Schedule: 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.


  • If you want to rebase/retry this PR, check this box.

This PR has been generated by WhiteSource Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/rails-activestorage-6.x branch from c10cec4 to dd6c32f Compare August 19, 2021 17:10
@renovate renovate bot changed the title Update dependency @rails/activestorage to v6.1.4 Update dependency @rails/activestorage to v6.1.3 Aug 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant