Boy scout: rename variables with correct order

This commit is contained in:
taitus
2019-04-24 18:20:44 +02:00
committed by Javi Martín
parent 090390c09f
commit 292a1adbbe

View File

@@ -1,12 +1,12 @@
module ActiveModel::Dates
def parse_date(field, attrs)
day, month, year = attrs["#{field}(1i)"],
year, month, day = attrs["#{field}(1i)"],
attrs["#{field}(2i)"],
attrs["#{field}(3i)"]
return nil unless day.present? && month.present? && year.present?
Date.new(day.to_i, month.to_i, year.to_i)
Date.new(year.to_i, month.to_i, day.to_i)
end
def remove_date(field, attrs)