active_record-associated_object 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.tool-versions +1 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +100 -63
- data/active_record-associated_object.gemspec +0 -1
- data/lib/active_record/associated_object/railtie.rb +9 -5
- data/lib/active_record/associated_object/version.rb +1 -1
- data/lib/active_record/associated_object.rb +6 -5
- metadata +4 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f8b62e508398ddb7a6822eab1ddd89f744bf4f795f6a824c0f1af9501878d2a
|
4
|
+
data.tar.gz: 22e627a8a19fd92f4ea188252550fda880df8da7d847bb9bb47e4e15afd84ddf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e0267e09ed36917900870a7c76f515fcc7328730e60c11e525cb9610622edc03cd471e900bbec67e7a6a0f98933cde466e9804d77ab8681976e06bdcd3e6810
|
7
|
+
data.tar.gz: 3bec7180bb66a6219791a65ca76a51a384594333c3d2babe5dd8f13e2b61d8eb9be9f6a3b0a910ea2e56b972e82dc010c46a22b52841f6ba860615bebe9bd4f0
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.2.2
|
data/Gemfile
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
# Specify your gem's dependencies in active_record-associated_object.gemspec
|
6
5
|
gemspec
|
7
6
|
|
8
7
|
gem "rake", "~> 13.0"
|
@@ -14,6 +13,7 @@ gem "sqlite3"
|
|
14
13
|
# Integrations to setup and test with.
|
15
14
|
gem "kredis"
|
16
15
|
gem "activejob"
|
16
|
+
gem "active_job-performs"
|
17
17
|
gem "railties"
|
18
18
|
|
19
19
|
gem "minitest-sprint", "~> 1.2"
|
data/Gemfile.lock
CHANGED
@@ -1,101 +1,138 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
active_record-associated_object (0.
|
5
|
-
active_job-performs
|
4
|
+
active_record-associated_object (0.5.0)
|
6
5
|
activerecord (>= 6.1)
|
7
6
|
|
8
7
|
GEM
|
9
8
|
remote: https://rubygems.org/
|
10
9
|
specs:
|
11
|
-
actionpack (7.
|
12
|
-
actionview (= 7.
|
13
|
-
activesupport (= 7.
|
14
|
-
|
10
|
+
actionpack (7.1.1)
|
11
|
+
actionview (= 7.1.1)
|
12
|
+
activesupport (= 7.1.1)
|
13
|
+
nokogiri (>= 1.8.5)
|
14
|
+
rack (>= 2.2.4)
|
15
|
+
rack-session (>= 1.0.1)
|
15
16
|
rack-test (>= 0.6.3)
|
16
|
-
rails-dom-testing (~> 2.
|
17
|
-
rails-html-sanitizer (~> 1.
|
18
|
-
actionview (7.
|
19
|
-
activesupport (= 7.
|
17
|
+
rails-dom-testing (~> 2.2)
|
18
|
+
rails-html-sanitizer (~> 1.6)
|
19
|
+
actionview (7.1.1)
|
20
|
+
activesupport (= 7.1.1)
|
20
21
|
builder (~> 3.1)
|
21
|
-
erubi (~> 1.
|
22
|
-
rails-dom-testing (~> 2.
|
23
|
-
rails-html-sanitizer (~> 1.
|
24
|
-
active_job-performs (0.
|
22
|
+
erubi (~> 1.11)
|
23
|
+
rails-dom-testing (~> 2.2)
|
24
|
+
rails-html-sanitizer (~> 1.6)
|
25
|
+
active_job-performs (0.2.0)
|
25
26
|
activejob (>= 6.1)
|
26
|
-
activejob (7.
|
27
|
-
activesupport (= 7.
|
27
|
+
activejob (7.1.1)
|
28
|
+
activesupport (= 7.1.1)
|
28
29
|
globalid (>= 0.3.6)
|
29
|
-
activemodel (7.
|
30
|
-
activesupport (= 7.
|
31
|
-
activerecord (7.
|
32
|
-
activemodel (= 7.
|
33
|
-
activesupport (= 7.
|
34
|
-
|
30
|
+
activemodel (7.1.1)
|
31
|
+
activesupport (= 7.1.1)
|
32
|
+
activerecord (7.1.1)
|
33
|
+
activemodel (= 7.1.1)
|
34
|
+
activesupport (= 7.1.1)
|
35
|
+
timeout (>= 0.4.0)
|
36
|
+
activesupport (7.1.1)
|
37
|
+
base64
|
38
|
+
bigdecimal
|
35
39
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
40
|
+
connection_pool (>= 2.2.5)
|
41
|
+
drb
|
36
42
|
i18n (>= 1.6, < 2)
|
37
43
|
minitest (>= 5.1)
|
44
|
+
mutex_m
|
38
45
|
tzinfo (~> 2.0)
|
46
|
+
base64 (0.1.1)
|
47
|
+
bigdecimal (3.1.4)
|
39
48
|
builder (3.2.4)
|
40
|
-
concurrent-ruby (1.
|
49
|
+
concurrent-ruby (1.2.2)
|
50
|
+
connection_pool (2.4.1)
|
41
51
|
crass (1.0.6)
|
42
|
-
debug (1.
|
43
|
-
irb (>= 1.
|
44
|
-
reline (>= 0.
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
52
|
+
debug (1.8.0)
|
53
|
+
irb (>= 1.5.0)
|
54
|
+
reline (>= 0.3.1)
|
55
|
+
drb (2.1.1)
|
56
|
+
ruby2_keywords
|
57
|
+
erubi (1.12.0)
|
58
|
+
globalid (1.2.1)
|
59
|
+
activesupport (>= 6.1)
|
60
|
+
i18n (1.14.1)
|
49
61
|
concurrent-ruby (~> 1.0)
|
50
|
-
io-console (0.
|
51
|
-
irb (1.
|
52
|
-
|
53
|
-
|
62
|
+
io-console (0.6.0)
|
63
|
+
irb (1.8.3)
|
64
|
+
rdoc
|
65
|
+
reline (>= 0.3.8)
|
66
|
+
kredis (1.6.0)
|
67
|
+
activemodel (>= 6.0.0)
|
54
68
|
activesupport (>= 6.0.0)
|
55
|
-
redis (
|
56
|
-
loofah (2.
|
69
|
+
redis (>= 4.2, < 6)
|
70
|
+
loofah (2.21.4)
|
57
71
|
crass (~> 1.0.2)
|
58
|
-
nokogiri (>= 1.
|
59
|
-
|
60
|
-
minitest (5.15.0)
|
72
|
+
nokogiri (>= 1.12.0)
|
73
|
+
minitest (5.20.0)
|
61
74
|
minitest-sprint (1.2.2)
|
62
75
|
path_expander (~> 1.1)
|
63
|
-
|
76
|
+
mutex_m (0.1.2)
|
77
|
+
nokogiri (1.15.4-arm64-darwin)
|
64
78
|
racc (~> 1.4)
|
65
|
-
nokogiri (1.
|
79
|
+
nokogiri (1.15.4-x86_64-linux)
|
66
80
|
racc (~> 1.4)
|
67
81
|
path_expander (1.1.1)
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
82
|
+
psych (5.1.1.1)
|
83
|
+
stringio
|
84
|
+
racc (1.7.1)
|
85
|
+
rack (3.0.8)
|
86
|
+
rack-session (2.0.0)
|
87
|
+
rack (>= 3.0.0)
|
88
|
+
rack-test (2.1.0)
|
89
|
+
rack (>= 1.3)
|
90
|
+
rackup (2.1.0)
|
91
|
+
rack (>= 3)
|
92
|
+
webrick (~> 1.8)
|
93
|
+
rails-dom-testing (2.2.0)
|
94
|
+
activesupport (>= 5.0.0)
|
95
|
+
minitest
|
74
96
|
nokogiri (>= 1.6)
|
75
|
-
rails-html-sanitizer (1.
|
76
|
-
loofah (~> 2.
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
97
|
+
rails-html-sanitizer (1.6.0)
|
98
|
+
loofah (~> 2.21)
|
99
|
+
nokogiri (~> 1.14)
|
100
|
+
railties (7.1.1)
|
101
|
+
actionpack (= 7.1.1)
|
102
|
+
activesupport (= 7.1.1)
|
103
|
+
irb
|
104
|
+
rackup (>= 1.0.0)
|
81
105
|
rake (>= 12.2)
|
82
|
-
thor (~> 1.0)
|
83
|
-
zeitwerk (~> 2.
|
84
|
-
rake (13.0
|
85
|
-
|
86
|
-
|
106
|
+
thor (~> 1.0, >= 1.2.2)
|
107
|
+
zeitwerk (~> 2.6)
|
108
|
+
rake (13.1.0)
|
109
|
+
rdoc (6.5.0)
|
110
|
+
psych (>= 4.0.0)
|
111
|
+
redis (5.0.8)
|
112
|
+
redis-client (>= 0.17.0)
|
113
|
+
redis-client (0.18.0)
|
114
|
+
connection_pool
|
115
|
+
reline (0.3.9)
|
87
116
|
io-console (~> 0.5)
|
88
|
-
|
89
|
-
|
90
|
-
|
117
|
+
ruby2_keywords (0.0.5)
|
118
|
+
sqlite3 (1.6.7-arm64-darwin)
|
119
|
+
sqlite3 (1.6.7-x86_64-linux)
|
120
|
+
stringio (3.0.8)
|
121
|
+
thor (1.3.0)
|
122
|
+
timeout (0.4.0)
|
123
|
+
tzinfo (2.0.6)
|
91
124
|
concurrent-ruby (~> 1.0)
|
92
|
-
|
125
|
+
webrick (1.8.1)
|
126
|
+
zeitwerk (2.6.12)
|
93
127
|
|
94
128
|
PLATFORMS
|
95
129
|
arm64-darwin-20
|
130
|
+
arm64-darwin-21
|
131
|
+
arm64-darwin-22
|
96
132
|
x86_64-linux
|
97
133
|
|
98
134
|
DEPENDENCIES
|
135
|
+
active_job-performs
|
99
136
|
active_record-associated_object!
|
100
137
|
activejob
|
101
138
|
debug
|
@@ -107,4 +144,4 @@ DEPENDENCIES
|
|
107
144
|
sqlite3
|
108
145
|
|
109
146
|
BUNDLED WITH
|
110
|
-
2.
|
147
|
+
2.4.21
|
@@ -28,7 +28,6 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
# Uncomment to register a new dependency of your gem
|
30
30
|
spec.add_dependency "activerecord", ">= 6.1"
|
31
|
-
spec.add_dependency "active_job-performs"
|
32
31
|
|
33
32
|
# For more information and examples about making a new gem, check out our
|
34
33
|
# guide at: https://bundler.io/guides/creating_gem.html
|
@@ -1,11 +1,15 @@
|
|
1
1
|
class ActiveRecord::AssociatedObject::Railtie < Rails::Railtie
|
2
2
|
initializer "integrations.include" do
|
3
|
-
|
4
|
-
|
3
|
+
config.after_initialize do
|
4
|
+
ActiveRecord::AssociatedObject.include Kredis::Attributes if defined?(Kredis)
|
5
|
+
ActiveRecord::AssociatedObject.include GlobalID::Identification if defined?(GlobalID)
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
ActiveSupport.on_load :active_job do
|
8
|
+
require "active_job/performs"
|
9
|
+
ActiveRecord::AssociatedObject.extend ActiveJob::Performs
|
10
|
+
rescue LoadError
|
11
|
+
# We haven't bundled active_job-performs, so we're continuing without it.
|
12
|
+
end
|
9
13
|
end
|
10
14
|
end
|
11
15
|
|
@@ -9,14 +9,14 @@ class ActiveRecord::AssociatedObject
|
|
9
9
|
raise ArgumentError, "#{record_klass} isn't valid; can only associate with ActiveRecord::Base subclasses"
|
10
10
|
end
|
11
11
|
|
12
|
-
alias_method record_name, :record
|
13
|
-
define_singleton_method(:record_klass) { record_klass }
|
14
|
-
define_singleton_method(:attribute_name) { attribute_name }
|
15
|
-
delegate :record_klass, :attribute_name, to: :class
|
12
|
+
klass.alias_method record_name, :record
|
13
|
+
klass.define_singleton_method(:record_klass) { record_klass }
|
14
|
+
klass.define_singleton_method(:attribute_name) { attribute_name }
|
15
|
+
klass.delegate :record_klass, :attribute_name, to: :class
|
16
16
|
end
|
17
17
|
|
18
18
|
def respond_to_missing?(...) = record_klass.respond_to?(...) || super
|
19
|
-
delegate :unscoped, :transaction, to: :record_klass
|
19
|
+
delegate :unscoped, :transaction, :primary_key, to: :record_klass
|
20
20
|
|
21
21
|
def method_missing(method, ...)
|
22
22
|
if !record_klass.respond_to?(method) then super else
|
@@ -39,4 +39,5 @@ class ActiveRecord::AssociatedObject
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
require_relative "associated_object/version"
|
42
43
|
require_relative "associated_object/railtie" if defined?(Rails::Railtie)
|
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.
|
4
|
+
version: 0.5.0
|
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:
|
11
|
+
date: 2023-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '6.1'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: active_job-performs
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
description:
|
42
28
|
email:
|
43
29
|
- hey@kaspth.com
|
@@ -45,6 +31,7 @@ executables: []
|
|
45
31
|
extensions: []
|
46
32
|
extra_rdoc_files: []
|
47
33
|
files:
|
34
|
+
- ".tool-versions"
|
48
35
|
- CHANGELOG.md
|
49
36
|
- Gemfile
|
50
37
|
- Gemfile.lock
|
@@ -78,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
65
|
- !ruby/object:Gem::Version
|
79
66
|
version: '0'
|
80
67
|
requirements: []
|
81
|
-
rubygems_version: 3.
|
68
|
+
rubygems_version: 3.4.19
|
82
69
|
signing_key:
|
83
70
|
specification_version: 4
|
84
71
|
summary: Associate a Ruby PORO with an Active Record class and have it quack like
|