Podle toto post, měl by problém vyřešit:
class CreateEmployees < ActiveRecord::Migration
def change
create_table :employees, {:id => false} do |t|
t.string :employment_id, :unique => true
etc...
end
end
execute "ALTER TABLE employees ADD PRIMARY KEY (employment_id);"
end
Také ve vašem modelu:
class Employee < ActiveRecord::Base
set_primary_key :employment_id
...
end