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

Commit

Permalink
Rid ourselves of attachment_definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-burns committed Jun 14, 2013
1 parent d687fca commit dad6086
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
14 changes: 1 addition & 13 deletions lib/paperclip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,7 @@ module ClassMethods
# end
# end
def has_attached_file(name, options = {})
if attachment_definitions.nil?
self.attachment_definitions = {}
else
self.attachment_definitions = self.attachment_definitions.dup
end

options = attachment_definitions[name] = Paperclip::AttachmentOptions.new(options)
options = Paperclip::AttachmentOptions.new(options)
Paperclip.classes_with_attachments << self.name
Paperclip.check_for_path_clash(name, options[:path], self.name)

Expand Down Expand Up @@ -220,12 +214,6 @@ def has_attached_file(name, options = {})
attachment.send(:flush_errors)
end
end

# Returns the attachment definitions defined by each call to
# has_attached_file.
def attachment_definitions
self.attachment_definitions
end
end
end

Expand Down
1 change: 0 additions & 1 deletion lib/paperclip/glue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def self.included(base)
base.send :include, Callbacks
base.send :include, Validators
base.send :include, Schema if defined? ActiveRecord
base.class_attribute :attachment_definitions

locale_path = Dir.glob(File.dirname(__FILE__) + "/locales/*.{rb,yml}")
I18n.load_path += locale_path unless I18n.load_path.include?(locale_path)
Expand Down

2 comments on commit dad6086

@johnnyshields
Copy link
Contributor

Choose a reason for hiding this comment

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

@jyurek This breaks some gems built on top of paperclip such as paperclip-dimension. Perhaps next version of paperclip should be 4.0.0 according to semver?

@jyurek
Copy link

@jyurek jyurek commented on dad6086 Jul 2, 2013

Choose a reason for hiding this comment

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

Hmm, it should probably have been 3.5 if this is the case, but it would not be 4.0 because this is an internal change and does not affect the public API.

Please sign in to comment.