Skip to content

Commit 2db3cfb

Browse files
committed
annotate models
1 parent 46f3261 commit 2db3cfb

13 files changed

Lines changed: 83 additions & 33 deletions

app/models/api_key.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,20 @@ def self.create_master_key
2020
end
2121

2222
end
23+
24+
# == Schema Information
25+
#
26+
# Table name: api_keys
27+
#
28+
# id :integer not null, primary key
29+
# key :string(64) not null
30+
# user_id :integer
31+
# created_by_id :integer
32+
# created_at :datetime not null
33+
# updated_at :datetime not null
34+
#
35+
# Indexes
36+
#
37+
# index_api_keys_on_key (key)
38+
# index_api_keys_on_user_id (user_id) UNIQUE
39+
#

app/models/category.rb

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -293,27 +293,31 @@ def self.resolve_permissions(permissions)
293293
#
294294
# Table name: categories
295295
#
296-
# id :integer not null, primary key
297-
# name :string(50) not null
298-
# color :string(6) default("AB9364"), not null
299-
# topic_id :integer
300-
# topic_count :integer default(0), not null
301-
# created_at :datetime not null
302-
# updated_at :datetime not null
303-
# user_id :integer not null
304-
# topics_year :integer
305-
# topics_month :integer
306-
# topics_week :integer
307-
# slug :string(255) not null
308-
# description :text
309-
# text_color :string(6) default("FFFFFF"), not null
310-
# hotness :float default(5.0), not null
311-
# read_restricted :boolean default(FALSE), not null
312-
# auto_close_days :float
296+
# id :integer not null, primary key
297+
# name :string(50) not null
298+
# color :string(6) default("AB9364"), not null
299+
# topic_id :integer
300+
# topic_count :integer default(0), not null
301+
# created_at :datetime not null
302+
# updated_at :datetime not null
303+
# user_id :integer not null
304+
# topics_year :integer
305+
# topics_month :integer
306+
# topics_week :integer
307+
# slug :string(255) not null
308+
# description :text
309+
# text_color :string(6) default("FFFFFF"), not null
310+
# hotness :float default(5.0), not null
311+
# read_restricted :boolean default(FALSE), not null
312+
# auto_close_days :float
313+
# post_count :integer default(0), not null
314+
# latest_post_id :integer
315+
# latest_topic_id :integer
316+
# position :integer not null
317+
# parent_category_id :integer
313318
#
314319
# Indexes
315320
#
316321
# index_categories_on_forum_thread_count (topic_count)
317322
# index_categories_on_name (name) UNIQUE
318323
#
319-

app/models/incoming_link.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def referer_valid
102102
# created_at :datetime not null
103103
# updated_at :datetime not null
104104
# user_id :integer
105-
# ip_address :string
105+
# ip_address :inet
106106
# current_user_id :integer
107107
#
108108
# Indexes
@@ -111,4 +111,3 @@ def referer_valid
111111
# index_incoming_links_on_created_at_and_domain (created_at,domain)
112112
# index_incoming_links_on_created_at_and_user_id (created_at,user_id)
113113
#
114-

app/models/post.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,11 @@ def create_reply_relationship_with(post)
455455
# notify_user_count :integer default(0), not null
456456
# like_score :integer default(0), not null
457457
# deleted_by_id :integer
458+
# edit_reason :string(255)
458459
#
459460
# Indexes
460461
#
461462
# idx_posts_user_id_deleted_at (user_id)
462463
# index_posts_on_reply_to_post_number (reply_to_post_number)
463464
# index_posts_on_topic_id_and_post_number (topic_id,post_number) UNIQUE
464465
#
465-

app/models/post_detail.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,20 @@ class PostDetail < ActiveRecord::Base
44
validates_presence_of :key, :value
55
validates_uniqueness_of :key, scope: :post_id
66
end
7+
8+
# == Schema Information
9+
#
10+
# Table name: post_details
11+
#
12+
# id :integer not null, primary key
13+
# post_id :integer
14+
# key :string(255)
15+
# value :string(255)
16+
# extra :text
17+
# created_at :datetime not null
18+
# updated_at :datetime not null
19+
#
20+
# Indexes
21+
#
22+
# index_post_details_on_post_id_and_key (post_id,key) UNIQUE
23+
#

app/models/screened_email.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ def self.should_block?(email)
3535
# last_match_at :datetime
3636
# created_at :datetime not null
3737
# updated_at :datetime not null
38-
# ip_address :string
38+
# ip_address :inet
3939
#
4040
# Indexes
4141
#
4242
# index_blocked_emails_on_email (email) UNIQUE
4343
# index_blocked_emails_on_last_match_at (last_match_at)
4444
#
45-

app/models/screened_ip_address.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,21 @@ def self.exists_for_ip_address_and_action?(ip_address, action_type)
5050
!!b and b.action_type == action_type
5151
end
5252
end
53+
54+
# == Schema Information
55+
#
56+
# Table name: screened_ip_addresses
57+
#
58+
# id :integer not null, primary key
59+
# ip_address :inet not null
60+
# action_type :integer not null
61+
# match_count :integer default(0), not null
62+
# last_match_at :datetime
63+
# created_at :datetime not null
64+
# updated_at :datetime not null
65+
#
66+
# Indexes
67+
#
68+
# index_screened_ip_addresses_on_ip_address (ip_address) UNIQUE
69+
# index_screened_ip_addresses_on_last_match_at (last_match_at)
70+
#

app/models/screened_url.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ def self.normalize_url(url)
4949
# last_match_at :datetime
5050
# created_at :datetime not null
5151
# updated_at :datetime not null
52-
# ip_address :string
52+
# ip_address :inet
5353
#
5454
# Indexes
5555
#
5656
# index_screened_urls_on_last_match_at (last_match_at)
5757
# index_screened_urls_on_url (url) UNIQUE
5858
#
59-

app/models/topic.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,7 @@ def apply_per_day_rate_limit_for(key, method_name)
729729
# auto_close_user_id :integer
730730
# auto_close_started_at :datetime
731731
# deleted_by_id :integer
732+
# participant_count :integer default(1)
732733
#
733734
# Indexes
734735
#
@@ -737,4 +738,3 @@ def apply_per_day_rate_limit_for(key, method_name)
737738
# index_topics_on_deleted_at_and_visible_and_archetype_and_id (deleted_at,visible,archetype,id)
738739
# index_topics_on_id_and_deleted_at (id,deleted_at)
739740
#
740-

app/models/topic_link_click.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ def self.create_from(args={})
5353
# user_id :integer
5454
# created_at :datetime not null
5555
# updated_at :datetime not null
56-
# ip_address :string not null
56+
# ip_address :inet not null
5757
#
5858
# Indexes
5959
#
6060
# index_forum_thread_link_clicks_on_forum_thread_link_id (topic_link_id)
6161
#
62-

0 commit comments

Comments
 (0)