Skip to content

Commit

Permalink
Switch annotaterb to maintained fork (#560)
Browse files Browse the repository at this point in the history
* Switch `annotaterb` to maintained fork

* Run `annotaterb models && annotaterb routes`
  • Loading branch information
robbevp authored Dec 14, 2024
1 parent 3425edc commit fcd86a9
Show file tree
Hide file tree
Showing 27 changed files with 532 additions and 19 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: false
: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: false
:sort: false
: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 @@ -32,7 +32,7 @@ group :development, :test do
end

group :development do
gem 'annotate', github: 'robbevp/annotate_models', branch: 'enhc/support-virtual-columns'
gem 'annotaterb', require: false
gem 'brakeman', require: false
gem 'erb_lint'
gem 'pgreset' # Easily reset the database while connections are active
Expand Down
12 changes: 2 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
GIT
remote: https://github.com/robbevp/annotate_models.git
revision: 099acde2ff0c1b7e64f70c996a77f907ee1121be
branch: enhc/support-virtual-columns
specs:
annotate (3.1.1)
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -83,6 +74,7 @@ GEM
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
annotaterb (4.13.0)
ast (2.4.2)
base64 (0.2.0)
bcrypt (3.1.20)
Expand Down Expand Up @@ -374,7 +366,7 @@ PLATFORMS
ruby

DEPENDENCIES
annotate!
annotaterb
bcrypt
bootsnap
brakeman
Expand Down
19 changes: 19 additions & 0 deletions app/models/category.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: categories
#
# id :bigint not null, primary key
# name :string not null
# created_at :datetime not null
# updated_at :datetime not null
# parent_id :bigint
#
# Indexes
#
# index_categories_on_name_and_parent_id (name,parent_id) UNIQUE
# index_categories_on_parent_id (parent_id)
#
# Foreign Keys
#
# fk_rails_... (parent_id => categories.id)
#
class Category < ApplicationRecord
include WithRecursiveSearch

Expand Down
27 changes: 27 additions & 0 deletions app/models/entry.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: entries
#
# id :bigint not null, primary key
# author :text
# body :text
# data :jsonb not null
# published_at :datetime
# read_at :datetime
# summary :text
# title :text
# url :text
# created_at :datetime not null
# updated_at :datetime not null
# external_id :text
# subscription_id :bigint not null
#
# Indexes
#
# index_entries_on_external_id_and_subscription_id (external_id,subscription_id) UNIQUE
# index_entries_on_subscription_id (subscription_id)
#
# Foreign Keys
#
# fk_rails_... (subscription_id => subscriptions.id)
#
class Entry < ApplicationRecord
FEEDJIRA_KEYS_MAP = {
author: :author,
Expand Down
13 changes: 13 additions & 0 deletions app/models/newsletter.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: newsletters
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# public_id :string not null
#
# Indexes
#
# index_newsletters_on_public_id (public_id) UNIQUE
#
class Newsletter < ApplicationRecord
PUBLIC_ID_LENGTH = 12
MAX_RETRY = 100
Expand Down
13 changes: 13 additions & 0 deletions app/models/proxied_image.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: proxied_images
#
# id :bigint not null, primary key
# url :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_proxied_images_on_url (url) UNIQUE
#
class ProxiedImage < ApplicationRecord
has_and_belongs_to_many :entries

Expand Down
12 changes: 12 additions & 0 deletions app/models/rss_feed.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: rss_feeds
#
# id :bigint not null, primary key
# last_etag :string
# last_fetched_at :datetime
# last_modified_at :datetime
# url :text not null
# created_at :datetime not null
# updated_at :datetime not null
#
class RssFeed < ApplicationRecord
has_one :subscription, as: :subscribable, dependent: :destroy
has_many :entries, through: :subscription
Expand Down
25 changes: 25 additions & 0 deletions app/models/subscription.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: subscriptions
#
# id :bigint not null, primary key
# category_text :string
# name :string not null
# subscribable_type :string not null
# created_at :datetime not null
# updated_at :datetime not null
# category_id :bigint
# subscribable_id :bigint not null
# user_id :bigint not null
#
# Indexes
#
# index_subscriptions_on_category_id (category_id)
# index_subscriptions_on_subscribable (subscribable_type,subscribable_id)
# index_subscriptions_on_user_id (user_id)
#
# Foreign Keys
#
# fk_rails_... (category_id => categories.id)
# fk_rails_... (user_id => users.id)
#
class Subscription < ApplicationRecord
belongs_to :user, inverse_of: :subscriptions
has_many :entries, dependent: :destroy
Expand Down
15 changes: 15 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: users
#
# id :bigint not null, primary key
# admin :boolean default(FALSE), not null
# email :citext not null
# password_digest :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_users_on_email (email) UNIQUE
#
class User < ApplicationRecord
has_secure_password

Expand Down
84 changes: 84 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,89 @@
# frozen_string_literal: true

# == Route Map
#
# Prefix Verb URI Pattern Controller#Action
# root GET / entries#index
# subscriptions GET /subscriptions(.:format) subscriptions#index
# POST /subscriptions(.:format) subscriptions#create
# new_subscription GET /subscriptions/new(.:format) subscriptions#new
# edit_subscription GET /subscriptions/:id/edit(.:format) subscriptions#edit
# subscription GET /subscriptions/:id(.:format) subscriptions#show
# PATCH /subscriptions/:id(.:format) subscriptions#update
# PUT /subscriptions/:id(.:format) subscriptions#update
# DELETE /subscriptions/:id(.:format) subscriptions#destroy
# entries GET /entries(.:format) entries#index
# entry GET /entries/:id(.:format) entries#show
# PATCH /entries/:id(.:format) entries#update
# PUT /entries/:id(.:format) entries#update
# DELETE /entries/:id(.:format) entries#destroy
# new_session GET /users/sign_in(.:format) sessions#new
# session POST /users/sign_in(.:format) sessions#create
# destroy_session DELETE /users/sign_out(.:format) sessions#destroy
# new_password GET /users/password/new(.:format) passwords#new
# edit_password GET /users/password/edit(.:format) passwords#edit
# password PATCH /users/password(.:format) passwords#update
# PUT /users/password(.:format) passwords#update
# POST /users/password(.:format) passwords#create
# edit_user GET /users/profile(.:format) users#edit
# user PATCH /users/profile(.:format) users#update
# PUT /users/profile(.:format) users#update
# good_job /good_job GoodJob::Engine
# turbo_recede_historical_location GET /recede_historical_location(.:format) turbo/native/navigation#recede
# turbo_resume_historical_location GET /resume_historical_location(.:format) turbo/native/navigation#resume
# turbo_refresh_historical_location GET /refresh_historical_location(.:format) turbo/native/navigation#refresh
# rails_postmark_inbound_emails POST /rails/action_mailbox/postmark/inbound_emails(.:format) action_mailbox/ingresses/postmark/inbound_emails#create
# rails_relay_inbound_emails POST /rails/action_mailbox/relay/inbound_emails(.:format) action_mailbox/ingresses/relay/inbound_emails#create
# rails_sendgrid_inbound_emails POST /rails/action_mailbox/sendgrid/inbound_emails(.:format) action_mailbox/ingresses/sendgrid/inbound_emails#create
# rails_mandrill_inbound_health_check GET /rails/action_mailbox/mandrill/inbound_emails(.:format) action_mailbox/ingresses/mandrill/inbound_emails#health_check
# rails_mandrill_inbound_emails POST /rails/action_mailbox/mandrill/inbound_emails(.:format) action_mailbox/ingresses/mandrill/inbound_emails#create
# rails_mailgun_inbound_emails POST /rails/action_mailbox/mailgun/inbound_emails/mime(.:format) action_mailbox/ingresses/mailgun/inbound_emails#create
# rails_conductor_inbound_emails GET /rails/conductor/action_mailbox/inbound_emails(.:format) rails/conductor/action_mailbox/inbound_emails#index
# POST /rails/conductor/action_mailbox/inbound_emails(.:format) rails/conductor/action_mailbox/inbound_emails#create
# new_rails_conductor_inbound_email GET /rails/conductor/action_mailbox/inbound_emails/new(.:format) rails/conductor/action_mailbox/inbound_emails#new
# rails_conductor_inbound_email GET /rails/conductor/action_mailbox/inbound_emails/:id(.:format) rails/conductor/action_mailbox/inbound_emails#show
# new_rails_conductor_inbound_email_source GET /rails/conductor/action_mailbox/inbound_emails/sources/new(.:format) rails/conductor/action_mailbox/inbound_emails/sources#new
# rails_conductor_inbound_email_sources POST /rails/conductor/action_mailbox/inbound_emails/sources(.:format) rails/conductor/action_mailbox/inbound_emails/sources#create
# rails_conductor_inbound_email_reroute POST /rails/conductor/action_mailbox/:inbound_email_id/reroute(.:format) rails/conductor/action_mailbox/reroutes#create
# rails_conductor_inbound_email_incinerate POST /rails/conductor/action_mailbox/:inbound_email_id/incinerate(.:format) rails/conductor/action_mailbox/incinerates#create
# rails_service_blob GET /rails/active_storage/blobs/redirect/:signed_id/*filename(.:format) active_storage/blobs/redirect#show
# rails_service_blob_proxy GET /rails/active_storage/blobs/proxy/:signed_id/*filename(.:format) active_storage/blobs/proxy#show
# GET /rails/active_storage/blobs/:signed_id/*filename(.:format) active_storage/blobs/redirect#show
# rails_blob_representation GET /rails/active_storage/representations/redirect/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations/redirect#show
# rails_blob_representation_proxy GET /rails/active_storage/representations/proxy/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations/proxy#show
# GET /rails/active_storage/representations/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations/redirect#show
# rails_disk_service GET /rails/active_storage/disk/:encoded_key/*filename(.:format) active_storage/disk#show
# update_rails_disk_service PUT /rails/active_storage/disk/:encoded_token(.:format) active_storage/disk#update
# rails_direct_uploads POST /rails/active_storage/direct_uploads(.:format) active_storage/direct_uploads#create
#
# Routes for GoodJob::Engine:
# root GET / good_job/jobs#redirect_to_index
# mass_update_jobs GET /jobs/mass_update(.:format) redirect(301, path: jobs)
# PUT /jobs/mass_update(.:format) good_job/jobs#mass_update
# discard_job PUT /jobs/:id/discard(.:format) good_job/jobs#discard
# force_discard_job PUT /jobs/:id/force_discard(.:format) good_job/jobs#force_discard
# reschedule_job PUT /jobs/:id/reschedule(.:format) good_job/jobs#reschedule
# retry_job PUT /jobs/:id/retry(.:format) good_job/jobs#retry
# jobs GET /jobs(.:format) good_job/jobs#index
# job GET /jobs/:id(.:format) good_job/jobs#show
# DELETE /jobs/:id(.:format) good_job/jobs#destroy
# metrics_primary_nav GET /jobs/metrics/primary_nav(.:format) good_job/metrics#primary_nav
# metrics_job_status GET /jobs/metrics/job_status(.:format) good_job/metrics#job_status
# retry_batch PUT /batches/:id/retry(.:format) good_job/batches#retry
# batches GET /batches(.:format) good_job/batches#index
# batch GET /batches/:id(.:format) good_job/batches#show
# enqueue_cron_entry POST /cron_entries/:cron_key/enqueue(.:format) good_job/cron_entries#enqueue
# enable_cron_entry PUT /cron_entries/:cron_key/enable(.:format) good_job/cron_entries#enable
# disable_cron_entry PUT /cron_entries/:cron_key/disable(.:format) good_job/cron_entries#disable
# cron_entries GET /cron_entries(.:format) good_job/cron_entries#index
# cron_entry GET /cron_entries/:cron_key(.:format) good_job/cron_entries#show
# processes GET /processes(.:format) good_job/processes#index
# performance_index GET /performance(.:format) good_job/performance#index
# performance GET /performance/:id(.:format) good_job/performance#show
# cleaner_index GET /cleaner(.:format) good_job/cleaner#index
# frontend_module GET /frontend/modules/:version/:id(.:format) good_job/frontends#module {:version=>"4-6-0", :format=>"js"}
# frontend_static GET /frontend/static/:version/:id(.:format) good_job/frontends#static {:version=>"4-6-0"}

Rails.application.routes.draw do
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

Expand Down
13 changes: 5 additions & 8 deletions gemset.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
Loading

0 comments on commit fcd86a9

Please sign in to comment.