-class Speech < ActiveRecord::Base
+class Speech < Pettanr::Item
include ElementPart
belongs_to :speech_balloon
belongs_to :writing_format
@@text_align_texts = ['left', 'left', 'right', 'center']
- before_validation :valid_encode
+ def self.singular
+ 'Speech'
+ end
- def valid_encode
- ['content', 'quotes', 'settings'].each do |a|
- next if attributes[a] == nil
- raise Pettanr::BadRequest unless attributes[a].valid_encoding?
- end
+ def self.plural
+ 'Speeches'
+ end
+
+ def self.owner_type
+ :author
+ end
+
+ def self.valid_encode_columns
+ super.merge ['content', 'quotes', 'settings']
end
def self.colum_structures