AutoCommit Fre Jul 31 21:03:04 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-07-31 21:03:04 +02:00
26 changed files with 340 additions and 23 deletions

View File

@@ -17,6 +17,7 @@ class Beispiel < ActiveRecord::Base
acts_as_votable
acts_as_flagable
belongs_to :lva
belongs_to :lecturer
FLAG_ICONS = {"badquality"=>"fa fa-flag","goodquality"=>"fa fa-flag", "delete"=>"fa fa-trash"}
scope :not_flag_badquality, ->{where("flag_badquality IS NULL OR flag_badquality=?",false)}
@@ -25,6 +26,9 @@ class Beispiel < ActiveRecord::Base
scope :flag_delete, ->{where("flag_delete=?",true)}
mount_uploader :beispieldatei, AttachmentUploader
include IsCommentable
validates :beispieldatei, :presence => true
validates :name, :presence => true
validates :lva_id, :presence => true