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
dad6086e
Commit
dad6086e
authored
Jan 25, 2013
by
Mike Burns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rid ourselves of attachment_definitions
parent
d687fca1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
14 deletions
+1
-14
lib/paperclip.rb
+1
-13
lib/paperclip/glue.rb
+0
-1
No files found.
lib/paperclip.rb
View file @
dad6086e
...
@@ -173,13 +173,7 @@ module Paperclip
...
@@ -173,13 +173,7 @@ module Paperclip
# end
# end
# end
# end
def
has_attached_file
(
name
,
options
=
{})
def
has_attached_file
(
name
,
options
=
{})
if
attachment_definitions
.
nil?
options
=
Paperclip
::
AttachmentOptions
.
new
(
options
)
self
.
attachment_definitions
=
{}
else
self
.
attachment_definitions
=
self
.
attachment_definitions
.
dup
end
options
=
attachment_definitions
[
name
]
=
Paperclip
::
AttachmentOptions
.
new
(
options
)
Paperclip
.
classes_with_attachments
<<
self
.
name
Paperclip
.
classes_with_attachments
<<
self
.
name
Paperclip
.
check_for_path_clash
(
name
,
options
[
:path
],
self
.
name
)
Paperclip
.
check_for_path_clash
(
name
,
options
[
:path
],
self
.
name
)
...
@@ -220,12 +214,6 @@ module Paperclip
...
@@ -220,12 +214,6 @@ module Paperclip
attachment
.
send
(
:flush_errors
)
attachment
.
send
(
:flush_errors
)
end
end
end
end
# Returns the attachment definitions defined by each call to
# has_attached_file.
def
attachment_definitions
self
.
attachment_definitions
end
end
end
end
end
...
...
lib/paperclip/glue.rb
View file @
dad6086e
...
@@ -9,7 +9,6 @@ module Paperclip
...
@@ -9,7 +9,6 @@ module Paperclip
base
.
send
:include
,
Callbacks
base
.
send
:include
,
Callbacks
base
.
send
:include
,
Validators
base
.
send
:include
,
Validators
base
.
send
:include
,
Schema
if
defined?
ActiveRecord
base
.
send
:include
,
Schema
if
defined?
ActiveRecord
base
.
class_attribute
:attachment_definitions
locale_path
=
Dir
.
glob
(
File
.
dirname
(
__FILE__
)
+
"/locales/*.{rb,yml}"
)
locale_path
=
Dir
.
glob
(
File
.
dirname
(
__FILE__
)
+
"/locales/*.{rb,yml}"
)
I18n
.
load_path
+=
locale_path
unless
I18n
.
load_path
.
include?
(
locale_path
)
I18n
.
load_path
+=
locale_path
unless
I18n
.
load_path
.
include?
(
locale_path
)
...
...
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