Skip to content

Commit 7e0c821

Browse files
committed
Annotate models
Run bin/annotate models
1 parent 8f6eb16 commit 7e0c821

33 files changed

+508
-0
lines changed

app/models/admin_user.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# == Schema Information
2+
#
3+
# Table name: admin_users
4+
#
5+
# id :integer not null, primary key
6+
# email :string
7+
# password_digest :string not null
8+
# created_at :datetime not null
9+
# updated_at :datetime not null
10+
#
11+
# Indexes
12+
#
13+
# index_admin_users_on_email (email) UNIQUE
14+
#
115
class AdminUser < ApplicationRecord
216
has_secure_password
317

app/models/color_scheme.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# frozen_string_literal: true
22

3+
# == Schema Information
4+
#
5+
# Table name: color_schemes
6+
#
7+
# id :string not null, primary key
8+
# name :string not null
9+
# weight_100 :string not null
10+
# weight_200 :string not null
11+
# weight_300 :string not null
12+
# weight_400 :string not null
13+
# weight_50 :string not null
14+
# weight_500 :string not null
15+
# weight_600 :string not null
16+
# weight_700 :string not null
17+
# weight_800 :string not null
18+
# weight_900 :string not null
19+
# weight_950 :string not null
20+
# created_at :datetime not null
21+
# updated_at :datetime not null
22+
#
23+
# Indexes
24+
#
25+
# index_color_schemes_on_name (name) UNIQUE
26+
#
327
require "color_conversion"
428

529
class ColorScheme < ApplicationRecord

app/models/email_exchange.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
# == Schema Information
2+
#
3+
# Table name: email_exchanges
4+
#
5+
# id :integer not null, primary key
6+
# email :string not null
7+
# status :string default("pending"), not null
8+
# created_at :datetime not null
9+
# updated_at :datetime not null
10+
# user_id :string not null
11+
#
12+
# Indexes
13+
#
14+
# index_email_exchanges_on_user_id (user_id)
15+
# index_email_exchanges_on_user_id_and_email (user_id,email) UNIQUE WHERE status = 0
16+
#
17+
# Foreign Keys
18+
#
19+
# user_id (user_id => users.id)
20+
#
121
class EmailExchange < ApplicationRecord
222
belongs_to :user
323

app/models/examples/post.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# == Schema Information
2+
#
3+
# Table name: examples_posts
4+
#
5+
# id :integer not null, primary key
6+
# postable_type :string not null
7+
# title :string not null
8+
# created_at :datetime not null
9+
# updated_at :datetime not null
10+
# postable_id :integer not null
11+
#
12+
# Indexes
13+
#
14+
# index_examples_posts_on_postable (postable_type,postable_id)
15+
#
116
class Examples::Post < ApplicationRecord
217
POSTABLE_TYPES = %w[
318
Examples::Posts::Markdown

app/models/examples/posts/image.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1+
# == Schema Information
2+
#
3+
# Table name: examples_posts_images
4+
#
5+
# id :integer not null, primary key
6+
# url :string not null
7+
# created_at :datetime not null
8+
# updated_at :datetime not null
9+
#
110
class Examples::Posts::Image < ApplicationRecord
211
end

app/models/examples/posts/link.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1+
# == Schema Information
2+
#
3+
# Table name: examples_posts_links
4+
#
5+
# id :integer not null, primary key
6+
# url :string not null
7+
# created_at :datetime not null
8+
# updated_at :datetime not null
9+
#
110
class Examples::Posts::Link < ApplicationRecord
211
end

app/models/examples/posts/markdown.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1+
# == Schema Information
2+
#
3+
# Table name: examples_posts_markdowns
4+
#
5+
# id :integer not null, primary key
6+
# body :text not null
7+
# created_at :datetime not null
8+
# updated_at :datetime not null
9+
#
110
class Examples::Posts::Markdown < ApplicationRecord
211
end

app/models/newsletter.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# == Schema Information
2+
#
3+
# Table name: newsletters
4+
#
5+
# id :string not null, primary key
6+
# content :text not null
7+
# sent_at :datetime
8+
# title :string not null
9+
# created_at :datetime not null
10+
# updated_at :datetime not null
11+
#
12+
# Indexes
13+
#
14+
# index_newsletters_on_sent_at (sent_at)
15+
#
116
class Newsletter < ApplicationRecord
217
validates :title, presence: true
318
validates :content, presence: true

app/models/newsletter_subscription.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# == Schema Information
2+
#
3+
# Table name: newsletter_subscriptions
4+
#
5+
# id :string not null, primary key
6+
# subscriber_type :string not null
7+
# created_at :datetime not null
8+
# updated_at :datetime not null
9+
# subscriber_id :string not null
10+
#
11+
# Indexes
12+
#
13+
# index_newsletter_subscriptions_on_subscriber (subscriber_type,subscriber_id) UNIQUE
14+
#
115
class NewsletterSubscription < ApplicationRecord
216
belongs_to :subscriber, polymorphic: true, inverse_of: :newsletter_subscription
317

app/models/notification.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# == Schema Information
2+
#
3+
# Table name: notifications
4+
#
5+
# id :integer not null, primary key
6+
# processed_at :datetime
7+
# read_at :datetime
8+
# recipient_type :string not null
9+
# seen_at :datetime
10+
# type :string
11+
# created_at :datetime not null
12+
# updated_at :datetime not null
13+
# notification_event_id :integer not null
14+
# recipient_id :string not null
15+
#
16+
# Indexes
17+
#
18+
# index_notifications_on_notification_event_id (notification_event_id)
19+
# index_notifications_on_recipient (recipient_type,recipient_id)
20+
#
21+
# Foreign Keys
22+
#
23+
# notification_event_id (notification_event_id => notification_events.id)
24+
#
125
class Notification < ApplicationRecord
226
belongs_to :notification_event, counter_cache: true
327
belongs_to :recipient, polymorphic: true

0 commit comments

Comments
 (0)