edtf-rails 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/edtf-rails.gemspec +1 -1
- data/lib/edtf-rails/edtf-rails.rb +12 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5
|
data/edtf-rails.gemspec
CHANGED
@@ -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
|
+
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:
|
200
|
+
hash: 726884819160711910
|
201
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
202
202
|
none: false
|
203
203
|
requirements:
|