Skip to content

Instantly share code, notes, and snippets.

@franzejr
Created October 4, 2015 18:57
Show Gist options
  • Select an option

  • Save franzejr/fd41deabd01ac7fca3b1 to your computer and use it in GitHub Desktop.

Select an option

Save franzejr/fd41deabd01ac7fca3b1 to your computer and use it in GitHub Desktop.
Validations with external services
class AdPlacementCreator
def create(params)
ad = AdPlacement.new(params)
if ad.valid?
ad.short_url = BeaconAPI.shorten(ad.original_url) ad.save
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment