Refactoring Conference/Event media to new media object

close #420
This commit is contained in:
Chrisbr 2014-08-05 18:23:42 +02:00
parent 850beb72e1
commit 2a731e8350
31 changed files with 491 additions and 57 deletions

9
app/models/commercial.rb Normal file
View file

@ -0,0 +1,9 @@
class Commercial < ActiveRecord::Base
belongs_to :commercialable, polymorphic: true
attr_accessible :commercial_id, :commercial_type
validates :commercial_id, :commercial_type, presence: true
validates :commercial_type, inclusion: { in: CONFIG['commercial_types'].values }, allow_blank: true
end