Problems with association named :task


#1

I have an object that belongs_to :task, and calling that object’s task
method returns the task it belongs to in the unit tests. One place in a
controller, though, it gives me the error:
undefined method find' for Rake::Task:Class ./script/../config/../vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb:44:infind_target’
./script/…/config/…/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:106:in
load_target' ./script/../config/../vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:32:inreload’
./script/…/config/…/vendor/rails/activerecord/lib/active_record/associations.rb:661:in
task' ./script/../config/../vendor/rails/activerecord/lib/active_record/associations.rb:654:intask’
#{RAILS_ROOT}/app/controllers/account_controller.rb:96:in
redirect_to_last_viewed_task' #{RAILS_ROOT}/app/controllers/account_controller.rb:80:inlogin’

and simultaneously in the log I get:
WARNING: Deprecated reference to top-level constant ‘Task’found at:
/opt/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1702:in
`rakefile_location’
Use --classic-namespace on rake command
or ‘require “rake/classic_namespace”’ in Rakefile

I’ve even tried specifying
belongs_to :task, :class_name => “ActiveRecord::Task”, :foreign_key =>
‘task_id’
and still no luck. Any suggestions?

I’m on Edge Rails.

Thanks!
Jason