Commit 3f46100f by sam Committed by Jon Yurek

fix

parent c3fb1194
......@@ -8,7 +8,7 @@ module Paperclip
base.extend ClassMethods
base.send :include, Callbacks
base.send :include, Validators
base.send :include, Schema
base.send :include, Schema if defined? ActiveRecord
locale_path = Dir.glob(File.dirname(__FILE__) + "/locales/*.{rb,yml}")
I18n.load_path += locale_path unless I18n.load_path.include?(locale_path)
......
......@@ -1491,5 +1491,24 @@ describe Paperclip::Attachment do
end
end
context "Non ActiveRecord workflows" do
before do
# temporary take out AR
@ar_bak = Object.send(:remove_const, :ActiveRecord)
end
it "Can include glue without dependency on AR" do
klass = Object.const_set("SomeNonActiveRecordModel", Class.new)
klass.class_eval do
include Paperclip::Glue
end
end
after do
# put back AR
ActiveRecord = @ar_back
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment