If you want to be sure that an association is present, you’ll need to test whether the foreign key used to map the association is present, and not the associated object itself.
class LineItem < ActiveRecord::Base
validates :order_id, :presence => true
However, after a few tests, I now think this is not so. It seems that you may indeed validate de presence of an instance at the opposite end of an association, and that you may do this from either end of the association. Am I wrong? The Rails documentation does not help in this case.