Ruby on rails 3 rails heroku查询帮助PGError:错误:运算符不存在:整数~~未知

Ruby on rails 3 rails heroku查询帮助PGError:错误:运算符不存在:整数~~未知,ruby-on-rails-3,activerecord,heroku,Ruby On Rails 3,Activerecord,Heroku,我在heroku中部署了一个带有ruby 1.9.3的rails 3.2.8,本地查询将所有书籍显示为结果或无结果,而在heroku中只显示以下错误 Started GET "/books/advanced_search?utf8=%E2%9C%93&title=elinor&author=&isbn=&commit=Search" for 157.253.204.87 at 2012-08-22 15:38:03 +0000 Parameters: {"utf

我在heroku中部署了一个带有ruby 1.9.3的rails 3.2.8,本地查询将所有书籍显示为结果或无结果,而在heroku中只显示以下错误

Started GET "/books/advanced_search?utf8=%E2%9C%93&title=elinor&author=&isbn=&commit=Search" for 157.253.204.87 at 2012-08-22 15:38:03 +0000

Parameters: {"utf8"=>"✓", "title"=>"elinor", "author"=>"", "isbn"=>"", "commit"=>"Search"}
Processing by BooksController#advanced_search as HTML
Rendered books/advanced_search.html.erb within layouts/application (24.0ms)
Completed 500 Internal Server Error in 25ms

ActionView::Template::Error (PGError: ERROR:  operator does not exist: integer ~~ unknown
LINE 1: ...tle LIKE '%elinor%' and author LIKE '%%' and isbn LIKE '%%')

HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
我试图通过书名(一个字符串)、作者(一个文本)和isbn(一个整数)在我的迷你目录中查找书籍,不管是其中任何一本还是所有的

我的问题是:

@books = Book.paginate(
      page: params[:page], per_page: 10,
      :conditions => ['
                    title like ? ||
                    author like ?  ||
                    isbn like ?',
          { :title => "%#{params[:title]}%",
            :author => "%#{params[:author]}%",
            :isbn => params[:isbn].to_i
          }
      ]
  ) 
模型如下:

class Book < ActiveRecord::Base
  attr_accessible :author, :isbn, :title, :description
  has_many :reviews, dependent: :destroy
  has_many :ratings, dependent: :destroy

  validates :author,      presence: true
  validates :description, presence: true
  validates :isbn,        presence: true
  validates :title,       presence: true


end
classbook

谢谢大家的帮助

因为DBs不喜欢整数查询,所以发生了错误