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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWNlYzFhOWQxMTFhNDU4MjUxOWVjYzY5YjcwNjMyZjg4YjdiMzFmOA==
4
+ YjNiMzFiYjM3NzE2ZWNhY2U3Y2Y3MDIyMzFiZTUxYjc3M2ZiZmQyOQ==
5
5
  data.tar.gz: !binary |-
6
- MTU3MzdhOGIxZWZiZGZiYzAzMDgwOTljOGZlMjQ3NGJiZjNkY2FmMA==
6
+ YWVkMjNhZDI2N2I0ZTU1ODkwMzZiYjRmNGRhYzJiZDNhZGIyODM4ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDQ4OTE3NDQ3YzBjMmQ3Nzg0MTQ3NTIwNzIzZGFlMWI3YjRiZTYwNWE1YWI0
10
- MzUwNWRiODdlMjM2OWU5NjQ4OThiM2U2ZWE2M2M1NzljMzUxMzY4NWY4MzA2
11
- Yjk2MmFiNWVhMTY0NjE5NTJmYzExYTQ5OTQzZDAwNjA0OWFjYWY=
9
+ ODIyMzliYTdlNWQ3YzgzM2VkNzQzNzllNjM4MDFmZmMxNjI2MTEyZTk4NjRj
10
+ MDRhNGUzYmQxY2QwZDJmODBhZDBiNGFlNTY3ODZhYTQ1NGVhYmUxZWRlNmI3
11
+ ZWI1Mjg1Y2JiOTc1M2Q1MjdiOTdlMjg3MGY5MGJkMmZlY2Q3OTc=
12
12
  data.tar.gz: !binary |-
13
- ZDI3ZDE1M2M0YzJmYTJlYWVmMTc3YWU0M2E3Zjk0MDBlMDY4NTM1NmJhZmZh
14
- NjRlZDc3ZTY5NDZhMDVjYjA2MmFlZDQzZDM4NzgwYzhjZmFmNzQ5MGU2Y2E2
15
- YmU1YTQwZWMxMTI4OTNjZjM3YjQyMmUzZGJhMzdmOWZiZGQ2YTQ=
13
+ OTMyNDgzZmMzMzU4NmUzZDYyZDk1YjAzZmE1MTIxNzc3NDUwMzJlNGJkMmVl
14
+ NWMwN2Y5Y2E2MDM4NjIyZjBmMmE5NDY1M2M5MTMzYWNhMGFhNzJiM2NhMmJk
15
+ MzdlMTMzMGEwZDE4ZTE2YmQ1ZTdlZTE3NGQ3NDI4NDdhZWZhNjc=
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{date_time_attribute}
5
- s.version = "0.0.7"
5
+ s.version = "0.0.8"
6
6
 
7
7
  s.date = %q{2013-11-22}
8
8
  s.authors = ["Sergei Zinin"]
@@ -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'
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 && @attribute_methods_generated
59
+ if is_active_record_attribute && !@attribute_methods_generated
60
60
  define_attribute_methods
61
61
  end
62
62
 
@@ -100,4 +100,9 @@ describe DateTimeAttribute, ActiveRecord::Base, use_active_record: true do
100
100
  end
101
101
  end
102
102
  end
103
- end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: date_time_attribute
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergei Zinin