active_enquo 0.2.0 → 0.3.0

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: fc6de3e861f5cd9e32b59bcc95042fd67fe0302433ca390aca51dcc7d2073b53
4
- data.tar.gz: 79735074ab96ccaa1dc31384d313b075ced36630b8253276f1a393ce433ae090
3
+ metadata.gz: 9c0103ba2927e84bdc1c6fda73e7103ffe090316fac200d7d429a95e4f4632f0
4
+ data.tar.gz: 11d5f5d66a753fe18f79f198c7b243d9fa3b194929c6e2e63c6f4a93ce25ed06
5
5
  SHA512:
6
- metadata.gz: ec344ac14ee119cb38f1718f22b4f45d34fbccf20917196c47c3cdcd90ead5c050cab422899bdceca5a4fb6c8cd270e058815374b9504698bc1dbb67383ec101
7
- data.tar.gz: 6e127eb2ba8a7a027191fe83827a0af663f82f760e3364ffc025b650a3d58ab0ba1f1897f9bd667373f7ad9e103a835941437473e5c01c51ac9f387707fa7676
6
+ metadata.gz: 693f14e986cca46c810505664833cd4e211c170cd287d43fbbb429ba7a5ef0e830404d71597a314e97cdde4fe911edf14066f9af446510ce82c05b3e73507c6d
7
+ data.tar.gz: afba7f08679b1b45f6484f9a3bf1b870fc2a824edec9b8b33483f40b7661c940f55d8135992885011d25a4c57d6c02ecb5f069ebde0bed0d59daec85d6ad301d
data/active_enquo.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
27
27
 
28
28
  s.required_ruby_version = ">= 2.7.0"
29
29
 
30
- s.add_runtime_dependency "enquo-core", "~> 0.4"
30
+ s.add_runtime_dependency "enquo-core", "~> 0.6"
31
31
  s.add_runtime_dependency "activerecord", ">= 6"
32
32
 
33
33
  s.add_development_dependency "bundler"
data/lib/active_enquo.rb CHANGED
@@ -88,6 +88,7 @@ module ActiveEnquo
88
88
  def initialize_type_map(m = type_map)
89
89
  m.register_type "enquo_bigint", ActiveEnquo::Type::Bigint.new
90
90
  m.register_type "enquo_date", ActiveEnquo::Type::Date.new
91
+ m.register_type "enquo_text", ActiveEnquo::Type::Text.new
91
92
 
92
93
  super
93
94
  end
@@ -135,6 +136,20 @@ module ActiveEnquo
135
136
  end
136
137
  end
137
138
  end
139
+
140
+ class Text < Type
141
+ def type
142
+ :enquo_text
143
+ end
144
+
145
+ def encrypt(value, context, field, safety: true, no_query: false)
146
+ field.encrypt_text(value, context, safety: safety, no_query: no_query)
147
+ end
148
+
149
+ def decrypt(value, context, field)
150
+ field.decrypt_text(value, context)
151
+ end
152
+ end
138
153
  end
139
154
  end
140
155
 
@@ -146,5 +161,7 @@ ActiveSupport.on_load(:active_record) do
146
161
 
147
162
  unless ActiveRecord::VERSION::MAJOR == 7
148
163
  ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:enquo_bigint] = {}
164
+ ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:enquo_date] = {}
165
+ ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:enquo_text] = {}
149
166
  end
150
167
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_enquo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-04 00:00:00.000000000 Z
11
+ date: 2022-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: enquo-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.4'
19
+ version: '0.6'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.4'
26
+ version: '0.6'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activerecord
29
29
  requirement: !ruby/object:Gem::Requirement