lib/cachai.rb in cachai-0.1.1 vs lib/cachai.rb in cachai-0.1.2
- old
+ new
@@ -86,10 +86,10 @@
}
post = Post.find_or_create_by_path(data['path'])
response = Response.create!(attrs.merge(:post_id => post.id))
Cachai.clear_cache(data['path'])
- notify_new_response(response, data['path'])
+ notify_new_response(response, data['path']) if @sendgrid
json({ :status => 'ok', :comment => response })
rescue JSON::ParserError
status 400 and json({ :error => 'Invalid JSON.' })