gremium und studien factory und specs

This commit is contained in:
2019-01-13 15:13:31 +01:00
parent 92d63b71ed
commit f52ec0411d
7 changed files with 66 additions and 37 deletions

View File

@@ -28,8 +28,11 @@ class Gremium < ActiveRecord::Base
text :desc
text :name
end
belongs_to :thema # Gehört zu einem Thema
validates :name, :presence=>true
validates :typ, :presence=>true
validates :typ, :inclusion =>{ in: Gremium::TYPEN.keys()}
scope :tabs, -> { where(:typ => [1,3]).order(:typ).order(:name) } # Gremien die in Tabs angezeigt werden (Alle Anderen nur in der Liste