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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/db_fuel/modeling/attribute_renderer_set.rb +21 -10
- data/lib/db_fuel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81819bf8d353ae3425d90360089da3857aa5ccaeb56ffc499557bd036d318493
|
4
|
+
data.tar.gz: 32ee04a7d5c25f3f6b40dae72809aa8752d00e9736abf03bde7b0a08ef18f86a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9bf6c8852f0da644839fc0883daceae2808c4646e5a26581da878dca9f09c71e7b3de887c0ac4f2107a3a7cdd3e8ccc6e58f70e01a5717bbae5842aa6691387
|
7
|
+
data.tar.gz: c1c2fb22e493cecc947d1f597ba91118c5f62acd1dd4263842b3004aa8d18943ff8910600ab2a8bde39a54eb50de8db220e309941ff439a02d19895fec7d8d97
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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 = [
|
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 = [
|
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
|
data/lib/db_fuel/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2021-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|