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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just use
require_relative 'db/seeds'if using Ruby 1.9, orrequire 'db/seeds'if using Ruby 1.8 inside a rake task. They will be evaluated when you call it.