Use if/else

Since we are using both branches of the code is preferable to use
if/else over the early return.
This commit is contained in:
Rafael Mendonça França 2014-06-30 17:41:50 -03:00
parent f39595a630
commit 2546610920

@ -18,8 +18,11 @@ def format_date(value)
end
def datetime_value(value)
return value unless value.is_a? String
DateTime.parse(value) rescue nil
if value.is_a? String
DateTime.parse(value) rescue nil
else
value
end
end
end
end