lib/time_attr_accessor.rb in inbox-0.13.0 vs lib/time_attr_accessor.rb in inbox-0.14.0
- old
+ new
@@ -1,10 +1,12 @@
module Inbox
module TimeAttrAccessor
def time_attr_accessor(attr)
parameter attr
define_method "#{attr}=" do |value|
- instance_variable_set "@#{attr}", Time.at(value).utc
+ if value
+ instance_variable_set "@#{attr}", Time.at(value).utc
+ end
end
end
end
end
\ No newline at end of file