Skip to content
This repository was archived by the owner on Feb 21, 2023. It is now read-only.

Commit 9ab01d3

Browse files
committed
Fix annotating models
There is issue with has one attached file. Solution is to don't show indexes. More info: ctran/annotate_models#538
1 parent b9645b5 commit 9ab01d3

11 files changed

+35
-28
lines changed

app/models/conference.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# frozen_string_literal: true
2-
32
# == Schema Information
43
#
54
# Table name: conferences
@@ -23,11 +22,6 @@
2322
# analytics_code :text
2423
# code_of_conduct_url :string
2524
#
26-
# Indexes
27-
#
28-
# index_conferences_on_domain (domain)
29-
# index_conferences_on_main (main)
30-
#
3125

3226
class Conference < ActiveRecord::Base
3327
THEMES = %w(it_tour not_a_conf).freeze

app/models/event.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# frozen_string_literal: true
2-
32
# == Schema Information
43
#
54
# Table name: events
@@ -29,8 +28,6 @@
2928
# after_party_announced :boolean default(FALSE)
3029
# sessions_announced :boolean default(FALSE)
3130
# speakers_announced :boolean default(FALSE)
32-
# logo :string(255)
33-
# coverart :string(255)
3431
# current :boolean default(FALSE), not null
3532
# show_feedback_form :boolean default(FALSE), not null
3633
# show_photo_gallery :boolean default(FALSE), not null
@@ -41,6 +38,12 @@
4138
# call_to_papers_url :string(255)
4239
# venue_map_embedded_url :text
4340
# after_party_venue_map_embedded_url :text
41+
# tickets_url :string
42+
# sponsors_announced :boolean default(FALSE), not null
43+
#
44+
# Foreign Keys
45+
#
46+
# events_conference_id_fk (conference_id => conferences.id)
4447
#
4548

4649
class Event < ActiveRecord::Base

app/models/feedback.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# frozen_string_literal: true
2-
32
# == Schema Information
43
#
54
# Table name: feedbacks
@@ -10,6 +9,10 @@
109
# created_at :datetime
1110
# updated_at :datetime
1211
#
12+
# Foreign Keys
13+
#
14+
# feedbacks_event_id_fk (event_id => events.id)
15+
#
1316

1417
class Feedback < ActiveRecord::Base
1518
belongs_to :event, inverse_of: :feedbacks

app/models/photo.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# frozen_string_literal: true
2-
32
# == Schema Information
43
#
54
# Table name: photos
65
#
76
# id :integer not null, primary key
87
# event_id :integer not null
98
# position :integer not null
10-
# asset :string(255) not null
119
# created_at :datetime
1210
# updated_at :datetime
1311
#
12+
# Foreign Keys
13+
#
14+
# photos_event_id_fk (event_id => events.id)
15+
#
1416

1517
class Photo < ActiveRecord::Base
1618
belongs_to :event, inverse_of: :photos

app/models/session.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# frozen_string_literal: true
2-
32
# == Schema Information
43
#
54
# Table name: sessions
@@ -13,9 +12,13 @@
1312
# created_at :datetime
1413
# updated_at :datetime
1514
# track :integer default(1), not null
16-
# end_at :string(255)
15+
# end_at :string
1716
# description :text
1817
#
18+
# Foreign Keys
19+
#
20+
# sessions_event_id_fk (event_id => events.id)
21+
#
1922

2023
class Session < ActiveRecord::Base
2124
belongs_to :event

app/models/session_speaker.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# frozen_string_literal: true
2-
32
# == Schema Information
43
#
54
# Table name: session_speakers
@@ -10,10 +9,6 @@
109
# created_at :datetime
1110
# updated_at :datetime
1211
#
13-
# Indexes
14-
#
15-
# index_session_speakers_on_speaker_id_and_session_id (speaker_id,session_id) UNIQUE
16-
#
1712
# Foreign Keys
1813
#
1914
# session_speakers_session_id_fk (session_id => sessions.id)

app/models/speaker.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# frozen_string_literal: true
2-
32
# == Schema Information
43
#
54
# Table name: speakers
@@ -13,7 +12,6 @@
1312
# created_at :datetime
1413
# updated_at :datetime
1514
# twitter_account :string(255)
16-
# photo :string(255)
1715
# tshirt_size :string(255)
1816
# github_account :string(255)
1917
# facebook_account :string(255)

app/models/sponsor.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
# frozen_string_literal: true
2+
# == Schema Information
3+
#
4+
# Table name: sponsors
5+
#
6+
# id :integer not null, primary key
7+
# name :string not null
8+
# website_url :string not null
9+
# created_at :datetime not null
10+
# updated_at :datetime not null
11+
#
12+
213

314
class Sponsor < ActiveRecord::Base
415
validates :name, presence: true

app/models/subscriber.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# frozen_string_literal: true
2-
32
# == Schema Information
43
#
54
# Table name: subscribers
@@ -11,6 +10,10 @@
1110
# created_at :datetime
1211
# updated_at :datetime
1312
#
13+
# Foreign Keys
14+
#
15+
# subscribers_conference_id_fk (conference_id => conferences.id)
16+
#
1417

1518
class Subscriber < ActiveRecord::Base
1619
belongs_to :conference, inverse_of: :subscribers

app/models/user.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# frozen_string_literal: true
2-
32
# == Schema Information
43
#
54
# Table name: users
@@ -12,10 +11,6 @@
1211
# created_at :datetime
1312
# updated_at :datetime
1413
#
15-
# Indexes
16-
#
17-
# index_users_on_email (email) UNIQUE
18-
#
1914

2015
class User < ActiveRecord::Base
2116
has_secure_password

lib/tasks/auto_annotate_models.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if Rails.env.development?
1818
'position_in_serializer' => 'before',
1919
'show_foreign_keys' => 'true',
2020
'show_complete_foreign_keys' => 'false',
21-
'show_indexes' => 'true',
21+
'show_indexes' => 'false',
2222
'simple_indexes' => 'false',
2323
'model_dir' => 'app/models',
2424
'root_dir' => '',

0 commit comments

Comments
 (0)