Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix a helper method used in refreshing attachments. #29

Merged
merged 1 commit into from

4 participants

@mschulkind

No description provided.

@sdhull
Collaborator

This fixes rake paperclip:refresh rake task right? I'm gonna try out your fork tonight and make sure it works then merge it. Cheers!

@mschulkind
@tashian

+1

@mschulkind
@tashian

thanks Matthew!

@sdhull sdhull merged commit 07c37ed into meskyanichi:develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 12, 2012
  1. @mschulkind
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/mongoid_paperclip.rb
View
12 lib/mongoid_paperclip.rb
@@ -28,6 +28,18 @@ def logger
end
##
+# mongoid criteria uses a different syntax.
+module Paperclip
+ module Helpers
+ def each_instance_with_attachment(klass, name)
+ class_for(klass).unscoped.where("#{name}_file_name".to_sym.ne => nil).each do |instance|
+ yield(instance)
+ end
+ end
+ end
+end
+
+##
# The Mongoid::Paperclip extension
# Makes Paperclip play nice with the Mongoid ODM
#
Something went wrong with that request. Please try again.