module Sequel::Plugins::AssociationPks::InstanceMethods

def convert_pk_array(opts, pks)

typecast all provided values to integer before using them.
If the associated class's primary key column type is integer,
def convert_pk_array(opts, pks)
  if klass = opts.associated_class and sch = klass.db_schema and col = sch[klass.primary_key] and col[:type] == :integer
    pks.map{|pk| model.db.typecast_value(:integer, pk)}
  else
    pks
  end
end