Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .annotaterb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
:position: before
:position_in_additional_file_patterns: before
:position_in_class: before
:position_in_factory: before
:position_in_fixture: before
:position_in_routes: before
:position_in_serializer: before
:position_in_test: before
:classified_sort: true
:exclude_controllers: true
:exclude_factories: false
:exclude_fixtures: false
:exclude_helpers: true
:exclude_scaffolds: true
:exclude_serializers: false
:exclude_sti_subclasses: false
:exclude_tests: false
:force: false
:format_markdown: false
:format_rdoc: false
:format_yard: false
:frozen: false
:grouped_polymorphic: false
:ignore_model_sub_dir: false
:ignore_unknown_models: false
:include_version: false
:show_check_constraints: false
:show_complete_foreign_keys: false
:show_foreign_keys: true
:show_indexes: true
:show_indexes_include: false
:simple_indexes: false
:sort: false
:timestamp: false
:trace: false
:with_comment: true
:with_column_comments: true
:with_table_comments: true
:position_of_column_comment: :with_name
:active_admin: false
:command:
:debug: false
:hide_default_column_types: ''
:hide_limit_column_types: ''
:timestamp_columns:
- created_at
- updated_at
:ignore_columns:
:ignore_routes:
:models: true
:routes: false
:skip_on_db_migrate: false
:target_action: :do_annotations
:wrapper:
:wrapper_close:
:wrapper_open:
:classes_default_to_s: []
:additional_file_patterns: []
:model_dir:
- app/models
:require: []
:root_dir:
- ''
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ group :development do

# Use letter_opener to preview emails in the browser in development [https://github.com/ryanb/letter_opener]
gem "letter_opener"

# Automatically annotate models with schema information
gem "annotaterb"
end

group :test do
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ GEM
uri (>= 0.13.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
annotaterb (4.18.0)
activerecord (>= 6.0.0)
activesupport (>= 6.0.0)
ast (2.4.3)
base64 (0.3.0)
bcrypt (3.1.20)
Expand Down Expand Up @@ -441,6 +444,7 @@ PLATFORMS
x86_64-linux-musl

DEPENDENCIES
annotaterb
bcrypt (~> 3.1.7)
bootsnap
brakeman
Expand Down
13 changes: 13 additions & 0 deletions app/models/org.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: orgs
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# clerk_org_id :string not null
#
# Indexes
#
# index_orgs_on_clerk_org_id (clerk_org_id) UNIQUE
#
class Org < ApplicationRecord
validates :clerk_org_id, presence: true, uniqueness: true
end
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# Table name: users
#
# id :bigint not null, primary key
# clerk_id :string not null
# created_at :datetime not null
# updated_at :datetime not null
# clerk_id :string not null
#
# Indexes
#
Expand Down
3 changes: 2 additions & 1 deletion db/cable_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[8.0].define(version: 2025_08_03_194905) do
ActiveRecord::Schema[8.0].define(version: 2025_08_19_145110) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_catalog.plpgsql"

Expand All @@ -25,6 +25,7 @@
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "clerk_id", null: false
t.string "test_field"
t.index ["clerk_id"], name: "index_users_on_clerk_id", unique: true
end
end
3 changes: 2 additions & 1 deletion db/cache_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[8.0].define(version: 2025_08_03_194905) do
ActiveRecord::Schema[8.0].define(version: 2025_08_19_145110) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_catalog.plpgsql"

Expand All @@ -25,6 +25,7 @@
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "clerk_id", null: false
t.string "test_field"
t.index ["clerk_id"], name: "index_users_on_clerk_id", unique: true
end
end
3 changes: 2 additions & 1 deletion db/queue_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[8.0].define(version: 2025_08_03_194905) do
ActiveRecord::Schema[8.0].define(version: 2025_08_19_145110) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_catalog.plpgsql"

Expand All @@ -25,6 +25,7 @@
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "clerk_id", null: false
t.string "test_field"
t.index ["clerk_id"], name: "index_users_on_clerk_id", unique: true
end
end
10 changes: 10 additions & 0 deletions lib/tasks/annotate_rb.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

# This rake task was added by annotate_rb gem.

# Can set `ANNOTATERB_SKIP_ON_DB_TASKS` to be anything to skip this
if Rails.env.development? && ENV["ANNOTATERB_SKIP_ON_DB_TASKS"].nil?
require "annotate_rb"

AnnotateRb::Core.load_rake_tasks
end
13 changes: 13 additions & 0 deletions spec/factories/users.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: users
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# clerk_id :string not null
#
# Indexes
#
# index_users_on_clerk_id (clerk_id) UNIQUE
#
FactoryBot.define do
factory :user do
sequence(:clerk_id) { |n| "user_#{n}_clerk_id" }
Expand Down