# ActiveModel ::Errors

**URL:** <https://discuss.rubyonrails.org/t/activemodel-errors/66246>\
**Category:** rubyonrails-core\
**Created:** [January 30, 2013, 4:16pm UTC](https://discuss.rubyonrails.org/t/activemodel-errors/66246 "2013-01-30T16:16:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![angelo\_capilleri](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/angelo_capilleri/32/1633_2.png) [@angelo\_capilleri](https://discuss.rubyonrails.org/u/angelo_capilleri)\
**Post date:** [January 30, 2013, 4:16pm UTC](https://discuss.rubyonrails.org/t/activemodel-errors/66246/1 "2013-01-30T16:16:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![carlosantoniodasilva](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/carlosantoniodasilva/32/592_2.png) [@carlosantoniodasilva](https://discuss.rubyonrails.org/u/carlosantoniodasilva)\
**Post date:** [January 30, 2013, 4:26pm UTC](https://discuss.rubyonrails.org/t/activemodel-errors/66246/2 "2013-01-30T16:26:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![angelo\_capilleri](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/angelo_capilleri/32/1633_2.png) [@angelo\_capilleri](https://discuss.rubyonrails.org/u/angelo_capilleri)\
**Post date:** [January 30, 2013, 4:47pm UTC](https://discuss.rubyonrails.org/t/activemodel-errors/66246/3 "2013-01-30T16:47:51Z")

</div>

Thanks Carlitos, It seems good enough also to me
