Please verify/merge issue https://github.com/rails/rails/issues/3450

I reported this issue a while ago and just got around to writing a test and a fix.

It would be nice if someone could provide a second look and improve or merge this

Short description: When creating an association

class Foo

belongs_to :bar, :validate => true

end

the validation does not check if the target of the association proxy is stale and can end up validating an object

that is different from the one you would receive from foo.bar.