Search code examples
rubysequel

Error: undefined method `like' for Sequel:Module


I get this error:

Error: undefined method `like' for Sequel:Module

using:

@info = DB[:info].where(Sequel.like(:content, "%#{params[:sc]}%")) if params[:sc]

I found the example code in Sequel's documentation:

DB[:artists].where(Sequel.like(:name, 'A%'))

What's wrong with my code?


Solution

  • Which version of Sequel are you running? The documentation assumes the latest version, so if you aren't using the latest version, you should upgrade.