through mapping causes rspec error

by executing this command:

rails generate rspec:install

I got this error message.

~.rvm/gems/ruby-1.9.3-p194@ms/gems/activerecord-3.2.8/lib/active_record/dynamic_matchers.rb:50:in `method_missing': undefined local variable or method `consultant_id' for #<Class:0x007fdb93a08bd0> (NameError)

the problem was that in one of the models I used

:through => consultant_id

As soon I resolved this option it worked. Strange!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s