diff options
author | Petteri Räty <betelgeuse@gentoo.org> | 2011-03-12 21:13:18 +0200 |
---|---|---|
committer | Petteri Räty <betelgeuse@gentoo.org> | 2011-03-12 21:13:18 +0200 |
commit | c38161f8d317aee036f197a9b670f96dcd4c9ec3 (patch) | |
tree | 3ba7b4cd90a3bb5ea4a351c3c3221fd8de8603fd /app/models/category.rb | |
parent | Rename QuestionCategory to Category (diff) | |
download | recruiting-webapp-c38161f8d317aee036f197a9b670f96dcd4c9ec3.tar.gz recruiting-webapp-c38161f8d317aee036f197a9b670f96dcd4c9ec3.tar.bz2 recruiting-webapp-c38161f8d317aee036f197a9b670f96dcd4c9ec3.zip |
Questions can belong to many categories
While starting to input quiz questions for the arch tester quizzes we
found out that it would be best if questions could belong to many
categories. Now the relationship between questions and categories is
many to many. Bug #356179.
Diffstat (limited to 'app/models/category.rb')
-rw-r--r-- | app/models/category.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/category.rb b/app/models/category.rb index a52a50d..146921b 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -25,7 +25,8 @@ class Category < ActiveRecord::Base validates_presence_of :name - has_many :questions + has_many :question_categories + has_many :questions, :through => :question_categories has_many :user_categories has_many :users, :through => :user_categories, :accessible => true |