-class GroundColor < ActiveRecord::Base
+class GroundColor < Pettanr::Item
include Element
include ElementInspire
belongs_to :panel
validates :z, :presence => true, :numericality => {:greater_than => 0}
validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
- before_validation :valid_encode
+ def self.singular
+ 'GroundColor'
+ end
- def valid_encode
- ['caption'].each do |a|
- next if attributes[a] == nil
- raise Pettanr::BadRequest unless attributes[a].valid_encoding?
- end
+ def self.plural
+ 'GroundColors'
+ end
+
+ def self.owner_type
+ :author
+ end
+
+ def self.valid_encode_columns
+ super.merge ['caption']
end
def self.colum_structures