HABTM, push_with_attributes, and validations


#1

Is it possible to perform validations on HABTM associations? That is,
if I have a table like:
person_id
place_id
comment

I want to ‘push_with_attributes’ and set the comment field. Can I do a
validation on the comment field such as validates_presence_of?

Since the association doesn’t have a model, where does this validation
go?

Jake


#2

I think that the path of least resistence would be to introduce a
model object for the relation if you need to doing validation and
other model-like behaviour.