-
Notifications
You must be signed in to change notification settings - Fork 119
Home
ValMilkevich edited this page Nov 8, 2012
·
5 revisions
Welcome to the mongoid-paperclip wiki!
just thought I can leave it here
module Paperclip module Helpers # Find all instances of the given Active Record model +klass+ with attachment +name+. # This method is used by the refresh rake tasks. def each_instance_with_attachment(klass, name) class_for(klass).unscoped.ne("#{name}_file_name" => nil).each do |instance| yield(instance) end end end end