specify another id for a custom one

1

I'm using a previously created database and the id of the table is called "idempresa" , how could you specify rails that the id will save it in that field?

    
asked by Alexander Marcano 29.06.2016 в 19:44
source

1 answer

0

Try to use

class Modelo < ActiveRecord::Base
  self.primary_key = "idempresa"
end

More info on the naming conventions that you can overwrite in: link

    
answered by 29.06.2016 / 22:49
source