1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/CHANGELOG.md
Graham Turner b07b97057f Loaded associations should not run a new query when size is called
Already loaded associations were running an extra query when `size` was called on the association.
This fix ensures that an extra query is no longer run.

Update tests to use proper methods
2018-04-26 12:41:15 -04:00

1.2 KiB

  • Ensure Associations::CollectionAssociation#size and Associations::CollectionAssociation#empty? use loaded association ids if present.

    Graham Turner

  • Add support to preload associations of polymorphic associations when not all the records have the requested associations.

    Dana Sherson

  • Add touch_all method to ActiveRecord::Relation.

    Example:

    Person.where(name: "David").touch_all(time: Time.new(2020, 5, 16, 0, 0, 0))
    

    fatkodima, duggiefresh

  • Add ActiveRecord::Base.base_class? predicate.

    Bogdan Gusiev

  • Add custom prefix option to ActiveRecord::Store.store_accessor.

    Tan Huynh

  • Rails 6 requires Ruby 2.4.1 or newer.

    Jeremy Daer

  • Deprecate update_attributes/! in favor of update/!.

    Eddie Lebow

  • Add ActiveRecord::Base.create_or_find_by/! to deal with the SELECT/INSERT race condition in ActiveRecord::Base.find_or_create_by/! by leaning on unique constraints in the database.

    DHH

  • Add Relation#pick as short-hand for single-value plucks.

    DHH

Please check 5-2-stable for previous changes.