From 0226cff3e49d4bdd2c6957d2ae30eeaa394633a5 Mon Sep 17 00:00:00 2001 From: nilsding Date: Tue, 11 Nov 2014 07:18:34 +0100 Subject: [PATCH] now incrementing asked_count --- app/controllers/ajax/question_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/ajax/question_controller.rb b/app/controllers/ajax/question_controller.rb index 578ce339..3fa2ecf4 100644 --- a/app/controllers/ajax/question_controller.rb +++ b/app/controllers/ajax/question_controller.rb @@ -8,6 +8,10 @@ class Ajax::QuestionController < ApplicationController author_is_anonymous: params[:anonymousQuestion], user: current_user) + unless current_user.nil? + current_user.increment! :asked_count unless params[:anonymousQuestion] == 'true' + end + Inbox.create!(user_id: params[:rcpt], question_id: question.id, new: true) @status = :okay