Skip to content

Instantly share code, notes, and snippets.

@aliakhtar
Created February 3, 2016 10:10
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 aliakhtar/e4705c113041cf14d1f3 to your computer and use it in GitHub Desktop.
Save aliakhtar/e4705c113041cf14d1f3 to your computer and use it in GitHub Desktop.
if restaurant.nil?
restaurant = Restaurant.create({account: self, name: name, catering_hours: [12]})
restaurant.emails.create({name: 'General', email: email })
else
puts "Updating restaurant: #{restaurant}, #{restaurant.nil?}"
restaurant.update_attribute(:name, name)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment