stop breaking on donations that delete their outfit

This commit is contained in:
Emi Matchu 2015-02-25 13:42:35 -06:00
parent a3c31f7042
commit a11140f9e1

View file

@ -7,7 +7,7 @@ class DonationFeature < ActiveRecord::Base
delegate :donor_name, to: :donation
def as_json(options={})
{donor_name: donor_name, outfit_image_url: outfit.image.medium.url}
{donor_name: donor_name, outfit_image_url: outfit_image_url}
end
def outfit_url=(outfit_url)
@ -17,4 +17,8 @@ class DonationFeature < ActiveRecord::Base
def outfit_id_present?
outfit_id.present?
end
def outfit_image_url
outfit && outfit.image ? outfit.image.medium.url : nil
end
end