lib/cachai.rb in cachai-0.2.4 vs lib/cachai.rb in cachai-0.2.5
- old
+ new
@@ -82,10 +82,10 @@
if data['protocol'].blank? or data['path'].blank?
return halt(422, "Missing params.")
end
post = Post.find_or_create_by_path(data['path'])
- if @duration && post.created_at < @duration.days.ago
+ if post.comments_closed?(@duration && @duration.days)
return halt(400, "Comments closed.")
end
permalink = 'http://' + data['domain'] + data['path']