I have a model called meetings which will be used to store details of meetings etc. Previously I had only the basic fields included: id, created_at and updated_at included with a blank factories class used when I called:
@meeting_attr = FactoryGirl.attributes_for(:meeting)
@meeting = Meeting.create(@meeting_attr)
This was working just fine until I added another column to the database called name which will be used to give more information of the meeting type. I have checked that the migration ran OK and can see that it is included in the database table and the schema.rb but when I run the code previously mentioned I am now getting this error:
Failure/Error: @meeting = Meeting.create(@meeting_attr)
ActiveRecord::UnknownAttributeError:
unknown attribute: name
Is there any reason that I might have overlooked that is causing this attribute not to be recognized. Any help would be greatly appreciated
rake db:test:prepare had to be run before the updated table details were recognised