esse-active_record 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +9 -6
- data/ci/Gemfile.rails-5.2 +1 -1
- data/ci/Gemfile.rails-5.2.lock +7 -4
- data/ci/Gemfile.rails-6.0 +1 -1
- data/ci/Gemfile.rails-6.0.lock +7 -4
- data/ci/Gemfile.rails-6.1 +1 -1
- data/ci/Gemfile.rails-6.1.lock +7 -4
- data/ci/Gemfile.rails-7.0 +1 -1
- data/ci/Gemfile.rails-7.0.lock +7 -4
- data/ci/Gemfile.rails-7.1 +1 -1
- data/ci/Gemfile.rails-7.1.lock +7 -4
- data/ci/Gemfile.rails-7.2 +10 -0
- data/ci/Gemfile.rails-7.2.lock +175 -0
- data/ci/Gemfile.rails-8.0 +10 -0
- data/ci/Gemfile.rails-8.0.lock +176 -0
- data/lib/esse/active_record/hooks.rb +1 -200
- data/lib/esse/active_record/version.rb +1 -1
- data/lib/esse/active_record.rb +1 -0
- data/mise.toml +2 -0
- metadata +21 -9
- data/sig/esse/active_record.rbs +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9be3efa18e5885d347b2c7d0c4e3a375fdeb02c3ecf9248aa23f59d01ad8a2d8
|
4
|
+
data.tar.gz: 922663253cb49433ab91d573b958c544738850c4ab3b958672327402d85a4c5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79578e04aa0b40bb4d48f8765dff744795fcd5d50d6019f5ad0cd2dcc96653369790fc5a94f8d8ae84d8eea7ddce59084805f71391522b7e5b9b6dbd9696f5bf
|
7
|
+
data.tar.gz: 5820f60abd22b193966151cc08f877bf0c0f2b9227fc149020f0e00c344b7f3a6afe83c17b401effed6492dc6b3bf0aa4eccb77d133cef69d28d8fe050b60a94
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## 0.3.9 - 2025-01-21
|
8
|
+
* Move hooks to a separate gem, [esse-hooks](https://github.com/marcosgz/esse-hooks)
|
9
|
+
* Add rails 8 support
|
10
|
+
|
7
11
|
## 0.3.8 - 2024-08-08
|
8
12
|
* Add `connect_with:` option to the collection definition.
|
9
13
|
* Adjust UpdateLazyAttribute callback to not use keyword arguments for better compatibility with older versions of Ruby.
|
data/Gemfile
CHANGED
@@ -7,7 +7,7 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
7
7
|
gem 'esse', '~> 0.3.4'
|
8
8
|
gem 'sqlite3', '~> 1.7.3'
|
9
9
|
gem 'activerecord', '~> 5.2'
|
10
|
-
gem 'esse-rspec'
|
10
|
+
gem 'esse-rspec'
|
11
11
|
gem 'elasticsearch', '~> 7.17', '>= 7.17.10'
|
12
12
|
|
13
13
|
# Specify your gem's dependencies in esse-active_record.gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
esse-active_record (0.3.
|
5
|
-
activerecord (>= 4.2
|
4
|
+
esse-active_record (0.3.9)
|
5
|
+
activerecord (>= 4.2)
|
6
6
|
esse (>= 0.3.0)
|
7
|
+
esse-hooks
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
@@ -39,9 +40,11 @@ GEM
|
|
39
40
|
elasticsearch-transport (7.17.10)
|
40
41
|
faraday (>= 1, < 3)
|
41
42
|
multi_json
|
42
|
-
esse (0.3.
|
43
|
+
esse (0.3.5)
|
43
44
|
multi_json
|
44
45
|
thor (>= 0.19)
|
46
|
+
esse-hooks (0.0.1)
|
47
|
+
esse (>= 0.3.0)
|
45
48
|
esse-rspec (0.0.6)
|
46
49
|
esse (>= 0.2.4)
|
47
50
|
rspec (>= 3)
|
@@ -122,7 +125,7 @@ GEM
|
|
122
125
|
standard-performance (1.0.1)
|
123
126
|
lint_roller (~> 1.0)
|
124
127
|
rubocop-performance (~> 1.16.0)
|
125
|
-
thor (1.3.
|
128
|
+
thor (1.3.2)
|
126
129
|
thread_safe (0.3.6)
|
127
130
|
tzinfo (1.2.11)
|
128
131
|
thread_safe (~> 0.1)
|
@@ -144,7 +147,7 @@ DEPENDENCIES
|
|
144
147
|
elasticsearch (~> 7.17, >= 7.17.10)
|
145
148
|
esse (~> 0.3.4)
|
146
149
|
esse-active_record!
|
147
|
-
esse-rspec
|
150
|
+
esse-rspec
|
148
151
|
pry
|
149
152
|
rake
|
150
153
|
rspec
|
@@ -157,4 +160,4 @@ DEPENDENCIES
|
|
157
160
|
yard
|
158
161
|
|
159
162
|
BUNDLED WITH
|
160
|
-
2.3.
|
163
|
+
2.3.26
|
data/ci/Gemfile.rails-5.2
CHANGED
data/ci/Gemfile.rails-5.2.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
esse-active_record (0.3.
|
5
|
-
activerecord (>= 4.2
|
4
|
+
esse-active_record (0.3.9)
|
5
|
+
activerecord (>= 4.2)
|
6
6
|
esse (>= 0.3.0)
|
7
|
+
esse-hooks
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
@@ -45,6 +46,8 @@ GEM
|
|
45
46
|
esse (0.3.4)
|
46
47
|
multi_json
|
47
48
|
thor (>= 0.19)
|
49
|
+
esse-hooks (0.0.1)
|
50
|
+
esse (>= 0.3.0)
|
48
51
|
esse-rspec (0.0.6)
|
49
52
|
esse (>= 0.2.4)
|
50
53
|
rspec (>= 3)
|
@@ -143,7 +146,7 @@ DEPENDENCIES
|
|
143
146
|
dotenv
|
144
147
|
elasticsearch (~> 7.17, >= 7.17.10)
|
145
148
|
esse-active_record!
|
146
|
-
esse-rspec
|
149
|
+
esse-rspec
|
147
150
|
pry
|
148
151
|
rake
|
149
152
|
rspec
|
@@ -156,4 +159,4 @@ DEPENDENCIES
|
|
156
159
|
yard
|
157
160
|
|
158
161
|
BUNDLED WITH
|
159
|
-
2.3.
|
162
|
+
2.3.26
|
data/ci/Gemfile.rails-6.0
CHANGED
data/ci/Gemfile.rails-6.0.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
esse-active_record (0.3.
|
5
|
-
activerecord (>= 4.2
|
4
|
+
esse-active_record (0.3.9)
|
5
|
+
activerecord (>= 4.2)
|
6
6
|
esse (>= 0.3.0)
|
7
|
+
esse-hooks
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
@@ -44,6 +45,8 @@ GEM
|
|
44
45
|
esse (0.3.4)
|
45
46
|
multi_json
|
46
47
|
thor (>= 0.19)
|
48
|
+
esse-hooks (0.0.1)
|
49
|
+
esse (>= 0.3.0)
|
47
50
|
esse-rspec (0.0.6)
|
48
51
|
esse (>= 0.2.4)
|
49
52
|
rspec (>= 3)
|
@@ -144,7 +147,7 @@ DEPENDENCIES
|
|
144
147
|
dotenv
|
145
148
|
elasticsearch (~> 7.17, >= 7.17.10)
|
146
149
|
esse-active_record!
|
147
|
-
esse-rspec
|
150
|
+
esse-rspec
|
148
151
|
pry
|
149
152
|
rake
|
150
153
|
rspec
|
@@ -157,4 +160,4 @@ DEPENDENCIES
|
|
157
160
|
yard
|
158
161
|
|
159
162
|
BUNDLED WITH
|
160
|
-
2.3.
|
163
|
+
2.3.26
|
data/ci/Gemfile.rails-6.1
CHANGED
data/ci/Gemfile.rails-6.1.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
esse-active_record (0.3.
|
5
|
-
activerecord (>= 4.2
|
4
|
+
esse-active_record (0.3.9)
|
5
|
+
activerecord (>= 4.2)
|
6
6
|
esse (>= 0.3.0)
|
7
|
+
esse-hooks
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
@@ -44,6 +45,8 @@ GEM
|
|
44
45
|
esse (0.3.4)
|
45
46
|
multi_json
|
46
47
|
thor (>= 0.19)
|
48
|
+
esse-hooks (0.0.1)
|
49
|
+
esse (>= 0.3.0)
|
47
50
|
esse-rspec (0.0.6)
|
48
51
|
esse (>= 0.2.4)
|
49
52
|
rspec (>= 3)
|
@@ -144,7 +147,7 @@ DEPENDENCIES
|
|
144
147
|
dotenv
|
145
148
|
elasticsearch (~> 7.17, >= 7.17.10)
|
146
149
|
esse-active_record!
|
147
|
-
esse-rspec
|
150
|
+
esse-rspec
|
148
151
|
pry
|
149
152
|
rake
|
150
153
|
rspec
|
@@ -157,4 +160,4 @@ DEPENDENCIES
|
|
157
160
|
yard
|
158
161
|
|
159
162
|
BUNDLED WITH
|
160
|
-
2.3.
|
163
|
+
2.3.26
|
data/ci/Gemfile.rails-7.0
CHANGED
data/ci/Gemfile.rails-7.0.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
esse-active_record (0.3.
|
5
|
-
activerecord (>= 4.2
|
4
|
+
esse-active_record (0.3.9)
|
5
|
+
activerecord (>= 4.2)
|
6
6
|
esse (>= 0.3.0)
|
7
|
+
esse-hooks
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
@@ -44,6 +45,8 @@ GEM
|
|
44
45
|
esse (0.3.4)
|
45
46
|
multi_json
|
46
47
|
thor (>= 0.19)
|
48
|
+
esse-hooks (0.0.1)
|
49
|
+
esse (>= 0.3.0)
|
47
50
|
esse-rspec (0.0.6)
|
48
51
|
esse (>= 0.2.4)
|
49
52
|
rspec (>= 3)
|
@@ -144,7 +147,7 @@ DEPENDENCIES
|
|
144
147
|
dotenv
|
145
148
|
elasticsearch (~> 7.17, >= 7.17.10)
|
146
149
|
esse-active_record!
|
147
|
-
esse-rspec
|
150
|
+
esse-rspec
|
148
151
|
pry
|
149
152
|
rake
|
150
153
|
rspec
|
@@ -157,4 +160,4 @@ DEPENDENCIES
|
|
157
160
|
yard
|
158
161
|
|
159
162
|
BUNDLED WITH
|
160
|
-
2.3.
|
163
|
+
2.3.26
|
data/ci/Gemfile.rails-7.1
CHANGED
data/ci/Gemfile.rails-7.1.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
esse-active_record (0.3.
|
5
|
-
activerecord (>= 4.2
|
4
|
+
esse-active_record (0.3.9)
|
5
|
+
activerecord (>= 4.2)
|
6
6
|
esse (>= 0.3.0)
|
7
|
+
esse-hooks
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
@@ -51,6 +52,8 @@ GEM
|
|
51
52
|
esse (0.3.4)
|
52
53
|
multi_json
|
53
54
|
thor (>= 0.19)
|
55
|
+
esse-hooks (0.0.1)
|
56
|
+
esse (>= 0.3.0)
|
54
57
|
esse-rspec (0.0.6)
|
55
58
|
esse (>= 0.2.4)
|
56
59
|
rspec (>= 3)
|
@@ -152,7 +155,7 @@ DEPENDENCIES
|
|
152
155
|
dotenv
|
153
156
|
elasticsearch (~> 7.17, >= 7.17.10)
|
154
157
|
esse-active_record!
|
155
|
-
esse-rspec
|
158
|
+
esse-rspec
|
156
159
|
pry
|
157
160
|
rake
|
158
161
|
rspec
|
@@ -165,4 +168,4 @@ DEPENDENCIES
|
|
165
168
|
yard
|
166
169
|
|
167
170
|
BUNDLED WITH
|
168
|
-
2.3.
|
171
|
+
2.3.26
|
@@ -0,0 +1,175 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
esse-active_record (0.3.9)
|
5
|
+
activerecord (>= 4.2)
|
6
|
+
esse (>= 0.3.0)
|
7
|
+
esse-hooks
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
activemodel (7.2.2.1)
|
13
|
+
activesupport (= 7.2.2.1)
|
14
|
+
activerecord (7.2.2.1)
|
15
|
+
activemodel (= 7.2.2.1)
|
16
|
+
activesupport (= 7.2.2.1)
|
17
|
+
timeout (>= 0.4.0)
|
18
|
+
activesupport (7.2.2.1)
|
19
|
+
base64
|
20
|
+
benchmark (>= 0.3)
|
21
|
+
bigdecimal
|
22
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
23
|
+
connection_pool (>= 2.2.5)
|
24
|
+
drb
|
25
|
+
i18n (>= 1.6, < 2)
|
26
|
+
logger (>= 1.4.2)
|
27
|
+
minitest (>= 5.1)
|
28
|
+
securerandom (>= 0.3)
|
29
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
30
|
+
addressable (2.8.7)
|
31
|
+
public_suffix (>= 2.0.2, < 7.0)
|
32
|
+
ast (2.4.2)
|
33
|
+
awesome_print (1.9.2)
|
34
|
+
base64 (0.2.0)
|
35
|
+
benchmark (0.4.0)
|
36
|
+
bigdecimal (3.1.9)
|
37
|
+
coderay (1.1.3)
|
38
|
+
concurrent-ruby (1.3.5)
|
39
|
+
connection_pool (2.5.0)
|
40
|
+
crack (1.0.0)
|
41
|
+
bigdecimal
|
42
|
+
rexml
|
43
|
+
diff-lcs (1.5.1)
|
44
|
+
dotenv (3.1.7)
|
45
|
+
drb (2.2.1)
|
46
|
+
elasticsearch (7.17.11)
|
47
|
+
elasticsearch-api (= 7.17.11)
|
48
|
+
elasticsearch-transport (= 7.17.11)
|
49
|
+
elasticsearch-api (7.17.11)
|
50
|
+
multi_json
|
51
|
+
elasticsearch-transport (7.17.11)
|
52
|
+
base64
|
53
|
+
faraday (>= 1, < 3)
|
54
|
+
multi_json
|
55
|
+
esse (0.3.5)
|
56
|
+
multi_json
|
57
|
+
thor (>= 0.19)
|
58
|
+
esse-hooks (0.0.1)
|
59
|
+
esse (>= 0.3.0)
|
60
|
+
esse-rspec (0.0.6)
|
61
|
+
esse (>= 0.2.4)
|
62
|
+
rspec (>= 3)
|
63
|
+
faraday (2.12.2)
|
64
|
+
faraday-net_http (>= 2.0, < 3.5)
|
65
|
+
json
|
66
|
+
logger
|
67
|
+
faraday-net_http (3.4.0)
|
68
|
+
net-http (>= 0.5.0)
|
69
|
+
hashdiff (1.1.2)
|
70
|
+
i18n (1.14.7)
|
71
|
+
concurrent-ruby (~> 1.0)
|
72
|
+
json (2.9.1)
|
73
|
+
language_server-protocol (3.17.0.3)
|
74
|
+
lint_roller (1.1.0)
|
75
|
+
logger (1.6.5)
|
76
|
+
method_source (1.1.0)
|
77
|
+
minitest (5.25.4)
|
78
|
+
multi_json (1.15.0)
|
79
|
+
net-http (0.6.0)
|
80
|
+
uri
|
81
|
+
parallel (1.26.3)
|
82
|
+
parser (3.3.7.0)
|
83
|
+
ast (~> 2.4.1)
|
84
|
+
racc
|
85
|
+
pry (0.15.2)
|
86
|
+
coderay (~> 1.1)
|
87
|
+
method_source (~> 1.0)
|
88
|
+
public_suffix (6.0.1)
|
89
|
+
racc (1.8.1)
|
90
|
+
rainbow (3.1.1)
|
91
|
+
rake (13.2.1)
|
92
|
+
regexp_parser (2.10.0)
|
93
|
+
rexml (3.4.0)
|
94
|
+
rspec (3.13.0)
|
95
|
+
rspec-core (~> 3.13.0)
|
96
|
+
rspec-expectations (~> 3.13.0)
|
97
|
+
rspec-mocks (~> 3.13.0)
|
98
|
+
rspec-core (3.13.2)
|
99
|
+
rspec-support (~> 3.13.0)
|
100
|
+
rspec-expectations (3.13.3)
|
101
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
102
|
+
rspec-support (~> 3.13.0)
|
103
|
+
rspec-mocks (3.13.2)
|
104
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
105
|
+
rspec-support (~> 3.13.0)
|
106
|
+
rspec-support (3.13.2)
|
107
|
+
rubocop (1.70.0)
|
108
|
+
json (~> 2.3)
|
109
|
+
language_server-protocol (>= 3.17.0)
|
110
|
+
parallel (~> 1.10)
|
111
|
+
parser (>= 3.3.0.2)
|
112
|
+
rainbow (>= 2.2.2, < 4.0)
|
113
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
114
|
+
rubocop-ast (>= 1.36.2, < 2.0)
|
115
|
+
ruby-progressbar (~> 1.7)
|
116
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
117
|
+
rubocop-ast (1.37.0)
|
118
|
+
parser (>= 3.3.1.0)
|
119
|
+
rubocop-performance (1.23.1)
|
120
|
+
rubocop (>= 1.48.1, < 2.0)
|
121
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
122
|
+
rubocop-rspec (3.4.0)
|
123
|
+
rubocop (~> 1.61)
|
124
|
+
ruby-progressbar (1.13.0)
|
125
|
+
securerandom (0.4.1)
|
126
|
+
sqlite3 (2.5.0-x86_64-linux-gnu)
|
127
|
+
standard (1.44.0)
|
128
|
+
language_server-protocol (~> 3.17.0.2)
|
129
|
+
lint_roller (~> 1.0)
|
130
|
+
rubocop (~> 1.70.0)
|
131
|
+
standard-custom (~> 1.0.0)
|
132
|
+
standard-performance (~> 1.6)
|
133
|
+
standard-custom (1.0.2)
|
134
|
+
lint_roller (~> 1.0)
|
135
|
+
rubocop (~> 1.50)
|
136
|
+
standard-performance (1.6.0)
|
137
|
+
lint_roller (~> 1.1)
|
138
|
+
rubocop-performance (~> 1.23.0)
|
139
|
+
thor (1.3.2)
|
140
|
+
timeout (0.4.3)
|
141
|
+
tzinfo (2.0.6)
|
142
|
+
concurrent-ruby (~> 1.0)
|
143
|
+
unicode-display_width (3.1.4)
|
144
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
145
|
+
unicode-emoji (4.0.4)
|
146
|
+
uri (1.0.2)
|
147
|
+
webmock (3.24.0)
|
148
|
+
addressable (>= 2.8.0)
|
149
|
+
crack (>= 0.3.2)
|
150
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
151
|
+
yard (0.9.37)
|
152
|
+
|
153
|
+
PLATFORMS
|
154
|
+
x86_64-linux
|
155
|
+
|
156
|
+
DEPENDENCIES
|
157
|
+
activerecord (~> 7.2)
|
158
|
+
awesome_print
|
159
|
+
dotenv
|
160
|
+
elasticsearch (~> 7.17, >= 7.17.10)
|
161
|
+
esse-active_record!
|
162
|
+
esse-rspec
|
163
|
+
pry
|
164
|
+
rake
|
165
|
+
rspec
|
166
|
+
rubocop
|
167
|
+
rubocop-performance
|
168
|
+
rubocop-rspec
|
169
|
+
sqlite3
|
170
|
+
standard
|
171
|
+
webmock
|
172
|
+
yard
|
173
|
+
|
174
|
+
BUNDLED WITH
|
175
|
+
2.3.26
|
@@ -0,0 +1,176 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
esse-active_record (0.3.9)
|
5
|
+
activerecord (>= 4.2)
|
6
|
+
esse (>= 0.3.0)
|
7
|
+
esse-hooks
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
activemodel (8.0.1)
|
13
|
+
activesupport (= 8.0.1)
|
14
|
+
activerecord (8.0.1)
|
15
|
+
activemodel (= 8.0.1)
|
16
|
+
activesupport (= 8.0.1)
|
17
|
+
timeout (>= 0.4.0)
|
18
|
+
activesupport (8.0.1)
|
19
|
+
base64
|
20
|
+
benchmark (>= 0.3)
|
21
|
+
bigdecimal
|
22
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
23
|
+
connection_pool (>= 2.2.5)
|
24
|
+
drb
|
25
|
+
i18n (>= 1.6, < 2)
|
26
|
+
logger (>= 1.4.2)
|
27
|
+
minitest (>= 5.1)
|
28
|
+
securerandom (>= 0.3)
|
29
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
30
|
+
uri (>= 0.13.1)
|
31
|
+
addressable (2.8.7)
|
32
|
+
public_suffix (>= 2.0.2, < 7.0)
|
33
|
+
ast (2.4.2)
|
34
|
+
awesome_print (1.9.2)
|
35
|
+
base64 (0.2.0)
|
36
|
+
benchmark (0.4.0)
|
37
|
+
bigdecimal (3.1.9)
|
38
|
+
coderay (1.1.3)
|
39
|
+
concurrent-ruby (1.3.5)
|
40
|
+
connection_pool (2.5.0)
|
41
|
+
crack (1.0.0)
|
42
|
+
bigdecimal
|
43
|
+
rexml
|
44
|
+
diff-lcs (1.5.1)
|
45
|
+
dotenv (3.1.7)
|
46
|
+
drb (2.2.1)
|
47
|
+
elasticsearch (7.17.11)
|
48
|
+
elasticsearch-api (= 7.17.11)
|
49
|
+
elasticsearch-transport (= 7.17.11)
|
50
|
+
elasticsearch-api (7.17.11)
|
51
|
+
multi_json
|
52
|
+
elasticsearch-transport (7.17.11)
|
53
|
+
base64
|
54
|
+
faraday (>= 1, < 3)
|
55
|
+
multi_json
|
56
|
+
esse (0.3.5)
|
57
|
+
multi_json
|
58
|
+
thor (>= 0.19)
|
59
|
+
esse-hooks (0.0.1)
|
60
|
+
esse (>= 0.3.0)
|
61
|
+
esse-rspec (0.0.6)
|
62
|
+
esse (>= 0.2.4)
|
63
|
+
rspec (>= 3)
|
64
|
+
faraday (2.12.2)
|
65
|
+
faraday-net_http (>= 2.0, < 3.5)
|
66
|
+
json
|
67
|
+
logger
|
68
|
+
faraday-net_http (3.4.0)
|
69
|
+
net-http (>= 0.5.0)
|
70
|
+
hashdiff (1.1.2)
|
71
|
+
i18n (1.14.7)
|
72
|
+
concurrent-ruby (~> 1.0)
|
73
|
+
json (2.9.1)
|
74
|
+
language_server-protocol (3.17.0.3)
|
75
|
+
lint_roller (1.1.0)
|
76
|
+
logger (1.6.5)
|
77
|
+
method_source (1.1.0)
|
78
|
+
minitest (5.25.4)
|
79
|
+
multi_json (1.15.0)
|
80
|
+
net-http (0.6.0)
|
81
|
+
uri
|
82
|
+
parallel (1.26.3)
|
83
|
+
parser (3.3.7.0)
|
84
|
+
ast (~> 2.4.1)
|
85
|
+
racc
|
86
|
+
pry (0.15.2)
|
87
|
+
coderay (~> 1.1)
|
88
|
+
method_source (~> 1.0)
|
89
|
+
public_suffix (6.0.1)
|
90
|
+
racc (1.8.1)
|
91
|
+
rainbow (3.1.1)
|
92
|
+
rake (13.2.1)
|
93
|
+
regexp_parser (2.10.0)
|
94
|
+
rexml (3.4.0)
|
95
|
+
rspec (3.13.0)
|
96
|
+
rspec-core (~> 3.13.0)
|
97
|
+
rspec-expectations (~> 3.13.0)
|
98
|
+
rspec-mocks (~> 3.13.0)
|
99
|
+
rspec-core (3.13.2)
|
100
|
+
rspec-support (~> 3.13.0)
|
101
|
+
rspec-expectations (3.13.3)
|
102
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
103
|
+
rspec-support (~> 3.13.0)
|
104
|
+
rspec-mocks (3.13.2)
|
105
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
106
|
+
rspec-support (~> 3.13.0)
|
107
|
+
rspec-support (3.13.2)
|
108
|
+
rubocop (1.70.0)
|
109
|
+
json (~> 2.3)
|
110
|
+
language_server-protocol (>= 3.17.0)
|
111
|
+
parallel (~> 1.10)
|
112
|
+
parser (>= 3.3.0.2)
|
113
|
+
rainbow (>= 2.2.2, < 4.0)
|
114
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
115
|
+
rubocop-ast (>= 1.36.2, < 2.0)
|
116
|
+
ruby-progressbar (~> 1.7)
|
117
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
118
|
+
rubocop-ast (1.37.0)
|
119
|
+
parser (>= 3.3.1.0)
|
120
|
+
rubocop-performance (1.23.1)
|
121
|
+
rubocop (>= 1.48.1, < 2.0)
|
122
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
123
|
+
rubocop-rspec (3.4.0)
|
124
|
+
rubocop (~> 1.61)
|
125
|
+
ruby-progressbar (1.13.0)
|
126
|
+
securerandom (0.4.1)
|
127
|
+
sqlite3 (2.5.0-x86_64-linux-gnu)
|
128
|
+
standard (1.44.0)
|
129
|
+
language_server-protocol (~> 3.17.0.2)
|
130
|
+
lint_roller (~> 1.0)
|
131
|
+
rubocop (~> 1.70.0)
|
132
|
+
standard-custom (~> 1.0.0)
|
133
|
+
standard-performance (~> 1.6)
|
134
|
+
standard-custom (1.0.2)
|
135
|
+
lint_roller (~> 1.0)
|
136
|
+
rubocop (~> 1.50)
|
137
|
+
standard-performance (1.6.0)
|
138
|
+
lint_roller (~> 1.1)
|
139
|
+
rubocop-performance (~> 1.23.0)
|
140
|
+
thor (1.3.2)
|
141
|
+
timeout (0.4.3)
|
142
|
+
tzinfo (2.0.6)
|
143
|
+
concurrent-ruby (~> 1.0)
|
144
|
+
unicode-display_width (3.1.4)
|
145
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
146
|
+
unicode-emoji (4.0.4)
|
147
|
+
uri (1.0.2)
|
148
|
+
webmock (3.24.0)
|
149
|
+
addressable (>= 2.8.0)
|
150
|
+
crack (>= 0.3.2)
|
151
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
152
|
+
yard (0.9.37)
|
153
|
+
|
154
|
+
PLATFORMS
|
155
|
+
x86_64-linux
|
156
|
+
|
157
|
+
DEPENDENCIES
|
158
|
+
activerecord (~> 8.0)
|
159
|
+
awesome_print
|
160
|
+
dotenv
|
161
|
+
elasticsearch (~> 7.17, >= 7.17.10)
|
162
|
+
esse-active_record!
|
163
|
+
esse-rspec
|
164
|
+
pry
|
165
|
+
rake
|
166
|
+
rspec
|
167
|
+
rubocop
|
168
|
+
rubocop-performance
|
169
|
+
rubocop-rspec
|
170
|
+
sqlite3
|
171
|
+
standard
|
172
|
+
webmock
|
173
|
+
yard
|
174
|
+
|
175
|
+
BUNDLED WITH
|
176
|
+
2.3.26
|
@@ -5,206 +5,7 @@ module Esse
|
|
5
5
|
module Hooks
|
6
6
|
STORE_STATE_KEY = :esse_active_record_hooks
|
7
7
|
|
8
|
-
|
9
|
-
def register_model(model_class)
|
10
|
-
@models ||= []
|
11
|
-
@models |= [model_class]
|
12
|
-
end
|
13
|
-
|
14
|
-
def models
|
15
|
-
@models || []
|
16
|
-
end
|
17
|
-
|
18
|
-
def model_names
|
19
|
-
models.map(&:to_s)
|
20
|
-
end
|
21
|
-
|
22
|
-
# Global enable indexing callbacks. If no repository is specified, all repositories will be enabled.
|
23
|
-
# @param repos [Array<String, Esse::Index, Esse::Repo>]
|
24
|
-
# @return [void]
|
25
|
-
def enable!(*repos)
|
26
|
-
filter_repositories(*repos).each do |repo|
|
27
|
-
state[:repos][repo] = true
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
# Global disable indexing callbacks. If no repository is specified, all repositories will be disabled.
|
32
|
-
# @param repos [Array<String, Esse::Index, Esse::Repo>]
|
33
|
-
# @return [void]
|
34
|
-
def disable!(*repos)
|
35
|
-
filter_repositories(*repos).each do |repo|
|
36
|
-
state[:repos][repo] = false
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
# Check if the given repository is enabled for indexing. If no repository is specified, all repositories will be checked.
|
41
|
-
#
|
42
|
-
# @param repos [Array<String, Esse::Index, Esse::Repo>]
|
43
|
-
# @return [Boolean]
|
44
|
-
def disabled?(*repos)
|
45
|
-
filter_repositories(*repos).all? { |repo| !state[:repos][repo] }
|
46
|
-
end
|
47
|
-
|
48
|
-
# Check if the given repository is enabled for indexing. If no repository is specified, all repositories will be checked.
|
49
|
-
#
|
50
|
-
# @param repos [Array<String, Esse::Index, Esse::Repo>]
|
51
|
-
# @return [Boolean]
|
52
|
-
def enabled?(*repos)
|
53
|
-
filter_repositories(*repos).all? { |repo| state[:repos][repo] }
|
54
|
-
end
|
55
|
-
|
56
|
-
# Enable model indexing callbacks for the given model. If no repository is specified, all repositories will be enabled.
|
57
|
-
#
|
58
|
-
# @param model_class [Class]
|
59
|
-
# @param repos [Array<String, Esse::Index, Esse::Repo>]
|
60
|
-
# @raise [ArgumentError] if model repository is not registered for the given model
|
61
|
-
# @return [void]
|
62
|
-
def enable_model!(model_class, *repos)
|
63
|
-
ensure_registered_model_class!(model_class)
|
64
|
-
filter_model_repositories(model_class, *repos).each do |repo|
|
65
|
-
state[:models][model_class][repo] = true
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
# Disable model indexing callbacks for the given model. If no repository is specified, all repositories will be disabled.
|
70
|
-
#
|
71
|
-
# @param model_class [Class]
|
72
|
-
# @param repos [Array<String, Esse::Index, Esse::Repo>]
|
73
|
-
# @raise [ArgumentError] if model repository is not registered for the given model
|
74
|
-
# @return [void]
|
75
|
-
def disable_model!(model_class, *repos)
|
76
|
-
ensure_registered_model_class!(model_class)
|
77
|
-
filter_model_repositories(model_class, *repos).each do |repo|
|
78
|
-
state[:models][model_class][repo] = false
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
def ensure_registered_model_class!(model_class)
|
83
|
-
return if registered_model_class?(model_class)
|
84
|
-
|
85
|
-
raise ArgumentError, "Model class #{model_class} is not registered. The model should inherit from Esse::ActiveRecord::Model and have a `index_callback' callback defined"
|
86
|
-
end
|
87
|
-
|
88
|
-
# Check if the given model is enabled for indexing. If no repository is specified, all repositories will be checked.
|
89
|
-
#
|
90
|
-
# @param model_class [Class]
|
91
|
-
# @param repos [Array<String, Esse::Index, Esse::Repo>]
|
92
|
-
# @return [Boolean]
|
93
|
-
def enabled_for_model?(model_class, *repos)
|
94
|
-
return false unless registered_model_class?(model_class)
|
95
|
-
|
96
|
-
filter_model_repositories(model_class, *repos).all? do |repo|
|
97
|
-
state.dig(:models, model_class, repo) != false
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
# Disable indexing callbacks execution for the block execution.
|
102
|
-
# Example:
|
103
|
-
# Esse::ActiveRecord::Hooks.without_indexing { User.create! }
|
104
|
-
# Esse::ActiveRecord::Hooks.without_indexing(UsersIndex, AccountsIndex.repo(:user)) { User.create! }
|
105
|
-
def without_indexing(*repos)
|
106
|
-
state_before_disable = state[:repos].dup
|
107
|
-
disable!(*repos)
|
108
|
-
|
109
|
-
yield
|
110
|
-
ensure
|
111
|
-
state[:repos] = state_before_disable
|
112
|
-
end
|
113
|
-
|
114
|
-
# Disable model indexing callbacks execution for the block execution for the given model.
|
115
|
-
# Example:
|
116
|
-
# BroadcastChanges.without_indexing_for_model(User) { }
|
117
|
-
# BroadcastChanges.without_indexing_for_model(User, :datasync, :other) { }
|
118
|
-
def without_indexing_for_model(model_class, *repos)
|
119
|
-
state_before_disable = state[:models].dig(model_class).dup
|
120
|
-
disable_model!(model_class, *repos)
|
121
|
-
yield
|
122
|
-
ensure
|
123
|
-
if state_before_disable.nil?
|
124
|
-
state[:models].delete(model_class)
|
125
|
-
else
|
126
|
-
state[:models][model_class] = state_before_disable
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
def resolve_index_repository(name)
|
131
|
-
index_name, repo_name = name.to_s.underscore.split('::').join('/').split(':', 2)
|
132
|
-
if index_name !~ /(I|_i)ndex$/ && index_name !~ /_index\/([\w_]+)$/
|
133
|
-
index_name = format('%<index_name>s_index', index_name: index_name)
|
134
|
-
end
|
135
|
-
klass = index_name.classify.constantize
|
136
|
-
return klass if klass <= Esse::Repository
|
137
|
-
|
138
|
-
repo_name.present? ? klass.repo(repo_name) : klass.repo
|
139
|
-
end
|
140
|
-
|
141
|
-
private
|
142
|
-
|
143
|
-
def all_repos
|
144
|
-
models.flat_map { |model_class| model_repos(model_class) }.uniq
|
145
|
-
end
|
146
|
-
|
147
|
-
# Returns a list of all repositories for the given model
|
148
|
-
# @return [Array<Symbol>]
|
149
|
-
def model_repos(model_class)
|
150
|
-
expand_index_repos(*model_class.esse_callbacks.keys)
|
151
|
-
end
|
152
|
-
|
153
|
-
# Returns a list of all repositories for the given model
|
154
|
-
# If no repository is specified, all repositories will be returned.
|
155
|
-
# @return [Array<*Esse::Repository>] List of repositories
|
156
|
-
def filter_repositories(*repos)
|
157
|
-
(expand_index_repos(*repos) & all_repos).presence || all_repos
|
158
|
-
end
|
159
|
-
|
160
|
-
# Return repositorys for the given model. If no repository is specified, all repositories will be returned.
|
161
|
-
#
|
162
|
-
# @param model_class [Class]
|
163
|
-
# @param repos [Array<*Esse::Repository>] List of repositories to check for the given model
|
164
|
-
# @return [Array<*Esse::Repository>] List of repositories
|
165
|
-
def filter_model_repositories(model_class, *repos)
|
166
|
-
model_repos = model_repos(model_class) & all_repos
|
167
|
-
(expand_index_repos(*repos) & model_repos).presence || model_repos
|
168
|
-
end
|
169
|
-
|
170
|
-
def expand_index_repos(*repos)
|
171
|
-
repos.flat_map do |repo_name|
|
172
|
-
case repo_name
|
173
|
-
when Class
|
174
|
-
(repo_name <= Esse::Index) ? repo_name.repo_hash.values : repo_name
|
175
|
-
when String, Symbol
|
176
|
-
resolve_index_repository(repo_name)
|
177
|
-
else
|
178
|
-
raise ArgumentError, "Invalid index or repository name: #{repo_name.inspect}"
|
179
|
-
end
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
# Check if model class is registered
|
184
|
-
# @return [Boolean] true if model class is registered
|
185
|
-
def registered_model_class?(model_class)
|
186
|
-
models.include?(model_class)
|
187
|
-
end
|
188
|
-
|
189
|
-
# Data Structure:
|
190
|
-
#
|
191
|
-
# repos: { <Esse::Repository class> => <true|false>, ... }
|
192
|
-
# models: {
|
193
|
-
# <ActiveRecord::Base class> => {
|
194
|
-
# <Esse::Repository class> => <true|false>
|
195
|
-
# }
|
196
|
-
# }
|
197
|
-
def state
|
198
|
-
global_store[STORE_STATE_KEY] ||= {
|
199
|
-
repos: all_repos.map { |k| [k, true] }.to_h, # Control global state of the index repository level
|
200
|
-
models: Hash.new { |h, k| h[k] = {} }, # Control the state of the model & index repository level
|
201
|
-
}
|
202
|
-
end
|
203
|
-
|
204
|
-
def global_store
|
205
|
-
Thread.current
|
206
|
-
end
|
207
|
-
end
|
8
|
+
include Esse::Hooks[store_key: STORE_STATE_KEY]
|
208
9
|
end
|
209
10
|
end
|
210
11
|
end
|
data/lib/esse/active_record.rb
CHANGED
data/mise.toml
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esse-active_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos G. Zimmermann
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: esse
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.3.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: esse-hooks
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.0.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.0.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: activerecord
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -31,9 +45,6 @@ dependencies:
|
|
31
45
|
- - ">="
|
32
46
|
- !ruby/object:Gem::Version
|
33
47
|
version: '4.2'
|
34
|
-
- - "<"
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: '8'
|
37
48
|
type: :runtime
|
38
49
|
prerelease: false
|
39
50
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -41,9 +52,6 @@ dependencies:
|
|
41
52
|
- - ">="
|
42
53
|
- !ruby/object:Gem::Version
|
43
54
|
version: '4.2'
|
44
|
-
- - "<"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '8'
|
47
55
|
- !ruby/object:Gem::Dependency
|
48
56
|
name: awesome_print
|
49
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -222,6 +230,10 @@ files:
|
|
222
230
|
- ci/Gemfile.rails-7.0.lock
|
223
231
|
- ci/Gemfile.rails-7.1
|
224
232
|
- ci/Gemfile.rails-7.1.lock
|
233
|
+
- ci/Gemfile.rails-7.2
|
234
|
+
- ci/Gemfile.rails-7.2.lock
|
235
|
+
- ci/Gemfile.rails-8.0
|
236
|
+
- ci/Gemfile.rails-8.0.lock
|
225
237
|
- lib/esse/active_record.rb
|
226
238
|
- lib/esse/active_record/callbacks.rb
|
227
239
|
- lib/esse/active_record/callbacks/indexing_on_create.rb
|
@@ -233,7 +245,7 @@ files:
|
|
233
245
|
- lib/esse/active_record/model.rb
|
234
246
|
- lib/esse/active_record/version.rb
|
235
247
|
- lib/esse/plugins/active_record.rb
|
236
|
-
-
|
248
|
+
- mise.toml
|
237
249
|
homepage: https://github.com/marcosgz/esse-active_record
|
238
250
|
licenses:
|
239
251
|
- MIT
|