edtf-rails 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.2.5
data/edtf-rails.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "edtf-rails"
8
- s.version = "0.2.4"
8
+ s.version = "0.2.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["masciugo"]
@@ -59,6 +59,18 @@ module EdtfRails
59
59
  end
60
60
  end
61
61
 
62
+ # virtual attributes settings after any initialization
63
+ after_initialize do
64
+ unless new_record?
65
+ edtf_attributes.each do |d|
66
+ date_array = read_attribute(d).to_s.split('-')
67
+ [:y, :m, :d].each_with_index do |x,i|
68
+ send("#{d}_#{x}=",date_array[i])
69
+ end
70
+ end
71
+ end
72
+ end
73
+
62
74
 
63
75
  # Include instance methods and class methods
64
76
  # include EdtfRails::GettersAndSetters
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edtf-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -197,7 +197,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
197
197
  version: '0'
198
198
  segments:
199
199
  - 0
200
- hash: 2095822184312712477
200
+ hash: 726884819160711910
201
201
  required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  none: false
203
203
  requirements: