diff --git a/config/environments/production.rb b/config/environments/production.rb index 3138ea3c7..72cb30a4e 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -59,4 +59,17 @@ Orbit::Application.configure do # Send deprecation notices to registered listeners config.active_support.deprecation = :notify + + + config.action_mailer.delivery_method = :smtp + config.action_mailer.smtp_settings = { + :enable_starttls_auto => true, + :address => "smtp.gmail.com", + :port => '587', + :domain => "smtp.gmail.com", + :authentication => "plain", + :user_name => "redmine@rulingcom.com", + :password => "rulingredmine" + } + end diff --git a/vendor/built_in_modules/survey/app/models/survey.rb b/vendor/built_in_modules/survey/app/models/survey.rb index 0ca9c6c7e..4f271eeef 100644 --- a/vendor/built_in_modules/survey/app/models/survey.rb +++ b/vendor/built_in_modules/survey/app/models/survey.rb @@ -73,13 +73,18 @@ class Survey survey_questions.each do |question| qid = question.id.to_s + options = question.survey_question_options.map(&:name) case question.type when ::SurveyQuestion::Radio, ::SurveyQuestion::Select chart_data[qid] = {} answers = survey_answers.each do |answer| if answer[qid] - chart_data[qid][answer[qid]] ||= 0 - chart_data[qid][answer[qid]] += 1 + this_answer = answer[qid] + unless options.include? this_answer + this_answer = I18n.t('survey_question.use_custom_option') + end + chart_data[qid][this_answer] ||= 0 + chart_data[qid][this_answer] += 1 end end when ::SurveyQuestion::Check @@ -87,8 +92,12 @@ class Survey answers = survey_answers.each do |answer| if answer[qid] answer[qid].each do |option| - chart_data[qid][option] ||= 0 - chart_data[qid][option] += 1 + this_answer = option + unless options.include? this_answer + this_answer = I18n.t('survey_question.use_custom_option') + end + chart_data[qid][this_answer] ||= 0 + chart_data[qid][this_answer] += 1 end end end