Skip to content

Releases: kaspth/active_record-associated_object

v0.8.1

19 May 00:07
fe37f16
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.8.0...v0.8.1

v0.8.0

13 May 21:30
23bd379
Compare
Choose a tag to compare

What's Changed

  • has_object: support plural Associated Object names by @kaspth in #22

Full Changelog: v0.7.1...v0.8.0

v0.7.1

24 Jan 17:04
1ee7571
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.7.0...v0.7.1

v0.7.0

07 Jan 21:44
ac56363
Compare
Choose a tag to compare

What's Changed

  • Improve object shape friendliness by @natematykiewicz in #20, see also 16ae755 for documentation changes.

  • Allow Associated Objects to extend their Active Record by @kaspth in #19
    This changes Associated Object classes to be eager-loaded when has_object is called.

    Then we can add an extension method to integrate into the Active Record class:

    class Post < ApplicationRecord
      has_object :publisher
    end
    
    # app/models/post/publisher.rb
    class Post::Publisher < ActiveRecord::AssociatedObject
      extension do
        # Here we're within Post and can extend it:
        has_many :contracts, dependent: :destroy do
          def signed? = all?(&:signed?)
        end
    
        def self.with_contracts = includes(:contracts)
    
        after_create_commit :publish_later, if: -> { contracts.signed? }
    
        # An integrating method that operates on `publisher`.
        private def publish_later = publisher.publish_later
      end
    end

    See the README section for more detail.

Internal changes

  • Bump supercharge/redis-github-action from 1.7.0 to 1.8.0 by @dependabot in #17
  • README: Link to active_job-performs [ci skip] by @olleolleolle in #18

Full Changelog: v0.6.0...v0.7.0

v0.6.0

18 Dec 17:18
c86f5bb
Compare
Choose a tag to compare

What's Changed

  • Refit entire explanation in README by @kaspth in #15
    Hopefully this should explain more of what this gem is aiming to do and is easier to share with coworkers, if you're looking to adopt this gem.

  • Minimally require Ruby 3.0 by @kaspth in #16
    We were already requiring Ruby 3.0, but it just wasn't reflected in the gemspec.

Full Changelog: v0.5.2...v0.6.0

v0.5.2

13 Nov 18:38
d369f87
Compare
Choose a tag to compare

What's Changed

  • Fix eager loading a Rails app with performs in an associated object by @natematykiewicz in #14

Full Changelog: v0.5.1...v0.5.2

v0.5.1

05 Nov 21:25
6255ab4
Compare
Choose a tag to compare

What's Changed

  • Drop outdated comments from active_record-associated_object.gemspec by @olleolleolle in #11
  • Test support for Active Record's composite primary keys by @kaspth in #12
  • Mention composite primary key support by @kaspth in 0c1f932
  • Add support for namespaced models by @kaspth in #13

Full Changelog: v0.5.0...v0.5.1

v0.5.0

04 Nov 17:12
4b21fe4
Compare
Choose a tag to compare

What's Changed

Breaking change

  • Make active_job-performs an optional dependency by @kaspth in #10

To update and get the same behavior, you must explicitly put active_job-performs in your Gemfile:

gem "active_job-performs"
gem "active_record-associated_object"

Fixes

Full Changelog: v0.4.1...v0.5.0

v0.4.1

31 Oct 19:32
1232c38
Compare
Choose a tag to compare

What's Changed

Maintenance

New Contributors

Full Changelog: v0.4.0...v0.4.1