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
2bfd92b6
Commit
2bfd92b6
authored
May 15, 2015
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix errors caused by HasAttachedFile fix earlier
parent
52543bde
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
lib/paperclip/has_attached_file.rb
+3
-2
spec/paperclip/attachment_definitions_spec.rb
+1
-1
No files found.
lib/paperclip/has_attached_file.rb
View file @
2bfd92b6
...
...
@@ -7,7 +7,7 @@ module Paperclip
def
initialize
(
klass
,
name
,
options
)
@klass
=
klass
@name
=
name
@options
=
Paperclip
::
Attachment
.
default_options
.
deep_merge
(
options
)
@options
=
options
end
def
define
...
...
@@ -79,7 +79,8 @@ module Paperclip
end
def
add_required_validations
if
@options
[
:validate_media_type
]
!=
false
options
=
Paperclip
::
Attachment
.
default_options
.
deep_merge
(
@options
)
if
options
[
:validate_media_type
]
!=
false
name
=
@name
@klass
.
validates_media_type_spoof_detection
name
,
:if
=>
->
(
instance
){
instance
.
send
(
name
).
dirty?
}
...
...
spec/paperclip/attachment_definitions_spec.rb
View file @
2bfd92b6
...
...
@@ -8,6 +8,6 @@ describe "Attachment Definitions" do
Dummy
.
do_not_validate_attachment_file_type
:avatar
expected
=
{
avatar:
{
path:
"abc"
},
other_attachment:
{
url:
"123"
}}
assert_equal
expected
,
Dummy
.
attachment_definitions
expect
(
Dummy
.
attachment_definitions
).
to
eq
expected
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