I’'m trying to use a model in a Rake task like this:
namespace :halo do
desc "post to the usertable via "
task :post_user_with_activerecord do
end_time = Time.new
start_time = end_time - 60
until start_time > end_time
start_time = start_time + 15
heartrate = User.new(:user_id => 817, :timestamp =>
start_time, :value=> rand(5)+70)
But I get the following error
uninitialized constant User
When I add require ‘User’, I get an error saying uninitialized
constant ActiveRecord. When I add require ‘active_record’, I get
Is there something obvious that I’m missing?