Skip to content

Instantly share code, notes, and snippets.

@paulmars
Created September 4, 2015 20:01
Show Gist options
  • Select an option

  • Save paulmars/6f04b6a2caf5c3879e1f to your computer and use it in GitHub Desktop.

Select an option

Save paulmars/6f04b6a2caf5c3879e1f to your computer and use it in GitHub Desktop.
class Val
def self.check!(klass)
klass.find_each do |s|
begin
if !s.valid?
message = s.errors.full_messages.to_sentence
throw "#{klass.to_s} #{s.id} #{message}"
end
rescue => e
Raven.capture_exception(e)
end
end; true
end
end
class ValidationWorker
def perform
# do all your records
Val.check!(User)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment