Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
makeup
Browse files Browse the repository at this point in the history
  • Loading branch information
gurix committed Aug 4, 2014
1 parent d3d537a commit a5d83c1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion app/models/helena/sub_question.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class SubQuestion

def uniqueness_of_code
question_code_occurences = question.question_group.version.question_code_occurences
errors.add(:code, :taken, value: code) if question_code_occurences[code] > 1

return true if question_code_occurences[code] <= 1

errors.add(:code, :taken, value: code)
end
end
end
4 changes: 2 additions & 2 deletions app/views/helena/admin/questions/_sub_questions.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
= sub_question.input :value, label: false, as: :hidden, value: 1
%td.delete
- unless sub_question.object.new_record?
= sub_question.input :_destroy, as: :boolean,
label: Helena::SubQuestion.human_attribute_name(:_destroy)
= sub_question.input :_destroy, as: :boolean,
label: Helena::SubQuestion.human_attribute_name(:_destroy)
1 change: 1 addition & 0 deletions app/views/helena/admin/versions/_form.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
= simple_form_for [:admin, @survey, @version] do |f|
= f.input :notes
= f.input :session_report, as: :text, input_html: { cols: 60, rows: 10 }, hint: t('.session_report_hint')

= f.submit t('shared.save'), class: 'btn btn-success'

0 comments on commit a5d83c1

Please sign in to comment.