Skip to content

Commit

Permalink
Include URL in the coffee bag API json
Browse files Browse the repository at this point in the history
Resolves #129
  • Loading branch information
miharekar committed Jan 12, 2025
1 parent f1220b1 commit d9b2ec5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/coffee_bag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def duplicate(roast_date)
end

def to_api_json
attributes.slice(*%w[id name roast_date roast_level country region farm farmer variety elevation processing harvest_time quality_score tasting_notes]).tap do |json|
attributes.slice(*%w[id name roast_date roast_level country region farm farmer variety elevation processing harvest_time quality_score tasting_notes url]).tap do |json|
json["image_url"] = image&.url if image.attached?
end
end
Expand Down

0 comments on commit d9b2ec5

Please sign in to comment.