Skip to content

Instantly share code, notes, and snippets.

@mattmartini
Created November 4, 2017 02:12
Show Gist options
  • Save mattmartini/facb054af2d523dc785b5c394bef3111 to your computer and use it in GitHub Desktop.
Save mattmartini/facb054af2d523dc785b5c394bef3111 to your computer and use it in GitHub Desktop.
# == Schema Information
#
# Table name: dishes
#
# id :integer not null, primary key
# name :string
# category_id :integer
# description :string
# small_size_price :decimal(, )
# large_size_price :decimal(, )
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_dishes_on_category_id (category_id)
#
FactoryGirl.define do
factory :dish do
name Faker::Food.dish
association :category, factory: :category
description Faker::Lorem.sentence
small_size_price Faker::Number.decimal(2)
large_size_price Faker::Number.decimal(2)
factory :dish_mstc do
association :category, factory: :category_mst
end
factory :dish_msfc do
association :category, factory: :category_msf
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment