Don't send it unless you're in production
:
def api_post
if Rails.env.production?
ms = RestClient.new()
ms.post :category, self.to_json(:root => true)
end
end
This will skip it for development
and test
environments. The if
check can be moved around as desired (perhaps to be around the after_commit
instead, if it suits).