Skip to content

Instantly share code, notes, and snippets.

Created June 24, 2016 21:23
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/bec5f44193c94e2e2ba599a342d3bc70 to your computer and use it in GitHub Desktop.
Save anonymous/bec5f44193c94e2e2ba599a342d3bc70 to your computer and use it in GitHub Desktop.
def create_car(options = {})
options[:color] ||= Car::COLOR_ARRAY.sample
options[:condition] ||= Car::CONDITION_ARRAY.sample
options[:top_speed] ||= Car::SPEEDS_ARRAY.sample
Car.create(:color => options[:color],
:condition => options[:condition],
:top_speed => options[:top_speed])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment