Skip to content

Commit

Permalink
Run annotaterb models && annotaterb routes
Browse files Browse the repository at this point in the history
  • Loading branch information
robbevp committed Dec 14, 2024
1 parent 57cc55e commit a53deb5
Show file tree
Hide file tree
Showing 22 changed files with 456 additions and 0 deletions.
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
19 changes: 19 additions & 0 deletions test/factories/categories.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)
#
FactoryBot.define do
factory :category do
name { Faker::Lorem.unique.word }
Expand Down
27 changes: 27 additions & 0 deletions test/factories/entries.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)
#
FactoryBot.define do
factory :entry do
subscription
Expand Down
13 changes: 13 additions & 0 deletions test/factories/newsletters.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
#
FactoryBot.define do
factory :newsletter do
subscription { build(:subscription, subscribable: nil) }
Expand Down
13 changes: 13 additions & 0 deletions test/factories/proxied_images.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
#
FactoryBot.define do
factory :proxied_image do
url { Faker::Internet.unique.domain_name }
Expand Down
12 changes: 12 additions & 0 deletions test/factories/rss_feeds.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
#
FactoryBot.define do
factory :rss_feed do
url { Faker::Internet.url }
Expand Down
Loading

0 comments on commit a53deb5

Please sign in to comment.