Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
50b68fc2
Commit
50b68fc2
authored
6 years ago
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use prepend to correctly use the monketpatch's method
parent
b358d263
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
24 deletions
+28
-24
config/initializers/carrierwave_monkey_patch.rb
config/initializers/carrierwave_monkey_patch.rb
+28
-24
No files found.
config/initializers/carrierwave_monkey_patch.rb
View file @
50b68fc2
...
...
@@ -5,6 +5,7 @@ module CarrierWave
module
Storage
class
Fog
<
Abstract
class
File
module
MonkeyPatch
def
read
file_body
=
file
.
body
...
...
@@ -24,18 +25,21 @@ module CarrierWave
new_file
.
copy_to
(
path
)
else
fog_file
=
new_file
.
to_file
@content_type
||=
new_file
.
content_type
@file
=
directory
.
files
.
create
({
@content_type
||=
new_file
.
content_type
# rubocop:disable Gitlab/ModuleWithInstanceVariables
@file
=
directory
.
files
.
create
({
# rubocop:disable Gitlab/ModuleWithInstanceVariables
:body
=>
fog_file
?
fog_file
:
new_file
.
read
,
# rubocop:disable Gitlab/HashSyntax
:content_type
=>
@content_type
,
# rubocop:disable Gitlab/HashSyntax
:content_type
=>
@content_type
,
# rubocop:disable Gitlab/HashSyntax,Gitlab/ModuleWithInstanceVariables
:key
=>
path
,
# rubocop:disable Gitlab/HashSyntax
:public
=>
@uploader
.
fog_public
# rubocop:disable Gitlab/HashSyntax
}.
merge
(
@uploader
.
fog_attributes
))
:public
=>
@uploader
.
fog_public
# rubocop:disable Gitlab/HashSyntax,Gitlab/ModuleWithInstanceVariables
}.
merge
(
@uploader
.
fog_attributes
))
# rubocop:disable Gitlab/ModuleWithInstanceVariables
fog_file
.
close
if
fog_file
&&
!
fog_file
.
closed?
end
true
end
end
prepend
MonkeyPatch
end
end
end
end
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment