title: Replacing default id for rails with a custom id
body: <pre><code>Rails 5.1
  Devise
  Devise Invitable
  </code></pre>
  
  <p>In models/concerns/shared.rb, I have:</p>
  
  <pre><code>module Shared
  
    extend ActiveSupport::Concern
  
    def generate_model_id
      self.id = "#{self.class.name}.#{Time.now.to_f.to_s}" if id.blank?
    end  
  </code></pre>
  
  <p>In my create_usres migration file, I have:</p>
  
  <pre><code>class DeviseCreateUsers &lt; ActiveRecord::Migration[5.1]
    def change
      create_table :users, id: false  do |t|
        t.column :id, :primary_string
  </code></pre>
  
  <p>In my models/user.rb, I have:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
  
    include Shared
  
    enum role: [:user, :vip, :admin]
    after_initialize :set_default_role, :if =&gt; :new_record?
  
    devise :invitable, :database_authenticatable, :registerable,
          :recoverable, :rememberable, :trackable, :validatable
  </code></pre>
  
  <p>In my seeds.rb file, I have:</p>
  
  <pre><code>user = User.new(
      :email =&gt;'myemail@mydomain.com',
      :password =&gt;'xK#986754',
      :password_confirmation =&gt;'xK#986754',
      :first_name =&gt;'John',
      :last_name =&gt;'Doe',
      :role =&gt; 1,
      :approved =&gt; true
  )
  user.skip_invitation
  user.save         
  </code></pre>
  
  <p>I have exported all the Devise models (confirmations, invitations, passwords, registrations, sessions, unlocks), and put the corresponding controllers under the controllers/users folder.</p>
  
  <p>Which controller do I call the generate_model_id method from, and where?    </p>