I want made a PR to get the possibility to add more attribute for errors.add method:
Ex.
Now:
…
validate dates_must_be_coherent
def dates must be coherent
if start.present? && stop.present? && start > stop
errors.add(:start,“date must be …”)
errors.add(:stop,“date must be…”)
end
end
with the PR:
def dates must be coherent
if start.present? && stop.present? && start > stop
errors.add([:start, :stop],“date must be …”)
end
end
Thanks for reviews!!