Skip to content

Commit 3db5af6

Browse files
committed
Rubocop autocorrect unsafe offences
1 parent 351f201 commit 3db5af6

10 files changed

+6
-14
lines changed

Diff for: app/models/github_comment.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ class GithubComment < ActiveRecord::Base
66

77
## Validations
88
validates :github_id, presence: true
9-
validates :journal_id, presence: true, uniqueness: { scope: :github_id }
9+
validates :journal_id, uniqueness: { scope: :github_id }
1010
end

Diff for: app/models/github_issue.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ class GithubIssue < ActiveRecord::Base
66

77
## Validations
88
validates :github_id, presence: true
9-
validates :issue_id, presence: true, uniqueness: { scope: :github_id }
9+
validates :issue_id, uniqueness: { scope: :github_id }
1010
end

Diff for: app/models/gitolite_public_key.rb

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class GitolitePublicKey < ActiveRecord::Base
1616
has_many :repository_deployment_credentials, dependent: :destroy
1717

1818
## Validations
19-
validates :user_id, presence: true
2019

2120
validates :title, presence: true, uniqueness: { case_sensitive: false, scope: :user_id },
2221
length: { maximum: TITLE_LENGTH_LIMIT }, format: /\A[a-z0-9_\-]*\z/i

Diff for: app/models/repository_deployment_credential.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ class RepositoryDeploymentCredential < ActiveRecord::Base
1515
belongs_to :user
1616

1717
## Validations
18-
validates :repository_id, presence: true,
19-
uniqueness: { scope: :gitolite_public_key_id }
18+
validates :repository_id,
19+
uniqueness: { scope: :gitolite_public_key_id }
2020

21-
validates :gitolite_public_key_id, presence: true, exclusion: { in: [-1] }
22-
validates :user_id, presence: true
21+
validates :gitolite_public_key_id, exclusion: { in: [-1] }
2322
validates :perm, presence: true,
2423
inclusion: { in: VALID_PERMS }
2524

Diff for: app/models/repository_git_config_key.rb

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class RepositoryGitConfigKey < ActiveRecord::Base
1010
belongs_to :repository
1111

1212
## Validations
13-
validates :repository_id, presence: true
1413
validates :type, presence: true, inclusion: { in: ['RepositoryGitConfigKey::GitConfig', 'RepositoryGitConfigKey::Option'] }
1514
validates :value, presence: true
1615

Diff for: app/models/repository_git_extra.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class RepositoryGitExtra < ActiveRecord::Base
2525
belongs_to :repository
2626

2727
## Validations
28-
validates :repository_id, presence: true, uniqueness: true
28+
validates :repository_id, uniqueness: true
2929
validates :default_branch, presence: true
3030
validates :key, presence: true
3131
validates :notification_sender, format: { with: URI::MailTo::EMAIL_REGEXP, allow_blank: true }

Diff for: app/models/repository_mirror.rb

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class RepositoryMirror < ActiveRecord::Base
1515
belongs_to :repository
1616

1717
## Validations
18-
validates :repository_id, presence: true
1918

2019
## Only allow SSH format
2120
## ssh://[email protected]/project1/project2/project3/project4.git

Diff for: app/models/repository_post_receive_url.rb

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class RepositoryPostReceiveUrl < ActiveRecord::Base
1212
belongs_to :repository
1313

1414
## Validations
15-
validates :repository_id, presence: true
1615

1716
# Only allow HTTP(s) format
1817
validates :url, presence: true,

Diff for: app/models/repository_protected_branche.rb

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class RepositoryProtectedBranche < ActiveRecord::Base
1616
has_many :members, through: :protected_branches_members, source: :principal
1717

1818
## Validations
19-
validates :repository_id, presence: true
2019
validates :path, presence: true, uniqueness: { case_sensitive: true, scope: %i[permissions repository_id] }
2120
validates :permissions, presence: true, inclusion: { in: VALID_PERMS }
2221

Diff for: lib/hrack/server.rb

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ class Server
88

99
PLAIN_TYPE = { 'Content-Type' => 'text/plain' }.freeze
1010

11-
def initialize(config = {}); end
12-
1311
def call(env)
1412
dup._call env
1513
end

0 commit comments

Comments
 (0)