views:

69

answers:

1

I am receiving the following error, when running cucumber:

undefined method `overall_rating_id=' for #<OverallVote:0x102f1c4a0> (NoMethodError)

Relevant 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?

A: 

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)

Winfield
i ran rake environment RAILS_ENV=test db:migrate:reset. so I don't think that's the issue
Tian