OSDN Git Service

acaefc8f8bb835e13967b1fba54e653570786e0a
[pettanr/pettanr.git] / app / models / balloon.rb
1 class Balloon < ActiveRecord::Base
2   belongs_to :speech_balloon
3   belongs_to :system_picture
4   
5 #  validates :speech_balloon_id, :presence => true, :numericality => true, :existence => true
6   validates :system_picture_id, :presence => true, :numericality => true, :existence => true
7   validates :x, :presence => true, :numericality => true
8   validates :y, :presence => true, :numericality => true
9   validates :width, :presence => true, :numericality => true, :natural_number => true
10   validates :height, :presence => true, :numericality => true, :natural_number => true
11 #  validates :caption, :presence => true
12 #  validates :settings, :presence => true
13
14   def url
15     '/system_pictures/' + self.system_picture.filename
16   end
17   
18 end