active_type 2.1.1 → 2.1.2

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: b0a5d8d33884c5002323fee2411daea972323f973b14f885ea5b3c6336569f8f
4
- data.tar.gz: 4b29935992035498d74b4c4d80c1041e17adc890234f81357828fe71e723288d
3
+ metadata.gz: 40083adc49f1500ec21e7e2febbca83a4757bc7daf87c3f5e8a1edb31c242502
4
+ data.tar.gz: 2a801dc75197b91f61a40f0a06de9f96d743cd092004c6426dabeeceb2787ea2
5
5
  SHA512:
6
- metadata.gz: a853c942d84f065a4f1be9fad10801f635f5d759bbb969bc655d2160d0e9757f579147f0197f52af0335eb412e1cea164a78eff56ce6747f9ca36a2340fdb36f
7
- data.tar.gz: b91df99ae7b73ee3702d05b9d70bcde4a45623054293cc3ccbcedd3d6c83c22a5ac2261ca140730fd5afd3299c96ad71b275102a0ac5612260e0d5771cc11f8d
6
+ metadata.gz: f9b8c4b430b352bc0f178354fe43685a19e1fbd24cf8c6fdff0ce18713f97afa682051dcd2dabdf670769d79b24fb760ec9a573d0e312803ce2d887fef04a874
7
+ data.tar.gz: 6f4bda1b9867f569a5269edae81351e59ad0a1eb4b021aeb14735aa23dafca5ce1321236557c7c007fa8632ad1671c6881aab6b06fc429d62392d95d462ce6bc
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.1.1)
4
+ active_type (2.1.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -56,4 +56,4 @@ DEPENDENCIES
56
56
  rspec (~> 3.4)
57
57
 
58
58
  BUNDLED WITH
59
- 2.2.16
59
+ 2.2.27
data/Gemfile.5.2.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.1.1)
4
+ active_type (2.1.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.1.1)
4
+ active_type (2.1.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -56,4 +56,4 @@ DEPENDENCIES
56
56
  sqlite3
57
57
 
58
58
  BUNDLED WITH
59
- 2.2.16
59
+ 2.2.27
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.1.1)
4
+ active_type (2.1.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -56,4 +56,4 @@ DEPENDENCIES
56
56
  sqlite3
57
57
 
58
58
  BUNDLED WITH
59
- 2.2.16
59
+ 2.2.27
data/Gemfile.6.1.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.1.1)
4
+ active_type (2.1.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -56,4 +56,4 @@ DEPENDENCIES
56
56
  rspec (~> 3.4)
57
57
 
58
58
  BUNDLED WITH
59
- 2.2.16
59
+ 2.2.27
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.1.1)
4
+ active_type (2.1.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -56,4 +56,4 @@ DEPENDENCIES
56
56
  sqlite3
57
57
 
58
58
  BUNDLED WITH
59
- 2.2.16
59
+ 2.2.27
data/Gemfile.7.0.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.1.1)
4
+ active_type (2.1.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.1.1)
4
+ active_type (2.1.2)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -16,11 +16,15 @@ module ActiveType
16
16
  @allow_destroy = options.fetch(:allow_destroy, false)
17
17
  @reject_if = options.delete(:reject_if)
18
18
  @options = options.dup
19
- @index_errors = if ActiveRecord::VERSION::MAJOR < 5
20
- @options[:index_errors]
21
- else
22
- @options[:index_errors] || ActiveRecord::Base.index_nested_attribute_errors
23
- end
19
+
20
+ @index_errors = case
21
+ when ActiveRecord::VERSION::MAJOR < 5
22
+ @options[:index_errors]
23
+ when ActiveRecord::VERSION::MAJOR < 7
24
+ @options[:index_errors] || ActiveRecord::Base.index_nested_attribute_errors
25
+ else
26
+ @options[:index_errors] || ActiveRecord.index_nested_attribute_errors
27
+ end
24
28
  end
25
29
 
26
30
  def assign_attributes(parent, attributes)
@@ -1,3 +1,3 @@
1
1
  module ActiveType
2
- VERSION = '2.1.1'
2
+ VERSION = '2.1.2'
3
3
  end
@@ -273,7 +273,7 @@ module ActiveType
273
273
  if value.is_a?(String) && value.length > 50
274
274
  "#{value[0, 50]}...".inspect
275
275
  elsif value.is_a?(Date) || value.is_a?(Time)
276
- %("#{value.to_s(:db)}")
276
+ %("#{value.to_formatted_s(:db)}")
277
277
  elsif value.is_a?(Array) && value.size > 10
278
278
  inspected = value.first(10).inspect
279
279
  %(#{inspected[0...-1]}, ...])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_type
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-02-15 00:00:00.000000000 Z
12
+ date: 2022-05-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  requirements: []
134
- rubygems_version: 3.2.6
134
+ rubygems_version: 3.1.6
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Make any Ruby object quack like ActiveRecord