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: 34866dac045629eb836f99aa75a2517669e7e5d6
4
- data.tar.gz: 1fbb68fa5675ea1defa9b7b22a2e94c8b1ae64d0
3
+ metadata.gz: aa3bd9832a12d18001f2d18750ac8f0f14bd8e64
4
+ data.tar.gz: 1d0e0ace78c54b73020d0bd2c50a11fb4caf8476
5
5
  SHA512:
6
- metadata.gz: 7edae5e8273014df61c7a37b5f80866815e9dfaa812c1c0acbd2b2a68f486af5364d56cb906d158ad0ae06831f90ce63508b99e8c29eaadfa89be74725bbdb77
7
- data.tar.gz: 61f6b85a1eeae54ddc8fb24a5692c026326515f925b0724664bd0d2d4ea943e38dbe4e31a4c970eaafffa0af2ae947ed4668089127e7d42da79b965adf3323c7
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.is_a?(Date) || new_date.nil?
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
@@ -1,3 +1,3 @@
1
1
  module GovUkDateFields
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end