Is it legal to override AR:Base#== and #eql?

I have several cases of models where object identity is not important,
but only the (guaranteed) unique combination of attribute values. In
these cases it is convenient to override #== in a way that two objects
with the same attribute values but different IDs are still considered
equal. This is very handy when assigning to has_many associations
because then existing associated objects are not touched (deleted in
particular) and foreign key constraints of other references to these
objects are not violated.

My only concern is that something inside AR might depend on #== being
tied to database object identity.

Michael

My only concern is that something inside AR might depend on #== being
tied to database object identity.

There's nothing that I'm aware of. However I'd definitely say this is
'unsupported hackery', so if something does break you'll kinda be on
your own. Do let us know though :wink:

That's about what I thought :expressionless: I think it should be stated in the docs
one way or another, however, I don't yet know which way it is.

Michael