Specs: Ensure photos always width and height

This commit is contained in:
Jonne Haß 2019-04-27 16:05:35 +02:00
parent 91b6a807c7
commit 214c2d7af7

View file

@ -24,6 +24,12 @@ class User
p = build_post(class_name, opts) p = build_post(class_name, opts)
p.aspects = aspects p.aspects = aspects
if class_name == :photo
p.width = 42 unless opts.has_key? :width
p.height = 42 unless opts.has_key? :height
end
if p.save! if p.save!
self.aspects.reload self.aspects.reload