stop breaking on donations that delete their outfit
This commit is contained in:
parent
a3c31f7042
commit
a11140f9e1
1 changed files with 5 additions and 1 deletions
|
@ -7,7 +7,7 @@ class DonationFeature < ActiveRecord::Base
|
||||||
delegate :donor_name, to: :donation
|
delegate :donor_name, to: :donation
|
||||||
|
|
||||||
def as_json(options={})
|
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
|
end
|
||||||
|
|
||||||
def outfit_url=(outfit_url)
|
def outfit_url=(outfit_url)
|
||||||
|
@ -17,4 +17,8 @@ class DonationFeature < ActiveRecord::Base
|
||||||
def outfit_id_present?
|
def outfit_id_present?
|
||||||
outfit_id.present?
|
outfit_id.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def outfit_image_url
|
||||||
|
outfit && outfit.image ? outfit.image.medium.url : nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue