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
fd6eba32
Commit
fd6eba32
authored
May 23, 2011
by
Prem Sichanugrist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix problem occurred from undefined `inheritable_attributes` in Rails 2.3.x after the last merge
parent
ddef840b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
lib/paperclip.rb
+14
-2
No files found.
lib/paperclip.rb
View file @
fd6eba32
...
...
@@ -158,6 +158,7 @@ module Paperclip
module
Glue
def
self
.
included
base
#:nodoc:
base
.
extend
ClassMethods
base
.
class_attribute
:attachment_definitions
if
base
.
respond_to?
(
"set_callback"
)
base
.
send
:include
,
Paperclip
::
CallbackCompatability
::
Rails3
else
...
...
@@ -233,7 +234,14 @@ module Paperclip
def
has_attached_file
name
,
options
=
{}
include
InstanceMethods
write_inheritable_attribute
(
:attachment_definitions
,
{})
if
attachment_definitions
.
nil?
if
attachment_definitions
.
nil?
if
respond_to?
(
:class_attribute
)
self
.
attachment_definitions
=
{}
else
write_inheritable_attribute
(
:attachment_definitions
,
{})
end
end
attachment_definitions
[
name
]
=
{
:validations
=>
[]}.
merge
(
options
)
after_save
:save_attached_files
...
...
@@ -341,7 +349,11 @@ module Paperclip
# Returns the attachment definitions defined by each call to
# has_attached_file.
def
attachment_definitions
inheritable_attributes
[
:attachment_definitions
]
if
respond_to?
(
:class_attribute
)
self
.
attachment_definitions
else
read_inheritable_attribute
(
:attachment_definitions
)
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