umbrellio-sequel-plugins 0.9.0.79 → 0.10.0.100

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: 044270ad33b6b7a80b9e35be0f3b8d3765dc83392b9188d4f2605e897d974783
4
- data.tar.gz: 28bf7d0755b796edb711c43adbf3a5133aecde56f1628b0462836f87ec9409ff
3
+ metadata.gz: 461c2e1edac7a90a93262bab9b44b28455d14db79872bd6b18a488da9d5f9afc
4
+ data.tar.gz: 2ea67f3af3a257f59018861b698b3c0dc7e950f7421f0db0b75c5d08081be0c2
5
5
  SHA512:
6
- metadata.gz: 2b92bc0504e24e5f61b9039b7e7af033105a36da5f21734de5eb77c81ee2564b7e77cdbcf9d860a1239123ee026f67c84c6f87f7c47325feb7dcb7927ec75289
7
- data.tar.gz: f18cdf48d4dd3aacbd896e94f44f910b448bdea1813e2a0ae8b393e11d10cb244720f6b0ea2285067dda3b577ee7e6488d7fcda786b94e668871616c1b6d0738
6
+ metadata.gz: d0f60ef1050a1c2fd371b0525c9375ca275dd9cd2d1edff184c5df229063f24cd0dba7214cb65fe1a9380040b3ad6c226e29face260c303604087fcd9ab0dd7a
7
+ data.tar.gz: e5c02e8cd6d4c4afeb48ec2b4624fcb21d906cf40481f88a8cef556decca0e7adf3ec228b36edef23f972d50af5c5817678effb6df5dd27127f8c8ac4f3579c4
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- umbrellio-sequel-plugins (0.9.0)
4
+ umbrellio-sequel-plugins (0.10.0)
5
5
  sequel
6
6
  symbiont-ruby
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (7.0.3)
11
+ activesupport (7.0.4)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
13
  i18n (>= 1.6, < 2)
14
14
  minitest (>= 5.1)
@@ -18,23 +18,24 @@ GEM
18
18
  concurrent-ruby (1.1.10)
19
19
  diff-lcs (1.5.0)
20
20
  docile (1.4.0)
21
- i18n (1.10.0)
21
+ i18n (1.12.0)
22
22
  concurrent-ruby (~> 1.0)
23
+ json (2.6.2)
23
24
  method_source (1.0.0)
24
- minitest (5.16.1)
25
+ minitest (5.16.3)
25
26
  money (6.16.0)
26
27
  i18n (>= 0.6.4, <= 2)
27
28
  parallel (1.22.1)
28
- parser (3.1.2.0)
29
+ parser (3.1.2.1)
29
30
  ast (~> 2.4.1)
30
- pg (1.4.1)
31
+ pg (1.4.3)
31
32
  pry (0.14.1)
32
33
  coderay (~> 1.1)
33
34
  method_source (~> 1.0)
34
- rack (2.2.3.1)
35
+ rack (3.0.0)
35
36
  rainbow (3.1.1)
36
37
  rake (13.0.6)
37
- regexp_parser (2.5.0)
38
+ regexp_parser (2.6.0)
38
39
  rexml (3.2.5)
39
40
  rspec (3.11.0)
40
41
  rspec-core (~> 3.11.0)
@@ -42,46 +43,47 @@ GEM
42
43
  rspec-mocks (~> 3.11.0)
43
44
  rspec-core (3.11.0)
44
45
  rspec-support (~> 3.11.0)
45
- rspec-expectations (3.11.0)
46
+ rspec-expectations (3.11.1)
46
47
  diff-lcs (>= 1.2.0, < 2.0)
47
48
  rspec-support (~> 3.11.0)
48
49
  rspec-mocks (3.11.1)
49
50
  diff-lcs (>= 1.2.0, < 2.0)
50
51
  rspec-support (~> 3.11.0)
51
- rspec-support (3.11.0)
52
- rubocop (1.30.1)
52
+ rspec-support (3.11.1)
53
+ rubocop (1.35.1)
54
+ json (~> 2.3)
53
55
  parallel (~> 1.10)
54
- parser (>= 3.1.0.0)
56
+ parser (>= 3.1.2.1)
55
57
  rainbow (>= 2.2.2, < 4.0)
56
58
  regexp_parser (>= 1.8, < 3.0)
57
59
  rexml (>= 3.2.5, < 4.0)
58
- rubocop-ast (>= 1.18.0, < 2.0)
60
+ rubocop-ast (>= 1.20.1, < 2.0)
59
61
  ruby-progressbar (~> 1.7)
60
62
  unicode-display_width (>= 1.4.0, < 3.0)
61
- rubocop-ast (1.18.0)
63
+ rubocop-ast (1.21.0)
62
64
  parser (>= 3.1.1.0)
63
- rubocop-config-umbrellio (1.30.0.65)
64
- rubocop (~> 1.30.0)
65
+ rubocop-config-umbrellio (1.35.0.69)
66
+ rubocop (~> 1.35.0)
65
67
  rubocop-performance (~> 1.14.0)
66
- rubocop-rails (~> 2.14.2)
68
+ rubocop-rails (~> 2.15.0)
67
69
  rubocop-rake (~> 0.6.0)
68
- rubocop-rspec (~> 2.11.1)
70
+ rubocop-rspec (~> 2.12.0)
69
71
  rubocop-sequel (~> 0.3.3)
70
- rubocop-performance (1.14.2)
72
+ rubocop-performance (1.14.3)
71
73
  rubocop (>= 1.7.0, < 2.0)
72
74
  rubocop-ast (>= 0.4.0)
73
- rubocop-rails (2.14.2)
75
+ rubocop-rails (2.15.2)
74
76
  activesupport (>= 4.2.0)
75
77
  rack (>= 1.1)
76
78
  rubocop (>= 1.7.0, < 2.0)
77
79
  rubocop-rake (0.6.0)
78
80
  rubocop (~> 1.0)
79
- rubocop-rspec (2.11.1)
80
- rubocop (~> 1.19)
81
+ rubocop-rspec (2.12.1)
82
+ rubocop (~> 1.31)
81
83
  rubocop-sequel (0.3.4)
82
84
  rubocop (~> 1.0)
83
85
  ruby-progressbar (1.11.0)
84
- sequel (5.57.0)
86
+ sequel (5.61.0)
85
87
  simplecov (0.21.2)
86
88
  docile (~> 1.1)
87
89
  simplecov-html (~> 0.11)
@@ -90,9 +92,9 @@ GEM
90
92
  simplecov-lcov (0.8.0)
91
93
  simplecov_json_formatter (0.1.4)
92
94
  symbiont-ruby (0.7.0)
93
- tzinfo (2.0.4)
95
+ tzinfo (2.0.5)
94
96
  concurrent-ruby (~> 1.0)
95
- unicode-display_width (2.2.0)
97
+ unicode-display_width (2.3.0)
96
98
 
97
99
  PLATFORMS
98
100
  ruby
@@ -110,4 +112,4 @@ DEPENDENCIES
110
112
  umbrellio-sequel-plugins!
111
113
 
112
114
  BUNDLED WITH
113
- 2.3.16
115
+ 2.3.23
@@ -74,7 +74,7 @@ module Sequel::Plugins::AttrEncrypted
74
74
 
75
75
  @_encrypted_attributes ||= []
76
76
  @_attr_encrypted_module = Module.new
77
- prepend @_attr_encrypted_module
77
+ include @_attr_encrypted_module
78
78
  end
79
79
  end
80
80
 
@@ -62,7 +62,7 @@ module Sequel::Plugins::MoneyAccessors
62
62
  def include_accessors_module!
63
63
  return if defined?(@_money_accessors_module)
64
64
  @_money_accessors_module = Module.new
65
- prepend @_money_accessors_module
65
+ include @_money_accessors_module
66
66
  end
67
67
  end
68
68
  end
@@ -16,7 +16,7 @@ module Sequel::Plugins::StoreAccessors
16
16
  # user.first_name # => "John"
17
17
  # user.data # => {"first_name": "John"}
18
18
  def store(column, *fields)
19
- include_accessors_module
19
+ include_accessors_module(column)
20
20
 
21
21
  fields.each do |field|
22
22
  define_store_getter(column, field)
@@ -26,10 +26,16 @@ module Sequel::Plugins::StoreAccessors
26
26
 
27
27
  private
28
28
 
29
- def include_accessors_module
30
- return if defined?(@_store_accessors_module)
31
- @_store_accessors_module = Module.new
32
- include @_store_accessors_module
29
+ def include_accessors_module(column)
30
+ unless defined?(@_store_accessors_module)
31
+ @_store_accessors_module = Module.new
32
+ include @_store_accessors_module
33
+ end
34
+
35
+ prev_columns = @_store_accessors_module.instance_variable_get(:@_store_columns) || []
36
+ new_columns = [*prev_columns, column]
37
+ @_store_accessors_module.instance_variable_set(:@_store_columns, new_columns)
38
+ @_store_accessors_module.define_method(:store_columns) { new_columns }
33
39
  end
34
40
 
35
41
  def define_store_getter(column, field)
@@ -48,4 +54,21 @@ module Sequel::Plugins::StoreAccessors
48
54
  end
49
55
  end
50
56
  end
57
+
58
+ module InstanceMethods
59
+ def before_update
60
+ super
61
+ return unless respond_to?(:store_columns)
62
+ send(:store_columns).each do |store_column|
63
+ json = Sequel[store_column].pg_jsonb.concat(send(store_column))
64
+ send("#{store_column}=", json) if changed_columns.include?(store_column)
65
+ end
66
+ end
67
+
68
+ def after_update
69
+ super
70
+ return unless respond_to?(:store_columns)
71
+ reload unless send(:store_columns).all?(Hash)
72
+ end
73
+ end
51
74
  end
@@ -4,7 +4,7 @@ lib = File.expand_path("lib", __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- gem_version = "0.9.0"
7
+ gem_version = "0.10.0"
8
8
 
9
9
  if ENV.fetch("PUBLISH_JOB", nil)
10
10
  release_version = "#{gem_version}.#{ENV.fetch("GITHUB_RUN_NUMBER")}"
data/utils/database.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "logger"
4
4
 
5
- DB = Sequel.connect(ENV.fetch("DB_URL", "postgres://localhost/sequel_plugins"))
5
+ DB = Sequel.connect(ENV.fetch("DB_URL", "postgres:///sequel_plugins"))
6
6
  DB.logger = Logger.new("log/db.log")
7
7
 
8
8
  Sequel::Model.db = DB
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: umbrellio-sequel-plugins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0.79
4
+ version: 0.10.0.100
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Umbrellio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-19 00:00:00.000000000 Z
11
+ date: 2022-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
228
  - !ruby/object:Gem::Version
229
229
  version: '0'
230
230
  requirements: []
231
- rubygems_version: 3.1.2
231
+ rubygems_version: 3.3.5
232
232
  signing_key:
233
233
  specification_version: 4
234
234
  summary: Sequel plugins