Boy scout: rename variables with correct order
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user