Ruby on Rails Wednesday, September 24, 2014

Rspec forum isn't working

Rspec is having trouble recognizing where method.

Here's the rspec output:

NoMethodError:
undefined method `where' for #<Article:0x000000066ceb38>
#
/apps/rvm/gems/ruby-2.0.0-p481/gems/activemodel-4.0.10/lib/active_model/attribute_methods.rb:439:in
`method_missing'
#
/apps/rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.0.10/lib/active_record/attribute_methods.rb:168:in
`method_missing'
#
/apps/rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.0.10/lib/active_record/querying.rb:9:in
`where'


The spec calls index which then calls a public method that uses the
following method:

class X < ActiveRecord::Base
def self.low_level
where(:level=> 1)
end
end

Any ideas what could be the problem?

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e57569067e69836623c4585564c5565f%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment