Skip to content
Browse files

Require Paperclip::Schema only when used with AR

This will solve an issue when using Paperclip without Active Record
such as Mongoid.

Fixes #919
  • Loading branch information...
1 parent f30f9cb commit 2860c701763d436de678c2c047bd93cb09c4fa45 @sikachu sikachu committed Jun 16, 2012
Showing with 1 addition and 7 deletions.
  1. +1 −7 lib/paperclip/glue.rb
View
8 lib/paperclip/glue.rb
@@ -8,15 +8,9 @@ def self.included(base)
base.extend ClassMethods
base.send :include, Callbacks
base.send :include, Validators
- base.send :include, Schema
+ base.send :include, Schema if defined? ActiveRecord
base.class_attribute :attachment_definitions
- if defined?(ActiveRecord)
- ActiveRecord::ConnectionAdapters::AbstractAdapter.send(:include, Paperclip::Schema)
- ActiveRecord::ConnectionAdapters::Table.send(:include, Paperclip::Schema)
- ActiveRecord::ConnectionAdapters::TableDefinition.send(:include, Paperclip::Schema)
- end
-
locale_path = Dir.glob(File.dirname(__FILE__) + "/locales/*.{rb,yml}")
I18n.load_path += locale_path unless I18n.load_path.include?(locale_path)
end

0 comments on commit 2860c70

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