forked from bofh/fetsite
Upgraded to Rails 4
This commit is contained in:
@@ -3,10 +3,10 @@ class Document < ActiveRecord::Base
|
||||
attr_accessible :name, :parent, :text, :typ, :parent_id, :parent_type
|
||||
|
||||
belongs_to :parent, :polymorphic => true
|
||||
validate :name, :length=>{minimum:3}
|
||||
validate :text, :presence=>true
|
||||
validate :typ, :presence=>true
|
||||
validate :parent, :presence=>true
|
||||
validates :name, :length=>{minimum:3}
|
||||
validates :text, :presence=>true
|
||||
validates :typ, :presence=>true
|
||||
validates :parent, :presence=>true
|
||||
has_paper_trail
|
||||
TYPS = { 1=>"fet_docs", 10=>"protocol", 11=> "agenda"}
|
||||
has_many :attachments, :as=>:parent
|
||||
|
||||
Reference in New Issue
Block a user