parent
850beb72e1
commit
2a731e8350
31 changed files with 491 additions and 57 deletions
9
app/models/commercial.rb
Normal file
9
app/models/commercial.rb
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue