class Balloon < Peta::Content
+ load_manifest
include Peta::ElementPart
belongs_to :speech_balloon
belongs_to :system_picture
# validates :caption, :presence => true
validates :settings, :extend_balloon => true
- def owner_model
- self.speech_balloon.panel
- end
-
- def self.valid_encode_columns
- super + ['settings']
- end
-
def self.colum_structures
@@colum_structures ||= {
:r => {
{:include => {:speech_balloon => {:include => {:panel => {:include => {:author => {} }}, :speech => {}, :speech_balloon_template => {} }}}}
end
+ def style
+ {
+ 'width' => self.width.to_s + 'px','height' => self.height.to_s + 'px',
+ 'top' => self.y.to_s + 'px','left' => self.x.to_s + 'px'
+ }
+ end
+
def copy_attributes
r = self.attributes
r.delete 'id'