db_fuel 2.0.0 → 2.0.1

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: 532f508d6074e44c1dd4bb57dcecf343f32e035d44f6bdbfcb0405127ede5552
4
- data.tar.gz: dccd390d0c15277ab9ca6c93027d12db85ebe7ad970333ebc2eadc7fc6f39b8c
3
+ metadata.gz: 81819bf8d353ae3425d90360089da3857aa5ccaeb56ffc499557bd036d318493
4
+ data.tar.gz: 32ee04a7d5c25f3f6b40dae72809aa8752d00e9736abf03bde7b0a08ef18f86a
5
5
  SHA512:
6
- metadata.gz: b49ad96e45049b564625a2288786e26087701e84c063aa71b316fde794237006c430fb9cc101ef2704efd79117702c36427e3bdf41098622ddb747e2af01d2f0
7
- data.tar.gz: 1d426794ea2045a5a6c1966352b1e9a00ae991cf4d2996315011da26c99fa652ab0ce719dc3a8cd9a495f61df350a1cc1584d7e47a3aa0317276fbea866e6f37
6
+ metadata.gz: b9bf6c8852f0da644839fc0883daceae2808c4646e5a26581da878dca9f09c71e7b3de887c0ac4f2107a3a7cdd3e8ccc6e58f70e01a5717bbae5842aa6691387
7
+ data.tar.gz: c1c2fb22e493cecc947d1f597ba91118c5f62acd1dd4263842b3004aa8d18943ff8910600ab2a8bde39a54eb50de8db220e309941ff439a02d19895fec7d8d97
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 2.0.1 (March 18th, 2021)
2
+
3
+ Changes:
4
+ * Updated attribute_renderer_set to avoid an evaluation time issue with acts_as_hashable.
5
+
1
6
  # 2.0.0 (March 16th, 2021)
2
7
 
3
8
  New Jobs:
@@ -14,14 +14,8 @@ module DbFuel
14
14
  # and include timestamp attributes if needed.
15
15
  class AttributeRendererSet # :nodoc:
16
16
  NOW_TYPE = 'r/value/now'
17
-
18
- CREATED_AT = Burner::Modeling::Attribute.make(
19
- key: :created_at, transformers: [{ type: NOW_TYPE }]
20
- )
21
-
22
- UPDATED_AT = Burner::Modeling::Attribute.make(
23
- key: :updated_at, transformers: [{ type: NOW_TYPE }]
24
- )
17
+ CREATED_AT = :created_at
18
+ UPDATED_AT = :updated_at
25
19
 
26
20
  attr_reader :attribute_renderers, :resolver
27
21
 
@@ -36,7 +30,7 @@ module DbFuel
36
30
 
37
31
  # Adds the attributes for created_at and updated_at to the currrent attribute renderers.
38
32
  def timestamp_created_attribute_renderers
39
- timestamp_attributes = [CREATED_AT, UPDATED_AT]
33
+ timestamp_attributes = [created_at_timestamp_attribute, updated_at_timestamp_attribute]
40
34
 
41
35
  timestamp_attributes.map do |a|
42
36
  Burner::Modeling::AttributeRenderer.new(a, resolver)
@@ -45,7 +39,7 @@ module DbFuel
45
39
 
46
40
  # Adds the attribute for updated_at to the currrent attribute renderers.
47
41
  def timestamp_updated_attribute_renderers
48
- timestamp_attributes = [UPDATED_AT]
42
+ timestamp_attributes = [updated_at_timestamp_attribute]
49
43
 
50
44
  timestamp_attributes.map do |a|
51
45
  Burner::Modeling::AttributeRenderer.new(a, resolver)
@@ -65,6 +59,23 @@ module DbFuel
65
59
  resolver.set(memo, attribute_renderer.key, value)
66
60
  end
67
61
  end
62
+
63
+ def created_at_timestamp_attribute
64
+ timestamp_attribute(CREATED_AT)
65
+ end
66
+
67
+ def updated_at_timestamp_attribute
68
+ timestamp_attribute(UPDATED_AT)
69
+ end
70
+
71
+ def timestamp_attribute(key)
72
+ Burner::Modeling::Attribute.make(
73
+ key: key,
74
+ transformers: [
75
+ { type: NOW_TYPE }
76
+ ]
77
+ )
78
+ end
68
79
  end
69
80
  end
70
81
  end
@@ -8,5 +8,5 @@
8
8
  #
9
9
 
10
10
  module DbFuel
11
- VERSION = '2.0.0'
11
+ VERSION = '2.0.1'
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db_fuel
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ruggio
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-03-16 00:00:00.000000000 Z
12
+ date: 2021-03-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord