I have a model Post and each time a post is created I want a new instance of Moderation to be created at the same time.
Post
Moderation
So in post.rb I use the
Fix pkey sequences for all database:
ActiveRecord::Base.connection.tables.each do |table_name| ActiveRecord::Base.connection.reset_pk_sequence!(table_name) end