ruby on rails - Undefined method `on_ride_photo=' -


model:

class coaster < activerecord::base    extend friendlyid   friendly_id :slug, use: :slugged    belongs_to :park   belongs_to :manufacturer    attr_accessible :name,                   :height,                   :speed,                   :length,                   :inversions,                   :material,                   :lat,                   :lng,                   :park_id,                   :notes,                   :manufacturer_id,                   :style,                   :covering,                   :ride_style,                   :model,                   :layout,                   :dates_ridden,                   :times_ridden,                   :order,                   :on_ride_photo 

test:

it { should validate_presence_of(:on_ride_photo) } { should ensure_inclusion_of(:on_ride_photo).in_array([true, false]) } { should_not allow_value(4).for(:on_ride_photo) } { should_not allow_value('lots').for(:on_ride_photo) } 

factory:

factorygirl.define    factory :coaster     association :park     name 'nemesis'     speed 60     height 60     length 160     inversions 4     on_ride_photo true   end  end 

errors:

 failure/error: subject { factorygirl.build(:coaster) }  nomethoderror:    undefined method `on_ride_photo=' #<coaster:0x007fe9a0aec798> 

any thoughts. looks it's not seeing setter on_ride_photo have used in console , get , set using it.

have added recently? if might need update test database:

rake db:test:load 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -