Fix ad_banner

This commit is contained in:
Matthew K. Fu JuYuan authored and Christophe Vilayphiou committed 2012-04-24 14:37:06 +08:00
1 parent c856b4cdce
commit c57ba305e9
7 files changed
+31 -12

No files matched your search

+9 -1
View File
@@ -4,7 +4,7 @@ class AdBanner
include Mongoid::MultiParameterAttributes
field :title
field :transition_sec,type: Integer
field :transition_msec,type: Integer
field :ad_fx #TODO Design should explain
before_save :save_or_destroy
@@ -13,6 +13,14 @@ class AdBanner
has_many :ad_images , dependent: :delete
FX_TYPES = ["blindX","blindY","blindZ","cover","curtainX","curtainY","fade","fadeZoom","growX","growY","scrollUp","scrollDown","scrollLeft","scrollRight","scrollHorz","scrollVert","shuffle","slideX","slideY","toss","turnUp","turnDown","turnLeft","turnRight","uncover","wipe","zoom"]
attr_writer :transition_sec
def transition_sec
self.transition_msec/1000
end
def transition_sec=(sec)
self.transition_msec = sec.to_i*1000
end
def preview_clone
preview_banner = self.clone