Skip to content

Instantly share code, notes, and snippets.

@dbarrionuevo
Created January 3, 2015 16:40
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 dbarrionuevo/f3336a9a16e401570e2c to your computer and use it in GitHub Desktop.
Save dbarrionuevo/f3336a9a16e401570e2c to your computer and use it in GitHub Desktop.
# db/seeds/01_service_categories.rb
puts "===================================================="
puts "Service Categories"
puts "===================================================="
jobs = ServiceCategory.where(name: "Jobs", code: "J").first_or_create
education = ServiceCategory.where(name: "Education", code: "E").first_or_create
business = ServiceCategory.where(name: "Business", code: "B").first_or_create
social = ServiceCategory.where(name: "Social", code: "S").first_or_create
# .............
# .............
# .............
# Load individual seed files from seeds directory
Dir[File.join(Rails.root, 'db', 'seeds', '*.rb')].sort.each { |seed| load seed }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment