Re: [Rails] Rspec Active Record Problem

2014-09-24 Thread Jason Fleetwood-Boldt
I think what apot...@gmail.com pointed out is most poignant, you can accomplish what you are trying to accomplish with this (ruby 2 syntax) scope :low_level, -> { where(:level => 1) } The you reference this scope as Article.low_level as you get your hands dirty with AR scopes, read & understa

Re: [Rails] Rspec Active Record Problem

2014-09-24 Thread Alexandre Calvão
Try using scope . === *Alexandre Mondaini Calvão* "*Nossa recompensa se encontra no esforço e não no resultado. Um esforço total é uma vitória completa*." [Ghandi] 2014-09-24 12:52 GMT-03:00 Jason Fleetwood-Boldt

Re: [Rails] Rspec Active Record Problem

2014-09-24 Thread Jason Fleetwood-Boldt
Jan, That is pretty strange-- but it looks like you're doing something non-standard and you've gotten yourself into a pickle. I notice that the error message says there's no method 'where' on an instance of an Article. Normally you call where on the class itself. First of all, why is your c

[Rails] Rspec Active Record Problem

2014-09-24 Thread Jan Yo
Rspec forum isn't working Rspec is having trouble recognizing where method. Here's the rspec output: NoMethodError: undefined method `where' for # # /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