Cucumber Undefined Method / Model Inheritance
I am receiving the following error, when running cucumber:
undefined method `overall_rating_id=' for #<OverallVote:0x102f1c4a0> (NoMethodError)
Rel开发者_如何学Pythonevant classes are:
class OverallVote < Vote
belongs_to :overall_rating
attr_accessible :overall_rating_id
end
class OverallRating < Rating
has_many :overall_votes
end
I thought that the setter method should be available as long as I set attr_accessible for the overall_rating_id field. Why doesn't it work?
Are you running cucumber in a separate environment? With it's own DB?
It sounds like your test/cucumber db is out of sync with your development schema (where you added this field)
精彩评论