From dad6086ed542c97b0d4c8f8ffc485c604823106c Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Fri, 25 Jan 2013 11:33:17 +0100 Subject: [PATCH] Rid ourselves of attachment_definitions --- lib/paperclip.rb | 14 +------------- lib/paperclip/glue.rb | 1 - 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/lib/paperclip.rb b/lib/paperclip.rb index a3c7e213b..003cafd1e 100644 --- a/lib/paperclip.rb +++ b/lib/paperclip.rb @@ -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) @@ -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 diff --git a/lib/paperclip/glue.rb b/lib/paperclip/glue.rb index b358ae571..2d14c627a 100644 --- a/lib/paperclip/glue.rb +++ b/lib/paperclip/glue.rb @@ -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)