From d7812a95cf518dfa1565a0514b87fb40f86949e5 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sun, 6 Sep 2015 07:48:48 -0700 Subject: [PATCH] Re-annotate models --- app/models/abuse_report.rb | 12 ++ app/models/issue.rb | 27 ++--- app/models/merge_request.rb | 1 + app/models/note.rb | 1 + .../project_services/drone_ci_service.rb | 20 ++++ app/models/sent_notification.rb | 13 +++ app/models/user.rb | 108 +++++++++--------- spec/factories/abuse_reports.rb | 12 ++ spec/factories/merge_requests.rb | 1 + spec/factories/notes.rb | 1 + spec/models/abuse_report_spec.rb | 12 ++ spec/models/application_setting_spec.rb | 1 + spec/models/issue_spec.rb | 27 ++--- spec/models/merge_request_spec.rb | 1 + spec/models/note_spec.rb | 1 + spec/models/user_spec.rb | 108 +++++++++--------- 16 files changed, 208 insertions(+), 138 deletions(-) diff --git a/app/models/abuse_report.rb b/app/models/abuse_report.rb index c8c39db11bc..07c87a7fe87 100644 --- a/app/models/abuse_report.rb +++ b/app/models/abuse_report.rb @@ -1,3 +1,15 @@ +# == Schema Information +# +# Table name: abuse_reports +# +# id :integer not null, primary key +# reporter_id :integer +# user_id :integer +# message :text +# created_at :datetime +# updated_at :datetime +# + class AbuseReport < ActiveRecord::Base belongs_to :reporter, class_name: "User" belongs_to :user diff --git a/app/models/issue.rb b/app/models/issue.rb index 2456b7d0dc1..fc7e9abe29e 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -2,19 +2,20 @@ # # Table name: issues # -# id :integer not null, primary key -# title :string(255) -# assignee_id :integer -# author_id :integer -# project_id :integer -# created_at :datetime -# updated_at :datetime -# position :integer default(0) -# branch_name :string(255) -# description :text -# milestone_id :integer -# state :string(255) -# iid :integer +# id :integer not null, primary key +# title :string(255) +# assignee_id :integer +# author_id :integer +# project_id :integer +# created_at :datetime +# updated_at :datetime +# position :integer default(0) +# branch_name :string(255) +# description :text +# milestone_id :integer +# state :string(255) +# iid :integer +# updated_by_id :integer # require 'carrierwave/orm/activerecord' diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 467b90861f9..93faa133875 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -19,6 +19,7 @@ # description :text # position :integer default(0) # locked_at :datetime +# updated_by_id :integer # require Rails.root.join("app/models/commit") diff --git a/app/models/note.rb b/app/models/note.rb index 36cad8f583d..89d81ab1de2 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -15,6 +15,7 @@ # noteable_id :integer # system :boolean default(FALSE), not null # st_diff :text +# updated_by_id :integer # require 'carrierwave/orm/activerecord' diff --git a/app/models/project_services/drone_ci_service.rb b/app/models/project_services/drone_ci_service.rb index 39f732c8113..3e2b7faecdb 100644 --- a/app/models/project_services/drone_ci_service.rb +++ b/app/models/project_services/drone_ci_service.rb @@ -1,3 +1,23 @@ +# == Schema Information +# +# Table name: services +# +# id :integer not null, primary key +# type :string(255) +# title :string(255) +# project_id :integer +# created_at :datetime +# updated_at :datetime +# active :boolean default(FALSE), not null +# properties :text +# template :boolean default(FALSE) +# push_events :boolean default(TRUE) +# issues_events :boolean default(TRUE) +# merge_requests_events :boolean default(TRUE) +# tag_push_events :boolean default(TRUE) +# note_events :boolean default(TRUE), not null +# + class DroneCiService < CiService prop_accessor :drone_url, :token, :enable_ssl_verification diff --git a/app/models/sent_notification.rb b/app/models/sent_notification.rb index 460ca40be3f..33b113a2a27 100644 --- a/app/models/sent_notification.rb +++ b/app/models/sent_notification.rb @@ -1,3 +1,16 @@ +# == Schema Information +# +# Table name: sent_notifications +# +# id :integer not null, primary key +# project_id :integer +# noteable_id :integer +# noteable_type :string(255) +# recipient_id :integer +# commit_id :string(255) +# reply_key :string(255) not null +# + class SentNotification < ActiveRecord::Base belongs_to :project belongs_to :noteable, polymorphic: true diff --git a/app/models/user.rb b/app/models/user.rb index 48e0e6ed48b..bff8eeed96d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,62 +2,58 @@ # # Table name: users # -# id :integer not null, primary key -# email :string(255) default(""), not null -# encrypted_password :string(255) default(""), not null -# reset_password_token :string(255) -# reset_password_sent_at :datetime -# remember_created_at :datetime -# sign_in_count :integer default(0) -# current_sign_in_at :datetime -# last_sign_in_at :datetime -# current_sign_in_ip :string(255) -# last_sign_in_ip :string(255) -# created_at :datetime -# updated_at :datetime -# name :string(255) -# admin :boolean default(FALSE), not null -# projects_limit :integer default(10) -# skype :string(255) default(""), not null -# linkedin :string(255) default(""), not null -# twitter :string(255) default(""), not null -# authentication_token :string(255) -# theme_id :integer default(1), not null -# bio :string(255) -# failed_attempts :integer default(0) -# locked_at :datetime -# username :string(255) -# can_create_group :boolean default(TRUE), not null -# can_create_team :boolean default(TRUE), not null -# state :string(255) -# color_scheme_id :integer default(1), not null -# notification_level :integer default(1), not null -# password_expires_at :datetime -# created_by_id :integer -# last_credential_check_at :datetime -# avatar :string(255) -# confirmation_token :string(255) -# confirmed_at :datetime -# confirmation_sent_at :datetime -# unconfirmed_email :string(255) -# hide_no_ssh_key :boolean default(FALSE) -# website_url :string(255) default(""), not null -# github_access_token :string(255) -# gitlab_access_token :string(255) -# notification_email :string(255) -# hide_no_password :boolean default(FALSE) -# password_automatically_set :boolean default(FALSE) -# bitbucket_access_token :string(255) -# bitbucket_access_token_secret :string(255) -# location :string(255) -# encrypted_otp_secret :string(255) -# encrypted_otp_secret_iv :string(255) -# encrypted_otp_secret_salt :string(255) -# otp_required_for_login :boolean default(FALSE), not null -# otp_backup_codes :text -# public_email :string(255) default(""), not null -# dashboard :integer default(0) -# project_view :integer default(0) +# id :integer not null, primary key +# email :string(255) default(""), not null +# encrypted_password :string(255) default(""), not null +# reset_password_token :string(255) +# reset_password_sent_at :datetime +# remember_created_at :datetime +# sign_in_count :integer default(0) +# current_sign_in_at :datetime +# last_sign_in_at :datetime +# current_sign_in_ip :string(255) +# last_sign_in_ip :string(255) +# created_at :datetime +# updated_at :datetime +# name :string(255) +# admin :boolean default(FALSE), not null +# projects_limit :integer default(10) +# skype :string(255) default(""), not null +# linkedin :string(255) default(""), not null +# twitter :string(255) default(""), not null +# authentication_token :string(255) +# theme_id :integer default(1), not null +# bio :string(255) +# failed_attempts :integer default(0) +# locked_at :datetime +# username :string(255) +# can_create_group :boolean default(TRUE), not null +# can_create_team :boolean default(TRUE), not null +# state :string(255) +# color_scheme_id :integer default(1), not null +# notification_level :integer default(1), not null +# password_expires_at :datetime +# created_by_id :integer +# last_credential_check_at :datetime +# avatar :string(255) +# confirmation_token :string(255) +# confirmed_at :datetime +# confirmation_sent_at :datetime +# unconfirmed_email :string(255) +# hide_no_ssh_key :boolean default(FALSE) +# website_url :string(255) default(""), not null +# notification_email :string(255) +# hide_no_password :boolean default(FALSE) +# password_automatically_set :boolean default(FALSE) +# location :string(255) +# encrypted_otp_secret :string(255) +# encrypted_otp_secret_iv :string(255) +# encrypted_otp_secret_salt :string(255) +# otp_required_for_login :boolean default(FALSE), not null +# otp_backup_codes :text +# public_email :string(255) default(""), not null +# dashboard :integer default(0) +# project_view :integer default(0) # require 'carrierwave/orm/activerecord' diff --git a/spec/factories/abuse_reports.rb b/spec/factories/abuse_reports.rb index 29fcbc5e197..8d287ded292 100644 --- a/spec/factories/abuse_reports.rb +++ b/spec/factories/abuse_reports.rb @@ -1,3 +1,15 @@ +# == Schema Information +# +# Table name: abuse_reports +# +# id :integer not null, primary key +# reporter_id :integer +# user_id :integer +# message :text +# created_at :datetime +# updated_at :datetime +# + # Read about factories at https://github.com/thoughtbot/factory_girl FactoryGirl.define do diff --git a/spec/factories/merge_requests.rb b/spec/factories/merge_requests.rb index 3b7adfe4398..6080d0ccdef 100644 --- a/spec/factories/merge_requests.rb +++ b/spec/factories/merge_requests.rb @@ -19,6 +19,7 @@ # description :text # position :integer default(0) # locked_at :datetime +# updated_by_id :integer # FactoryGirl.define do diff --git a/spec/factories/notes.rb b/spec/factories/notes.rb index e1009d5916e..9d777ddfccd 100644 --- a/spec/factories/notes.rb +++ b/spec/factories/notes.rb @@ -15,6 +15,7 @@ # noteable_id :integer # system :boolean default(FALSE), not null # st_diff :text +# updated_by_id :integer # require_relative '../support/repo_helpers' diff --git a/spec/models/abuse_report_spec.rb b/spec/models/abuse_report_spec.rb index d83004a8388..635a6e2518c 100644 --- a/spec/models/abuse_report_spec.rb +++ b/spec/models/abuse_report_spec.rb @@ -1,3 +1,15 @@ +# == Schema Information +# +# Table name: abuse_reports +# +# id :integer not null, primary key +# reporter_id :integer +# user_id :integer +# message :text +# created_at :datetime +# updated_at :datetime +# + require 'rails_helper' RSpec.describe AbuseReport, type: :model do diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index bc14ff98fd8..de0b2ef4cda 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -22,6 +22,7 @@ # user_oauth_applications :boolean default(TRUE) # after_sign_out_path :string(255) # session_expire_delay :integer default(10080), not null +# import_sources :text # require 'spec_helper' diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index 9bac451c28c..cf336d82957 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -2,19 +2,20 @@ # # Table name: issues # -# id :integer not null, primary key -# title :string(255) -# assignee_id :integer -# author_id :integer -# project_id :integer -# created_at :datetime -# updated_at :datetime -# position :integer default(0) -# branch_name :string(255) -# description :text -# milestone_id :integer -# state :string(255) -# iid :integer +# id :integer not null, primary key +# title :string(255) +# assignee_id :integer +# author_id :integer +# project_id :integer +# created_at :datetime +# updated_at :datetime +# position :integer default(0) +# branch_name :string(255) +# description :text +# milestone_id :integer +# state :string(255) +# iid :integer +# updated_by_id :integer # require 'spec_helper' diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index b91687bc09f..17a49013d25 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -19,6 +19,7 @@ # description :text # position :integer default(0) # locked_at :datetime +# updated_by_id :integer # require 'spec_helper' diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index 331505a01b3..3a0b194ba1e 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -15,6 +15,7 @@ # noteable_id :integer # system :boolean default(FALSE), not null # st_diff :text +# updated_by_id :integer # require 'spec_helper' diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index a46e789eab4..eeb9069aa17 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -2,62 +2,58 @@ # # Table name: users # -# id :integer not null, primary key -# email :string(255) default(""), not null -# encrypted_password :string(255) default(""), not null -# reset_password_token :string(255) -# reset_password_sent_at :datetime -# remember_created_at :datetime -# sign_in_count :integer default(0) -# current_sign_in_at :datetime -# last_sign_in_at :datetime -# current_sign_in_ip :string(255) -# last_sign_in_ip :string(255) -# created_at :datetime -# updated_at :datetime -# name :string(255) -# admin :boolean default(FALSE), not null -# projects_limit :integer default(10) -# skype :string(255) default(""), not null -# linkedin :string(255) default(""), not null -# twitter :string(255) default(""), not null -# authentication_token :string(255) -# theme_id :integer default(1), not null -# bio :string(255) -# failed_attempts :integer default(0) -# locked_at :datetime -# username :string(255) -# can_create_group :boolean default(TRUE), not null -# can_create_team :boolean default(TRUE), not null -# state :string(255) -# color_scheme_id :integer default(1), not null -# notification_level :integer default(1), not null -# password_expires_at :datetime -# created_by_id :integer -# last_credential_check_at :datetime -# avatar :string(255) -# confirmation_token :string(255) -# confirmed_at :datetime -# confirmation_sent_at :datetime -# unconfirmed_email :string(255) -# hide_no_ssh_key :boolean default(FALSE) -# website_url :string(255) default(""), not null -# github_access_token :string(255) -# gitlab_access_token :string(255) -# notification_email :string(255) -# hide_no_password :boolean default(FALSE) -# password_automatically_set :boolean default(FALSE) -# bitbucket_access_token :string(255) -# bitbucket_access_token_secret :string(255) -# location :string(255) -# encrypted_otp_secret :string(255) -# encrypted_otp_secret_iv :string(255) -# encrypted_otp_secret_salt :string(255) -# otp_required_for_login :boolean default(FALSE), not null -# otp_backup_codes :text -# public_email :string(255) default(""), not null -# dashboard :integer default(0) -# project_view :integer default(0) +# id :integer not null, primary key +# email :string(255) default(""), not null +# encrypted_password :string(255) default(""), not null +# reset_password_token :string(255) +# reset_password_sent_at :datetime +# remember_created_at :datetime +# sign_in_count :integer default(0) +# current_sign_in_at :datetime +# last_sign_in_at :datetime +# current_sign_in_ip :string(255) +# last_sign_in_ip :string(255) +# created_at :datetime +# updated_at :datetime +# name :string(255) +# admin :boolean default(FALSE), not null +# projects_limit :integer default(10) +# skype :string(255) default(""), not null +# linkedin :string(255) default(""), not null +# twitter :string(255) default(""), not null +# authentication_token :string(255) +# theme_id :integer default(1), not null +# bio :string(255) +# failed_attempts :integer default(0) +# locked_at :datetime +# username :string(255) +# can_create_group :boolean default(TRUE), not null +# can_create_team :boolean default(TRUE), not null +# state :string(255) +# color_scheme_id :integer default(1), not null +# notification_level :integer default(1), not null +# password_expires_at :datetime +# created_by_id :integer +# last_credential_check_at :datetime +# avatar :string(255) +# confirmation_token :string(255) +# confirmed_at :datetime +# confirmation_sent_at :datetime +# unconfirmed_email :string(255) +# hide_no_ssh_key :boolean default(FALSE) +# website_url :string(255) default(""), not null +# notification_email :string(255) +# hide_no_password :boolean default(FALSE) +# password_automatically_set :boolean default(FALSE) +# location :string(255) +# encrypted_otp_secret :string(255) +# encrypted_otp_secret_iv :string(255) +# encrypted_otp_secret_salt :string(255) +# otp_required_for_login :boolean default(FALSE), not null +# otp_backup_codes :text +# public_email :string(255) default(""), not null +# dashboard :integer default(0) +# project_view :integer default(0) # require 'spec_helper'