AutoCommit Son Jun 21 00:03:01 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-06-21 00:03:01 +02:00
parent 916f2246f2
commit c62b3b34dd
6 changed files with 168 additions and 11 deletions

View File

@@ -17,9 +17,13 @@ class Beispiel < ActiveRecord::Base
acts_as_votable
acts_as_flagable
belongs_to :lva
FLAG_ICONS = {"badquality"=>"fa fa-flag", "delete"=>"icon-trash"}
mount_uploader :beispieldatei, AttachmentUploader
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)}
scope :flag_badquality, ->{where("flag_badquality=?",true)}
scope :not_flag_delete, ->{where("flag_delete IS NULL OR flag_delete=?",false)}
scope :flag_delete, ->{where("flag_delete=?",true)}
mount_uploader :beispieldatei, AttachmentUploader
validates :beispieldatei, :presence => true
validates :name, :presence => true
validates :lva_id, :presence => true