added foreign_key option to has_many generator