Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
7c78aa32
Commit
7c78aa32
authored
Aug 08, 2011
by
David Faber
Committed by
Alex Godin
Aug 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug that prevents you from assigning "false" to the :fog_public attachment option
parent
9f389280
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
+14
-1
lib/paperclip/storage/fog.rb
+1
-1
test/fog_test.rb
+13
-0
No files found.
lib/paperclip/storage/fog.rb
View file @
7c78aa32
...
@@ -44,7 +44,7 @@ module Paperclip
...
@@ -44,7 +44,7 @@ module Paperclip
@fog_directory
=
@options
[
:fog_directory
]
@fog_directory
=
@options
[
:fog_directory
]
@fog_credentials
=
@options
[
:fog_credentials
]
@fog_credentials
=
@options
[
:fog_credentials
]
@fog_host
=
@options
[
:fog_host
]
@fog_host
=
@options
[
:fog_host
]
@fog_public
=
@options
[
:fog_public
]
||
true
@fog_public
=
@options
.
key?
(
:fog_public
)
?
@options
[:
fog_public
]
:
true
@fog_file
=
@options
[
:fog_file
]
||
{}
@fog_file
=
@options
[
:fog_file
]
||
{}
@url
=
':fog_public_url'
@url
=
':fog_public_url'
...
...
test/fog_test.rb
View file @
7c78aa32
...
@@ -111,6 +111,19 @@ class FogTest < Test::Unit::TestCase
...
@@ -111,6 +111,19 @@ class FogTest < Test::Unit::TestCase
assert
@dummy
.
avatar
.
url
=~
/^http:\/\/img[0123]\.example\.com\/avatars\/stringio\.txt\?\d*$/
assert
@dummy
.
avatar
.
url
=~
/^http:\/\/img[0123]\.example\.com\/avatars\/stringio\.txt\?\d*$/
end
end
end
end
context
"with fog_public set to false"
do
setup
do
rebuild_model
(
@options
.
merge
(
:fog_public
=>
false
))
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
StringIO
.
new
(
'.'
)
@dummy
.
save
end
should
'set the @fog_public instance variable to false'
do
assert_equal
false
,
@dummy
.
avatar
.
instance_variable_get
(
'@fog_public'
)
end
end
end
end
...
...
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