Champ: fix indentation

This commit is contained in:
Simon Lehericey 2017-08-29 10:38:48 +02:00 committed by Mathieu Magnin
parent dd929ef3bd
commit faf2d2814b

View file

@ -71,9 +71,9 @@ class Champ < ActiveRecord::Base
def serialize_datetime_if_needed def serialize_datetime_if_needed
if (value =~ /=>/).present? if (value =~ /=>/).present?
date = begin date = begin
hash_date = YAML.safe_load(value.gsub('=>', ': ')) hash_date = YAML.safe_load(value.gsub('=>', ': '))
year, month, day, hour, minute = hash_date.values_at(1,2,3,4,5) year, month, day, hour, minute = hash_date.values_at(1,2,3,4,5)
DateTime.new(year, month, day, hour, minute).strftime("%d/%m/%Y %H:%M") DateTime.new(year, month, day, hour, minute).strftime("%d/%m/%Y %H:%M")
rescue rescue
nil nil
end end