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
c8a271eb
Commit
c8a271eb
authored
Jul 21, 2011
by
Jeremy Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed capitalize -> camelcase for storage module names.
parent
cfe406bf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
+14
-1
lib/paperclip/attachment.rb
+1
-1
test/attachment_test.rb
+13
-0
No files found.
lib/paperclip/attachment.rb
View file @
c8a271eb
...
...
@@ -323,7 +323,7 @@ module Paperclip
end
def
initialize_storage
#:nodoc:
storage_class_name
=
@storage
.
to_s
.
camelize
storage_class_name
=
@storage
.
to_s
.
downcase
.
camelize
begin
@storage_module
=
Paperclip
::
Storage
.
const_get
(
storage_class_name
)
rescue
NameError
...
...
test/attachment_test.rb
View file @
c8a271eb
...
...
@@ -496,6 +496,19 @@ class AttachmentTest < Test::Unit::TestCase
rebuild_model
:storage
=>
:FileSystem
@dummy
=
Dummy
.
new
assert
@dummy
.
avatar
.
is_a?
(
Paperclip
::
Storage
::
Filesystem
)
rebuild_model
:storage
=>
:Filesystem
@dummy
=
Dummy
.
new
assert
@dummy
.
avatar
.
is_a?
(
Paperclip
::
Storage
::
Filesystem
)
end
should
"convert underscored storage name to camelcase"
do
rebuild_model
:storage
=>
:not_here
@dummy
=
Dummy
.
new
exception
=
assert_raises
(
Paperclip
::
StorageMethodNotFound
)
do
|
e
|
@dummy
.
avatar
end
assert
exception
.
message
.
include?
(
"NotHere"
)
end
should
"raise an error if you try to include a storage module that doesn't exist"
do
...
...
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