Files
danbooru/app/models/jobs/fix_pixiv_uploads.rb
2010-08-27 16:59:59 -04:00

14 lines
360 B
Ruby

module Jobs
class FixPixivUploads < Struct.new(:last_post_id)
def perform
post_id = nil
Post.find_each(:conditions => ["GREATEST(width, height) IN (150, 600) AND source LIKE ? AND id > ?", "%pixiv%", last_post_id]) do |post|
post_id = post.id
end
update_attributes(:data => {:last_post_id => post_id})
end
end
end