Skip to content

Instantly share code, notes, and snippets.

@abaldwin88
Created November 1, 2019 09:58
Show Gist options
  • Save abaldwin88/e9f3145d294e0adf09bf88930b887661 to your computer and use it in GitHub Desktop.
Save abaldwin88/e9f3145d294e0adf09bf88930b887661 to your computer and use it in GitHub Desktop.
class ApplicationRecord < ActiveRecord::Base
...
after_create_commit do
ActiveRecord::Base.connection.execute("CLUSTER #{self.class.table_name}")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment