active_record-associated_object 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d24bf37946a6b4e5ddcb1626e90eb91e27932ae8d9f8f29c10c095ce3c53897c
4
- data.tar.gz: 7f7d23788109d020fb1b010e8e6f3956880dfeb012c517dfc43e1f5c7862fd6c
3
+ metadata.gz: 4b86335fcc0e7c367775d2f21fef7537a39c847022ef83feebc1bd68ed21baf1
4
+ data.tar.gz: b2031efb700cccd28eb7b4414ee4bb8a4e45c4bd0912658f4d54301188987cec
5
5
  SHA512:
6
- metadata.gz: 72675998afa72ea4117fd3601e9df6c9dbd2f62ae1541e1b6677903dd5c32109bd06c281e9be98d7742b92dcf6e48f2792764a5c661729ef2df95d6ce54cd2c4
7
- data.tar.gz: 3d4244067099adec3ac04a185019bd99aba3078578ede15315893eb6c8f6b9a98cf8cd6356e74e37a395f39ec20013e83529ab6f9766dd014f154d3d03591718
6
+ metadata.gz: 664b086f82fcaa6c7029d7e3b44cc4fb8cbeaa581761927054cf80bfddad26cd63b12504a380f00109926e23310ef7bcef4970f99acb5c6b7397080d0410b64d
7
+ data.tar.gz: 0b3053a708426b83fcbe233394aed806347e8dc74d6305b2a19221de21b30f25e70a8c0e9918b62255639d6d6ac4e3f77a01a514efb98522bd1db78a5a217216
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_record-associated_object (0.7.0)
4
+ active_record-associated_object (0.7.1)
5
5
  activerecord (>= 6.1)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -194,6 +194,10 @@ And about a month later it was still holding up:
194
194
 
195
195
  > Just checking in to say we've added like another 4 associated objects to production since my last message. `ActiveRecord::AssociatedObject` + `ActiveJob::Performs` is like a 1-2 punch super power. I'm a bit surprised that this isn't Rails core to be honest. I want to migrate so much of our code over to this. It feels much more organized and sane. Then my app/jobs folder won't have much in it because most jobs will actually be via some associated object's _later method. app/jobs will then basically be cron-type things (deactivate any expired subscriptions).
196
196
 
197
+ Here's what [@nshki](https://github.com/nshki) found when they tried it:
198
+
199
+ > Spent some time playing with [@kaspth](https://github.com/kaspth)'s `ActiveRecord::AssociatedObject` and `ActiveJob::Performs` and wow! The conventions these gems put in place help simplify a codebase drastically. I particularly love `ActiveJob::Performs`—it helped me refactor out all `ApplicationJob` classes I had and keep important context in the right domain model.
200
+
197
201
  Let's look at testing, then we'll get to passing these POROs to jobs like the quotes mentioned!
198
202
 
199
203
  ### A Quick Aside: Testing Associated Objects
@@ -14,7 +14,7 @@ module ActiveRecord::AssociatedObject::ObjectAssociation
14
14
  module ClassMethods
15
15
  def has_object(*names, **callbacks)
16
16
  extend_source_from(names) do |name|
17
- "def #{name}; (@associated_objects ||= {})[:#{name}] ||= #{name.to_s.classify}.new(self); end"
17
+ "def #{name}; (@associated_objects ||= {})[:#{name}] ||= #{const_get(name.to_s.classify)}.new(self); end"
18
18
  end
19
19
 
20
20
  extend_source_from(names) do |name|
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecord
4
4
  class AssociatedObject
5
- VERSION = "0.7.0"
5
+ VERSION = "0.7.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record-associated_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Timm Hansen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-07 00:00:00.000000000 Z
11
+ date: 2024-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  requirements: []
68
- rubygems_version: 3.5.3
68
+ rubygems_version: 3.5.4
69
69
  signing_key:
70
70
  specification_version: 4
71
71
  summary: Associate a Ruby PORO with an Active Record class and have it quack like