Prevent foreign_key_for? from evaluating all attributes

Attributes should be evaluated lazily if possible (this prevents slow type-casting of date/time/timestamp columns when they are not used). `attributes.has_key?` caused all attributes to be evaluated just to set inverse association record instance.