aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user_question_group.rb')
-rw-r--r--app/models/user_question_group.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/user_question_group.rb b/app/models/user_question_group.rb
index 5319984..5c5f537 100644
--- a/app/models/user_question_group.rb
+++ b/app/models/user_question_group.rb
@@ -1,3 +1,5 @@
+# Associates user with grouped question. No user can do anything to it -
+# application manages those internally.
class UserQuestionGroup < ActiveRecord::Base
hobo_model # Don't put anything above this
@@ -27,10 +29,12 @@ class UserQuestionGroup < ActiveRecord::Base
protected
# as users can never edit questions on their own if one of those isn't met
# it'll be because of some problem in application
+ # TODO: change name
def question_has_category
errors.add(:question, 'must be grouped!') if question._?.question_group.nil?
end
+ # TODO: change name
def user_does_not_have_other_question_from_the_same_category
# if there are Questions from the same group associated with the same user
# through user_question_groups report an error