Label references with custom foreign keys in rails fixtures Label references with custom foreign keys in rails fixtures sqlite sqlite

Label references with custom foreign keys in rails fixtures


I think your problem is that you're trying to use author when you've named the relationship user. If you want your fixture to work like that, then I think this should fix it up:

class List < ActiveRecord::Base  belongs_to :author, class_name: 'User', foreign_key: :author_id