0

I have a non-rails application where I use both rake and activerecord for my db migrations etc.

How could I use seeds?

I created a seeds.rb file, but how to wrap it in a rake method call?

Blankman
  • 259,732
  • 324
  • 769
  • 1,199

1 Answers1

1

Just use require_relative 'db/seeds' if using Ruby 1.9, or require 'db/seeds' if using Ruby 1.8 inside a rake task. They will be evaluated when you call it.

Pedro Nascimento
  • 13,136
  • 4
  • 36
  • 64