ActiveModel ::Errors

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!!

How about:

[:start, :stop].each { |attr| errors.add(a,“date must be…”) }

It seems good enough to me, without the need of new APIs. Wdyt?

Thanks Carlitos, It seems good enough also to me