mongoid-friendly-timestamps 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,8 @@
1
1
  module Mongoid
2
2
  module Friendly
3
3
  module Timestamps
4
+ FRIENDLY_FORMAT = '%d-%b-%Y %H:%M:%S.%N'
5
+
4
6
  extend ActiveSupport::Concern
5
7
 
6
8
  module ClassMethods
@@ -19,7 +21,7 @@ module Mongoid
19
21
  update_friendly_field_method_name = "update_friendly_timestamp_field_#{friendly_name}"
20
22
 
21
23
  define_method update_friendly_field_method_name do
22
- self[friendly_name] = Time.at(self[raw_name]).strftime '%d-%b-%Y %H:%M:%S.%N'
24
+ self[friendly_name] = Time.at(self[raw_name]).utc.strftime FRIENDLY_FORMAT
23
25
  end
24
26
 
25
27
  define_method "#{raw_name}=" do |value|
@@ -1,7 +1,7 @@
1
1
  module Mongoid
2
2
  module Friendly
3
3
  module Timestamps
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mongoid-friendly-timestamps
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Lee Henson