Skip to content

Commit

Permalink
replace annotate by annotaterb (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienpoly authored Nov 9, 2024
1 parent ff2e0c0 commit ca3473f
Show file tree
Hide file tree
Showing 43 changed files with 486 additions and 403 deletions.
58 changes: 58 additions & 0 deletions .annotaterb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
: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: true
:force: false
:format_markdown: false
:format_rdoc: false
:format_yard: false
:frozen: 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
:simple_indexes: true
:sort: true
:timestamp: false
:trace: false
:with_comment: true
:with_column_comments: true
:with_table_comments: true
:active_admin: false
:command:
:debug: false
:hide_default_column_types: ""
:hide_limit_column_types: ""
: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:
- ""
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ group :development, :test do
end

group :development do
gem "annotate"
gem "annotaterb"
# Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console"

Expand Down
6 changes: 2 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ GEM
activesupport (>= 6.1)
device_detector (>= 1)
safely_block (>= 0.4)
annotate (2.6.5)
activerecord (>= 2.3.0)
rake (>= 0.8.7)
annotaterb (4.13.0)
appsignal (3.13.1)
rack
ast (2.4.2)
Expand Down Expand Up @@ -576,7 +574,7 @@ PLATFORMS
DEPENDENCIES
active_job-performs (~> 0.3.1)
ahoy_matey
annotate
annotaterb
appsignal (~> 3.4)
authentication-zero
avo
Expand Down
14 changes: 10 additions & 4 deletions app/models/ahoy/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
# Table name: ahoy_events
#
# id :integer not null, primary key
# visit_id :integer
# user_id :integer
# name :string
# name :string indexed => [time]
# properties :text
# time :datetime
# time :datetime indexed => [name]
# user_id :integer indexed
# visit_id :integer indexed
#
# Indexes
#
# index_ahoy_events_on_name_and_time (name,time)
# index_ahoy_events_on_user_id (user_id)
# index_ahoy_events_on_visit_id (visit_id)
#
# rubocop:enable Layout/LineLength
class Ahoy::Event < ApplicationRecord
Expand Down
41 changes: 23 additions & 18 deletions app/models/ahoy/visit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,36 @@
# Table name: ahoy_visits
#
# id :integer not null, primary key
# visit_token :string
# visitor_token :string
# user_id :integer
# ip :string
# user_agent :text
# referrer :text
# referring_domain :string
# landing_page :text
# app_version :string
# browser :string
# os :string
# device_type :string
# country :string
# region :string
# city :string
# country :string
# device_type :string
# ip :string
# landing_page :text
# latitude :float
# longitude :float
# utm_source :string
# utm_medium :string
# utm_term :string
# utm_content :string
# utm_campaign :string
# app_version :string
# os :string
# os_version :string
# platform :string
# referrer :text
# referring_domain :string
# region :string
# started_at :datetime
# user_agent :text
# utm_campaign :string
# utm_content :string
# utm_medium :string
# utm_source :string
# utm_term :string
# visit_token :string indexed
# visitor_token :string
# user_id :integer indexed
#
# Indexes
#
# index_ahoy_visits_on_user_id (user_id)
# index_ahoy_visits_on_visit_token (visit_token) UNIQUE
#
# rubocop:enable Layout/LineLength
class Ahoy::Visit < ApplicationRecord
Expand Down
18 changes: 14 additions & 4 deletions app/models/connected_account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,24 @@
# Table name: connected_accounts
#
# id :integer not null, primary key
# uid :string
# provider :string
# username :string
# user_id :integer not null
# access_token :string
# expires_at :datetime
# provider :string indexed => [uid], indexed => [username]
# uid :string indexed => [provider]
# username :string indexed => [provider]
# created_at :datetime not null
# updated_at :datetime not null
# user_id :integer not null, indexed
#
# Indexes
#
# index_connected_accounts_on_provider_and_uid (provider,uid) UNIQUE
# index_connected_accounts_on_provider_and_username (provider,username) UNIQUE
# index_connected_accounts_on_user_id (user_id)
#
# Foreign Keys
#
# user_id (user_id => users.id)
#
# rubocop:enable Layout/LineLength
class ConnectedAccount < ApplicationRecord
Expand Down
10 changes: 9 additions & 1 deletion app/models/email_verification_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
# Table name: email_verification_tokens
#
# id :integer not null, primary key
# user_id :integer not null
# user_id :integer not null, indexed
#
# Indexes
#
# index_email_verification_tokens_on_user_id (user_id)
#
# Foreign Keys
#
# user_id (user_id => users.id)
#
# rubocop:enable Layout/LineLength
class EmailVerificationToken < ApplicationRecord
Expand Down
25 changes: 19 additions & 6 deletions app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,29 @@
# Table name: events
#
# id :integer not null, primary key
# date :date
# city :string
# country_code :string
# organisation_id :integer not null
# date :date
# name :string default(""), not null, indexed
# slug :string default(""), not null, indexed
# talks_count :integer default(0), not null
# website :string default("")
# created_at :datetime not null
# updated_at :datetime not null
# name :string default(""), not null
# slug :string default(""), not null
# talks_count :integer default(0), not null
# canonical_id :integer
# canonical_id :integer indexed
# organisation_id :integer not null, indexed
#
# Indexes
#
# index_events_on_canonical_id (canonical_id)
# index_events_on_name (name)
# index_events_on_organisation_id (organisation_id)
# index_events_on_slug (slug)
#
# Foreign Keys
#
# canonical_id (canonical_id => events.id)
# organisation_id (organisation_id => organisations.id)
#
# rubocop:enable Layout/LineLength
class Event < ApplicationRecord
Expand Down
21 changes: 14 additions & 7 deletions app/models/organisation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,25 @@
# Table name: organisations
#
# id :integer not null, primary key
# name :string default(""), not null
# description :text default(""), not null
# frequency :integer default("unknown"), not null, indexed
# kind :integer default("conference"), not null, indexed
# language :string default(""), not null
# name :string default(""), not null, indexed
# slug :string default(""), not null, indexed
# twitter :string default(""), not null
# website :string default(""), not null
# kind :integer default("conference"), not null
# frequency :integer default("unknown"), not null
# youtube_channel_name :string default(""), not null
# created_at :datetime not null
# updated_at :datetime not null
# youtube_channel_id :string default(""), not null
# youtube_channel_name :string default(""), not null
# slug :string default(""), not null
# twitter :string default(""), not null
# language :string default(""), not null
#
# Indexes
#
# index_organisations_on_frequency (frequency)
# index_organisations_on_kind (kind)
# index_organisations_on_name (name)
# index_organisations_on_slug (slug)
#
# rubocop:enable Layout/LineLength
class Organisation < ApplicationRecord
Expand Down
10 changes: 9 additions & 1 deletion app/models/password_reset_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
# Table name: password_reset_tokens
#
# id :integer not null, primary key
# user_id :integer not null
# user_id :integer not null, indexed
#
# Indexes
#
# index_password_reset_tokens_on_user_id (user_id)
#
# Foreign Keys
#
# user_id (user_id => users.id)
#
# rubocop:enable Layout/LineLength
class PasswordResetToken < ApplicationRecord
Expand Down
12 changes: 10 additions & 2 deletions app/models/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@
# Table name: sessions
#
# id :integer not null, primary key
# user_id :integer not null
# user_agent :string
# ip_address :string
# user_agent :string
# created_at :datetime not null
# updated_at :datetime not null
# user_id :integer not null, indexed
#
# Indexes
#
# index_sessions_on_user_id (user_id)
#
# Foreign Keys
#
# user_id (user_id => users.id)
#
# rubocop:enable Layout/LineLength
class Session < ApplicationRecord
Expand Down
35 changes: 23 additions & 12 deletions app/models/speaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,32 @@
# Table name: speakers
#
# id :integer not null, primary key
# name :string default(""), not null
# twitter :string default(""), not null
# github :string default(""), not null
# bio :text default(""), not null
# bsky :string default(""), not null
# github :string default(""), not null
# linkedin :string default(""), not null
# mastodon :string default(""), not null
# name :string default(""), not null, indexed
# pronouns :string default(""), not null
# pronouns_type :string default("not_specified"), not null
# slug :string default(""), not null, indexed
# speakerdeck :string default(""), not null
# talks_count :integer default(0), not null
# twitter :string default(""), not null
# website :string default(""), not null
# slug :string default(""), not null
# created_at :datetime not null
# updated_at :datetime not null
# talks_count :integer default(0), not null
# canonical_id :integer
# speakerdeck :string default(""), not null
# pronouns_type :string default("not_specified"), not null
# pronouns :string default(""), not null
# mastodon :string default(""), not null
# bsky :string default(""), not null
# linkedin :string default(""), not null
# canonical_id :integer indexed
#
# Indexes
#
# index_speakers_on_canonical_id (canonical_id)
# index_speakers_on_name (name)
# index_speakers_on_slug (slug) UNIQUE
#
# Foreign Keys
#
# canonical_id (canonical_id => speakers.id)
#
# rubocop:enable Layout/LineLength
class Speaker < ApplicationRecord
Expand All @@ -40,6 +50,7 @@ class Speaker < ApplicationRecord
# associations
has_many :speaker_talks, dependent: :destroy, inverse_of: :speaker, foreign_key: :speaker_id
has_many :talks, through: :speaker_talks, inverse_of: :speakers
has_many :events, -> { distinct }, through: :talks, inverse_of: :speakers
has_many :aliases, class_name: "Speaker", foreign_key: "canonical_id"

belongs_to :canonical, class_name: "Speaker", optional: true
Expand Down
12 changes: 9 additions & 3 deletions app/models/speaker_talk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
#
# Table name: speaker_talks
#
# speaker_id :integer not null
# talk_id :integer not null
# id :integer not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# id :integer not null, primary key
# speaker_id :integer not null, indexed, indexed => [talk_id]
# talk_id :integer not null, indexed => [speaker_id], indexed
#
# Indexes
#
# index_speaker_talks_on_speaker_id (speaker_id)
# index_speaker_talks_on_speaker_id_and_talk_id (speaker_id,talk_id) UNIQUE
# index_speaker_talks_on_talk_id (talk_id)
#
# rubocop:enable Layout/LineLength
class SpeakerTalk < ApplicationRecord
Expand Down
Loading

0 comments on commit ca3473f

Please sign in to comment.