Skip to content

Instantly share code, notes, and snippets.

/checkout_1.rb Secret

Created June 10, 2016 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/290fde5d37eb4ddcdcb5620d240cc073 to your computer and use it in GitHub Desktop.
Save anonymous/290fde5d37eb4ddcdcb5620d240cc073 to your computer and use it in GitHub Desktop.
# Version 1
class Checkout
def save
if valid?
persist!
true
else
false
end
end
end
# Version 2
class Checkout
def save
return false unless valid?
persist!
true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment