Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Check for existance of class_attribute setter
Browse files Browse the repository at this point in the history
  • Loading branch information
sikachu committed Feb 17, 2012
1 parent 6fca437 commit 4b79530
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/paperclip.rb
Expand Up @@ -324,7 +324,11 @@ def has_attached_file name, options = {}
write_inheritable_attribute(:attachment_definitions, {})
end
else
self.attachment_definitions = self.attachment_definitions.dup
if respond_to?(:class_attribute)
self.attachment_definitions = self.attachment_definitions.dup
else
write_inheritable_attribute(:attachment_definitions, self.attachment_definitions.dup)
end
end

attachment_definitions[name] = Paperclip::AttachmentOptions.new(options)
Expand Down

3 comments on commit 4b79530

@joshuaclayton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class_attribute was introduced in ActiveSupport 2.3.12; does it make sense to just bump that gem dependency?

@sikachu
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, let's keep it that way for now. I'm going to tear it out anyway after next week (I.e. #728)

@sikachu
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(because there're some project that still use rails <= 2.3.12)

Please sign in to comment.