Search code examples
ruby-on-rails-3rubygemsmeta-where

Ruby-on-rails gem failing for "where" condition of meta_where


I have a question about what is probably a gems problem, but may be meta-where. I used gems to install meta_where-1.0.4, and the response was that I succeeded and the uri for meta_where was provided, but when I tried a where-condition in the search method of a controller, similar to this example that meta-where provides:

Person.where(:skill_set.matches => 'Hello%'

an error was reported:

"undefined method 'matches' for :skill_set:Symbol"

It's as if the gem's methods aren't being accessed. I tried using "require" but that didn't help.
I'm using Windows XP, Firefox, Ruby 1.9.2.

What do I need to do? Thanks, Barney


Solution

  • I assume you have run the migrations and there is a skill_set attribute in the person table: you don't need require. Just add 'gem meta_where' to your Gemfile and then run 'bundle install'.