Skip to content

Releases: kaspth/active_record-associated_object

v0.8.3

13 Dec 22:27
64f57b9
Compare
Choose a tag to compare

What's Changed

  • Mention seats & entitlements style naming recommendation in README by @kaspth in 0e207cb
  • Mention RubyVideo's usage for new users to learn how these work by @kaspth in d239990
  • Document how to write Polymorphic Associated Objects via modules by @kaspth in #30
  • Fix ActiveJob::Performs not being automatically extended by @kaspth in #31

Full Changelog: v0.8.2...v0.8.3

v0.8.2

11 Oct 16:28
f9204ca
Compare
Choose a tag to compare

What's Changed

  • Fix generated associated_object_path for CamelCase class names by @itsameandrea in #26

New Contributors

Full Changelog: v0.8.1...v0.8.2

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