gov_uk_date_fields 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa3bd9832a12d18001f2d18750ac8f0f14bd8e64
|
4
|
+
data.tar.gz: 1d0e0ace78c54b73020d0bd2c50a11fb4caf8476
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 541ee2377e913567ff3b4b78647088b5b779d2b05b80fad2fb51d0cd3c63a93b1facaf6454bc283c8a9d218fa27ded24ce7b00b80c5b4429b12b63ea92e5c2e6
|
7
|
+
data.tar.gz: 4271dcbcedc24bf76577fb00e8c6dba306be2f6f91e17a2283277ff22425a146048dc23dbab75ef965c87d1fc339e39224cb98fe013555522dc8d38164e6574c
|
@@ -60,7 +60,8 @@ module GovUkDateFields
|
|
60
60
|
|
61
61
|
# #dob=(date) = assigns a date to the GovukDateFields::FormDate object
|
62
62
|
define_method("#{field}=") do |new_date|
|
63
|
-
raise ArgumentError.new("#{new_date} is not a Date object") unless new_date.
|
63
|
+
raise ArgumentError.new("#{new_date} is not a Date object") unless new_date.respond_to?(:to_date) || new_date.nil?
|
64
|
+
new_date = new_date.to_date unless new_date.nil?
|
64
65
|
GovUkDateFields::FormDate.set_from_date(self, field, new_date)
|
65
66
|
end
|
66
67
|
|
@@ -100,6 +101,7 @@ module GovUkDateFields
|
|
100
101
|
|
101
102
|
include GovUkDateFields::ActsAsGovUkDate::LocalInstanceMethods
|
102
103
|
end
|
104
|
+
|
103
105
|
end
|
104
106
|
|
105
107
|
module LocalInstanceMethods
|