Skip to content

Instantly share code, notes, and snippets.

@spraints
Created May 13, 2015 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spraints/61147fdd8e828690cc47 to your computer and use it in GitHub Desktop.
Save spraints/61147fdd8e828690cc47 to your computer and use it in GitHub Desktop.
def process(pull, attributes)
pull.review_comments.find_each do |comment|
rewrite_urls_in_model_body(comment)
comment.updated_at = comment.created_at # fix for referred_at
quiesce(comment, :ensure_synced_with_pull) do
comment.save
end
end
issue_post_processor.process(pull.issue, attributes)
end
def quiesce(object, method_name)
original_method = object.method(method_name)
object.send(:define_method, method_name) { }
yield
ensure
object.send(:define_method, method_name, original_method)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment