esse-active_record 0.3.2 → 0.3.3

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: b48e48c6b27fee2e8612414bd9ba6730bbfd57ddc30b9f5ebadf5742c57d4be4
4
- data.tar.gz: c1b74e88c8942aea5a72c58326c0051d57326ff6d6c61e80b723abd043dd74a1
3
+ metadata.gz: 9927e9810121b26ea8b9288532ce8868326a48388a3ede20afd5722f3d3b8828
4
+ data.tar.gz: 9851522354c3c42fef276d2f2a84a6b85bf192f5d482f82676861710bdf01828
5
5
  SHA512:
6
- metadata.gz: 46019ab0f4d79af084a062fe41de8d1341b9261f0cf3651c94bb3e290db71a0f1794350fed8f2ef58f8dbc98910c2854e7a15fd5027cce0f1fd057ccda734b34
7
- data.tar.gz: e2c5861b580b09bf968d04a984ab3e6d94d27c89a2386a84397ceabf9860237be85ec135c79c387c3ad4559e4cbeb1462f863604de01f1a9c047143df0f5448a
6
+ metadata.gz: befe01d6e114cdec51fed21dcd4928d0f080a3de13e63879e9db67797518a4a7555d86d98a6175e94587e90c98730528d451aabaa4adc4c96cebb62d60704872
7
+ data.tar.gz: 00b61f1dbbe7efc9a1ee7b37361b120faa254ccddc4fe40e26411fa075bf27b0de6b8d970b9afae4a9e13b8407b241b434e5a51c125efaad67a4da70afed7bdb
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ source 'https://rubygems.org'
4
4
 
5
5
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
6
 
7
- gem 'esse', '~> 0.3.0'
7
+ gem 'esse', '~> 0.3.1'
8
8
  gem 'sqlite3', '~> 1.7.3'
9
9
  gem 'activerecord', '~> 5.2'
10
10
  gem 'esse-rspec', '~> 0.0.6'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- esse-active_record (0.3.2)
4
+ esse-active_record (0.3.3)
5
5
  activerecord (>= 4.2, < 8)
6
6
  esse (>= 0.3.0)
7
7
 
@@ -39,7 +39,7 @@ GEM
39
39
  elasticsearch-transport (7.17.10)
40
40
  faraday (>= 1, < 3)
41
41
  multi_json
42
- esse (0.3.0)
42
+ esse (0.3.1)
43
43
  multi_json
44
44
  thor (>= 0.19)
45
45
  esse-rspec (0.0.6)
@@ -142,7 +142,7 @@ DEPENDENCIES
142
142
  awesome_print
143
143
  dotenv
144
144
  elasticsearch (~> 7.17, >= 7.17.10)
145
- esse (~> 0.3.0)
145
+ esse (~> 0.3.1)
146
146
  esse-active_record!
147
147
  esse-rspec (~> 0.0.6)
148
148
  pry
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- esse-active_record (0.3.2)
4
+ esse-active_record (0.3.3)
5
5
  activerecord (>= 4.2, < 8)
6
6
  esse (>= 0.3.0)
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- esse-active_record (0.3.2)
4
+ esse-active_record (0.3.3)
5
5
  activerecord (>= 4.2, < 8)
6
6
  esse (>= 0.3.0)
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- esse-active_record (0.3.2)
4
+ esse-active_record (0.3.3)
5
5
  activerecord (>= 4.2, < 8)
6
6
  esse (>= 0.3.0)
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- esse-active_record (0.3.2)
4
+ esse-active_record (0.3.3)
5
5
  activerecord (>= 4.2, < 8)
6
6
  esse (>= 0.3.0)
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- esse-active_record (0.3.2)
4
+ esse-active_record (0.3.3)
5
5
  activerecord (>= 4.2, < 8)
6
6
  esse (>= 0.3.0)
7
7
 
@@ -14,7 +14,14 @@ module Esse
14
14
 
15
15
  def esse_callback(index_repo_name, operation_name, on: %i[create update destroy], **options, &block)
16
16
  @esse_callbacks = esse_callbacks.dup
17
- if_enabled = -> { Esse::ActiveRecord::Hooks.enabled?(index_repo_name) && Esse::ActiveRecord::Hooks.enabled_for_model?(self.class, index_repo_name) }
17
+ cb_if = options.delete(:if)
18
+ cb_unless = options.delete(:unless)
19
+ if_enabled = -> {
20
+ (cb_if.nil? || (cb_if.respond_to?(:call) ? instance_exec(&cb_if) : send(cb_if))) &&
21
+ (cb_unless.nil? || (cb_unless.respond_to?(:call) ? !instance_exec(&cb_unless) : !send(cb_unless))) &&
22
+ Esse::ActiveRecord::Hooks.enabled?(index_repo_name) &&
23
+ Esse::ActiveRecord::Hooks.enabled_for_model?(self.class, index_repo_name)
24
+ }
18
25
 
19
26
  Array(on).each do |event|
20
27
  identifier, klass = Esse::ActiveRecord::Callbacks.fetch!(operation_name, event)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Esse
4
4
  module ActiveRecord
5
- VERSION = '0.3.2'
5
+ VERSION = '0.3.3'
6
6
  end
7
7
  end
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.2
4
+ version: 0.3.3
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: 2024-07-10 00:00:00.000000000 Z
11
+ date: 2024-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: esse