date_time_attribute 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/date_time_attribute.gemspec +1 -1
- data/lib/date_time_attribute.rb +2 -2
- data/spec/active_record_spec.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjNiMzFiYjM3NzE2ZWNhY2U3Y2Y3MDIyMzFiZTUxYjc3M2ZiZmQyOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YWVkMjNhZDI2N2I0ZTU1ODkwMzZiYjRmNGRhYzJiZDNhZGIyODM4ZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODIyMzliYTdlNWQ3YzgzM2VkNzQzNzllNjM4MDFmZmMxNjI2MTEyZTk4NjRj
|
10
|
+
MDRhNGUzYmQxY2QwZDJmODBhZDBiNGFlNTY3ODZhYTQ1NGVhYmUxZWRlNmI3
|
11
|
+
ZWI1Mjg1Y2JiOTc1M2Q1MjdiOTdlMjg3MGY5MGJkMmZlY2Q3OTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTMyNDgzZmMzMzU4NmUzZDYyZDk1YjAzZmE1MTIxNzc3NDUwMzJlNGJkMmVl
|
14
|
+
NWMwN2Y5Y2E2MDM4NjIyZjBmMmE5NDY1M2M5MTMzYWNhMGFhNzJiM2NhMmJk
|
15
|
+
MzdlMTMzMGEwZDE4ZTE2YmQ1ZTdlZTE3NGQ3NDI4NDdhZWZhNjc=
|
data/date_time_attribute.gemspec
CHANGED
data/lib/date_time_attribute.rb
CHANGED
@@ -4,7 +4,7 @@ require 'active_support/duration'
|
|
4
4
|
require 'date_time_attribute/container'
|
5
5
|
|
6
6
|
module DateTimeAttribute
|
7
|
-
VERSION = '0.0.
|
7
|
+
VERSION = '0.0.8'
|
8
8
|
|
9
9
|
extend ActiveSupport::Concern
|
10
10
|
|
@@ -56,7 +56,7 @@ module DateTimeAttribute
|
|
56
56
|
is_active_record_attribute = respond_to?(:attribute_method?) && attribute_method?(attribute)
|
57
57
|
|
58
58
|
# ActiveRecord lazy initialization issue: https://github.com/einzige/date_time_attribute/issues/2
|
59
|
-
if is_active_record_attribute &&
|
59
|
+
if is_active_record_attribute && !@attribute_methods_generated
|
60
60
|
define_attribute_methods
|
61
61
|
end
|
62
62
|
|
data/spec/active_record_spec.rb
CHANGED
@@ -100,4 +100,9 @@ describe DateTimeAttribute, ActiveRecord::Base, use_active_record: true do
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
end
|
103
|
-
|
103
|
+
|
104
|
+
context "loaded from db" do
|
105
|
+
subject { Model.find(Model.create!(created_at: '2014-01-01 12:00:00').id) }
|
106
|
+
its(:created_at) { should == DateTime.new(2014, 01, 01, 12, 0, 0) }
|
107
|
+
end
|
108
|
+
end
|