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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
lib/paperclip.rb
+15
-3
No files found.
lib/paperclip.rb
View file @
fd6eba32
...
@@ -132,7 +132,7 @@ module Paperclip
...
@@ -132,7 +132,7 @@ module Paperclip
def
logging?
#:nodoc:
def
logging?
#:nodoc:
options
[
:log
]
options
[
:log
]
end
end
def
class_for
(
class_name
)
def
class_for
(
class_name
)
class_name
.
split
(
'::'
).
inject
(
Object
)
do
|
klass
,
partial_class_name
|
class_name
.
split
(
'::'
).
inject
(
Object
)
do
|
klass
,
partial_class_name
|
klass
.
const_get
(
partial_class_name
)
klass
.
const_get
(
partial_class_name
)
...
@@ -158,6 +158,7 @@ module Paperclip
...
@@ -158,6 +158,7 @@ module Paperclip
module
Glue
module
Glue
def
self
.
included
base
#:nodoc:
def
self
.
included
base
#:nodoc:
base
.
extend
ClassMethods
base
.
extend
ClassMethods
base
.
class_attribute
:attachment_definitions
if
base
.
respond_to?
(
"set_callback"
)
if
base
.
respond_to?
(
"set_callback"
)
base
.
send
:include
,
Paperclip
::
CallbackCompatability
::
Rails3
base
.
send
:include
,
Paperclip
::
CallbackCompatability
::
Rails3
else
else
...
@@ -233,7 +234,14 @@ module Paperclip
...
@@ -233,7 +234,14 @@ module Paperclip
def
has_attached_file
name
,
options
=
{}
def
has_attached_file
name
,
options
=
{}
include
InstanceMethods
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
)
attachment_definitions
[
name
]
=
{
:validations
=>
[]}.
merge
(
options
)
after_save
:save_attached_files
after_save
:save_attached_files
...
@@ -341,7 +349,11 @@ module Paperclip
...
@@ -341,7 +349,11 @@ module Paperclip
# Returns the attachment definitions defined by each call to
# Returns the attachment definitions defined by each call to
# has_attached_file.
# has_attached_file.
def
attachment_definitions
def
attachment_definitions
inheritable_attributes
[
:attachment_definitions
]
if
respond_to?
(
:class_attribute
)
self
.
attachment_definitions
else
read_inheritable_attribute
(
:attachment_definitions
)
end
end
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