conditionally add foreign key to belongs_to associations in Rails models generator