Skip to content

Instantly share code, notes, and snippets.

@deJaVisions
Created February 28, 2012 06:24
Show Gist options
  • Select an option

  • Save deJaVisions/1930181 to your computer and use it in GitHub Desktop.

Select an option

Save deJaVisions/1930181 to your computer and use it in GitHub Desktop.
mat1 = Material.create!(title: 'Antique Yangtze Limestone', description: 'test desc')
image1 = Image.create!(orig_filename: 'test1.jpg')
mat1.default_image_id = image1 if mat1.default_image_id.nil?
mat1.save!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment