AutoCommit Don Aug 6 21:03:01 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-08-06 21:03:01 +02:00
parent 390075aa7f
commit 0c0e7ba051
8 changed files with 13 additions and 7 deletions

View File

@@ -43,6 +43,8 @@ cannot :destroy, Comment
end
if ((user.has_role?("moderator",Beispiel)) || user.has_role?("fetuser") || user.has_role?("fetadmin"))
can :flag, Beispiel
can [:create, :show], Beispiel, flag_delete: true
can [:edit, :update], Beispiel
can :flag, Beispiel
can :set_lecturer, Beispiel

View File

@@ -20,6 +20,7 @@ class Beispiel < ActiveRecord::Base
belongs_to :lecturer
FLAG_ICONS = {"badquality"=>"fa fa-flag","goodquality"=>"fa fa-flag", "delete"=>"fa fa-trash"}
FLAG_CONFIRM={}
scope :not_flag_badquality, ->{where("flag_badquality IS NULL OR flag_badquality=?",false)}
scope :flag_badquality, ->{where("flag_badquality=?",true)}
scope :not_flag_delete, ->{where("flag_delete IS NULL OR flag_delete=?",false)}

View File

@@ -5,6 +5,7 @@ class Survey::Question < ActiveRecord::Base
has_many :answers, through: :choices
include IsCommentable
FLAG_ICONS={"delete" => "fa fa-trash"}
FLAG_CONFIRM={}
scope :templates, ->{ where(flag_template:true)}
acts_as_flagable