Inherited AR Methods MIssing? Errors Doesn't Exist?

I'm seeing something strange and so far haven't been able to figure it out. First off, here's our setup:

MacOS X Tiger 10.4.10 (Intel)
Ruby 1.8.6
Rails 1.2.3
PostgreSQL 8.2.3

I have a ton of apps that work great but a brand new app is giving me trouble.

I am getting an error indicating that the 'errors' method for the object doesn't exist. It should be inherited from the base AR class.

This app has a single model, 'Upload' that uses attachment_fu to take uploads.

Here's my code:


class Upload < ActiveRecord::Base
   has_attachment :storage => :file_system, :max_size => 5.megabytes


def new
   @upload = if @upload.blank?


<% form_for :upload, @upload, :url => {:action => :create} do |form| %>
   <% if @upload != nil && !@upload.errors.empty? -%>
     <%= error_messages_for 'upload' %>
   <% end -%>
<% end %>

The error I get is:

ActionView::TemplateError (undefined method `errors' for #<Upload:0x34e5e14>) on line #12 of app/views/uploads/new.rhtml:

12: <% if @upload != nil && !@upload.errors.empty? -%>
14: <%= error_messages_for 'upload' %>
15: <% end -%>

     #{RAILS_ROOT}/app/views/uploads/new.rhtml:12:in `_run_rhtml_47app47views47uploads47new46rhtml'
     /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/form_helper.rb:151:in `fields_for'
     /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/form_helper.rb:127:in `form_for'
     #{RAILS_ROOT}/app/views/uploads/new.rhtml:4:in `_run_rhtml_47app47views47uploads47new46rhtml'


When I put in some debugging code, it gets even more interesting:

I added this code to the controller:

     logger.debug "Upload Class: #{@upload.class}"
     logger.debug @upload.methods

Ok, this should tell me more. Output:

Upload Class: Upload


So, it is the right class but the methods are wrong.

What the heck is going on here? When I create a new Upload object from the console, everything works properly and the methods are all there.

What gives?