diff options
Diffstat (limited to 'app/models/question_group.rb')
-rw-r--r-- | app/models/question_group.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/question_group.rb b/app/models/question_group.rb index 81d738b..4ecd037 100644 --- a/app/models/question_group.rb +++ b/app/models/question_group.rb @@ -32,12 +32,12 @@ class QuestionGroup < ActiveRecord::Base include Permissions::AnyoneCanViewAdminCanChange named_scope :in_category, lambda { |cid| { - :joins => :questions, :conditions => ['questions.question_category_id = ?', cid], + :joins => :questions, :conditions => ['questions.category_id = ?', cid], :group => 'question_groups.id, question_groups.name, question_groups.description, question_groups.created_at, question_groups.updated_at'}} named_scope :unassociated_in_category, lambda { |uid, cid| { - :joins => :questions, :conditions => ['questions.question_category_id = ? AND NOT EXISTS + :joins => :questions, :conditions => ['questions.category_id = ? AND NOT EXISTS (SELECT user_question_groups.* FROM user_question_groups INNER JOIN questions ON questions.id = user_question_groups.question_id WHERE (user_question_groups.user_id = ? AND questions.question_group_id = question_groups.id))', cid, uid], |