Skip to content

Instantly share code, notes, and snippets.

@GeekOnCoffee
Created January 18, 2012 17:19
Show Gist options
  • Save GeekOnCoffee/1634233 to your computer and use it in GitHub Desktop.
Save GeekOnCoffee/1634233 to your computer and use it in GitHub Desktop.
Line Item Factory
Factory.define(:line_item) do |record|
# associations:
record.association(:order, :factory => :order)
record.association(:variant, :factory => :variant)
record.quantity 1
record.price { variant.price }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment