Can modifying Rails default primary keys cause a problem?

0

By default, Rails generates the id field for all my tables, and I'd like to know if it might generate an error in the future if I change the name and type of the key. I ask this because I realized that Rails has some naming conventions that should be followed. I apologize if the question is a bit silly, but I'm worried about the possibility of problems in the future.

    
asked by anonymous 05.09.2017 / 01:01

1 answer

1

You can change the primary key to another column:

class Project < ActiveRecord::Base
  self.primary_key = 'nomecoluna'
end

link

    
26.09.2017 / 06:54