Skip to content

Commit

Permalink
Only include Paperclip one time
Browse files Browse the repository at this point in the history
  • Loading branch information
warlley committed Aug 13, 2011
1 parent 7f3350d commit 9881d33
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/mongoid_paperclip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ def has_mongoid_attached_file(field, options = {})

##
# Include Paperclip and Paperclip::Glue for compatibility
include ::Paperclip
include ::Paperclip::Glue

unless self.ancestors.include?(::Paperclip)
include ::Paperclip
include ::Paperclip::Glue
end

##
# Invoke Paperclip's #has_attached_file method and passes in the
# arguments specified by the user that invoked Mongoid::Paperclip#has_mongoid_attached_file
Expand Down

0 comments on commit 9881d33

Please sign in to comment.