Skip to content

Instantly share code, notes, and snippets.

View AlyBadawy's full-sized avatar
:electron:
Creating smart software to future-proof the future

Aly Badawy AlyBadawy

:electron:
Creating smart software to future-proof the future
View GitHub Profile
@AlyBadawy
AlyBadawy / uuid_v7.rb
Created October 20, 2025 13:37
Rails/app/config/initializers/uuid_v7.rb
# config/initializers/uuidv7_default.rb
# Ensure generators use UUID columns for PKs and references
Rails.application.config.generators do |g|
g.orm :active_record, primary_key_type: :uuid
end
# When migrations call create_table with id: :uuid, make the DB default uuidv7()
module UuidV7PrimaryKeyDefault
def primary_key(name, type = :primary_key, **options)
AllCops:
NewCops: enable
Exclude:
- bin/yarn
- db/schema.rb
- vendor/**/*
- node_modules/**/*
- tmp/**/*
- public/**/*
- bin/**/*
@AlyBadawy
AlyBadawy / .overcommit.yml
Last active February 20, 2024 03:45
Rails + React Gists
PostCheckout:
BundleInstall:
enabled: true
PreCommit:
ALL:
problem_on_unmodified_line: warn
requires_files: true
required: false
quiet: false