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
e1951ed0
Commit
e1951ed0
authored
Mar 30, 2012
by
Prem Sichanugrist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused `:validations` option
Fixes #786
parent
6c5fe19f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
14 deletions
+0
-14
lib/paperclip/attachment_options.rb
+0
-1
test/attachment_options_test.rb
+0
-13
No files found.
lib/paperclip/attachment_options.rb
View file @
e1951ed0
module
Paperclip
module
Paperclip
class
AttachmentOptions
<
Hash
class
AttachmentOptions
<
Hash
def
initialize
(
options
)
def
initialize
(
options
)
options
=
{
:validations
=>
[]}.
merge
(
options
)
options
.
each
do
|
k
,
v
|
options
.
each
do
|
k
,
v
|
self
.
[
]
=
(
k
,
v
)
self
.
[
]
=
(
k
,
v
)
end
end
...
...
test/attachment_options_test.rb
View file @
e1951ed0
...
@@ -5,19 +5,6 @@ class AttachmentOptionsTest < Test::Unit::TestCase
...
@@ -5,19 +5,6 @@ class AttachmentOptionsTest < Test::Unit::TestCase
assert_kind_of
Hash
,
Paperclip
::
AttachmentOptions
.
new
({})
assert_kind_of
Hash
,
Paperclip
::
AttachmentOptions
.
new
({})
end
end
should
"add a default empty validations"
do
options
=
{
:arbi
=>
:trary
}
expected
=
{
:validations
=>
[]}.
merge
(
options
)
actual
=
Paperclip
::
AttachmentOptions
.
new
(
options
).
to_hash
assert_equal
expected
,
actual
end
should
"not override validations if passed to initializer"
do
options
=
{
:validations
=>
"something"
}
attachment_options
=
Paperclip
::
AttachmentOptions
.
new
(
options
)
assert_equal
"something"
,
attachment_options
[
:validations
]
end
should
"respond to []"
do
should
"respond to []"
do
assert
Paperclip
::
AttachmentOptions
.
new
({}).
respond_to?
(
:[]
)
assert
Paperclip
::
AttachmentOptions
.
new
({}).
respond_to?
(
:[]
)
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