diff options
author | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2010-05-17 20:49:14 +0200 |
---|---|---|
committer | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2010-05-21 08:40:40 +0200 |
commit | 85c65fbcfbcc88b1721be492421239a660fe1e73 (patch) | |
tree | 18b2afa3aeb46278bd337aca23813c4840418bf0 /app/models/question_category.rb | |
parent | Added roles (diff) | |
download | recruiting-webapp-85c65fbcfbcc88b1721be492421239a660fe1e73.tar.gz recruiting-webapp-85c65fbcfbcc88b1721be492421239a660fe1e73.tar.bz2 recruiting-webapp-85c65fbcfbcc88b1721be492421239a660fe1e73.zip |
Generated Question and QuestionCategory models.
Question belongs to QuestionCategory.
Diffstat (limited to 'app/models/question_category.rb')
-rw-r--r-- | app/models/question_category.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/models/question_category.rb b/app/models/question_category.rb new file mode 100644 index 0000000..af4b0fd --- /dev/null +++ b/app/models/question_category.rb @@ -0,0 +1,29 @@ +class QuestionCategory < ActiveRecord::Base + + hobo_model # Don't put anything above this + + fields do + name :string + timestamps + end + + has_many :questions + # --- Permissions --- # + + def create_permitted? + acting_user.administrator? + end + + def update_permitted? + acting_user.administrator? + end + + def destroy_permitted? + acting_user.administrator? + end + + def view_permitted?(field) + true + end + +end |