summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-07-02 13:57:38 +0000
committerLin Jen-Shin <godfat@godfat.org>2018-07-09 21:13:08 +0800
commit9286f5b9340f92131c320c231a5fb3e51c23bf04 (patch)
tree49bbb5c1ebc03a9fda46791273e949a8e467710f /app
parent4ee08b77bc5ae11553d59c182ea8292b77699115 (diff)
downloadgitlab-ce-9286f5b9340f92131c320c231a5fb3e51c23bf04.tar.gz
Use stable gitlab-styles and eliminate offenses
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/wikis_controller.rb2
-rw-r--r--app/models/wiki_page.rb5
-rw-r--r--app/services/notification_recipient_service.rb1
-rw-r--r--app/services/projects/lfs_pointers/lfs_download_service.rb2
4 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/projects/wikis_controller.rb b/app/controllers/projects/wikis_controller.rb
index 658b6ee5820..c01066c688a 100644
--- a/app/controllers/projects/wikis_controller.rb
+++ b/app/controllers/projects/wikis_controller.rb
@@ -129,7 +129,7 @@ class Projects::WikisController < Projects::ApplicationController
def build_page(args)
WikiPage.new(@project_wiki).tap do |page|
- page.update(args)
+ page.update_attributes(args) # rubocop:disable Rails/ActiveRecordAliases
end
end
end
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index 6cd3993a56d..4b49edb01a5 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -1,3 +1,4 @@
+# rubocop:disable Rails/ActiveRecordAliases
class WikiPage
PageChangedError = Class.new(StandardError)
PageRenameError = Class.new(StandardError)
@@ -190,7 +191,7 @@ class WikiPage
# Returns the String SHA1 of the newly created page
# or False if the save was unsuccessful.
def create(attrs = {})
- update(attrs)
+ update_attributes(attrs)
save(page_details: title) do
wiki.create_page(title, content, format, message)
@@ -216,7 +217,7 @@ class WikiPage
raise PageChangedError
end
- update(attrs)
+ update_attributes(attrs)
if title_changed?
page_details = title
diff --git a/app/services/notification_recipient_service.rb b/app/services/notification_recipient_service.rb
index d3447aa9951..628215b55fa 100644
--- a/app/services/notification_recipient_service.rb
+++ b/app/services/notification_recipient_service.rb
@@ -43,6 +43,7 @@ module NotificationRecipientService
def target
raise 'abstract'
end
+
def project
target.project
end
diff --git a/app/services/projects/lfs_pointers/lfs_download_service.rb b/app/services/projects/lfs_pointers/lfs_download_service.rb
index 6ea43561d61..618c30b971f 100644
--- a/app/services/projects/lfs_pointers/lfs_download_service.rb
+++ b/app/services/projects/lfs_pointers/lfs_download_service.rb
@@ -22,7 +22,7 @@ module Projects
private
def download_and_save_file(file, sanitized_uri)
- IO.copy_stream(open(sanitized_uri.sanitized_url, headers(sanitized_uri)), file)
+ IO.copy_stream(open(sanitized_uri.sanitized_url, headers(sanitized_uri)), file) # rubocop:disable Security/Open
end
def headers(sanitized_uri)