Skip to content
Browse files

Check for existance of class_attribute setter

  • Loading branch information...
1 parent 6fca437 commit 4b795307096457f23816d4127465ebd6d7b2a30e @sikachu sikachu committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/paperclip.rb
6 lib/paperclip.rb
@@ -324,7 +324,11 @@ def has_attached_file name, options = {}
write_inheritable_attribute(:attachment_definitions, {})
- 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
attachment_definitions[name] =

3 comments on commit 4b79530

thoughtbot, inc. member

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

thoughtbot, inc. member

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

thoughtbot, inc. member

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

Please sign in to comment.
Something went wrong with that request. Please try again.