我有一个Rails应用程序,最近我将我的数据库从MySql更改为PostgreSql,从那时起,活动记录import
方法:on_duplicate_key_update
引发了错误。
def import_of_products(import_links)
Product.import import_links, :on_duplicate_key_update => [:ad_id]
end
显示的错误是,
NoMethodError: undefined method `sql_for_on_duplicate_key_update' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter:0xab19f90>
from /home/mysystem/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-import-0.4.1/lib/activerecord-import/adapters/abstract_adapter.rb:48:in `post_sql_statements'
我正在跑步:
Rails version: 4.0.2
Ruby version: 2.0.0p643