Updates to an ActiveResource model

I have a front end Rails 2.1 app which makes ActiveResource model calls to an ActiveRecord back end. When I edit a record, and save - the backend is calling create rather than update. Any thoughts on where I should investigate the cause?

== front end == [Query model]

class Query < ActiveResource::Base   self.site = ENV["AR_SITE"]

  def update_attributes(attributes)     self.attributes = attributes     save   end

end

[Query controller] # PUT /queries/1   # PUT /queries/1.xml   def update     @query = Query.find(params[:id])     logger.info @query.new?.to_s     respond_to do |format|       if @query.update_attributes(params[:query])         flash[:notice] = 'Query was successfully updated.'         format.html { redirect_to(@query) }         format.xml { head :ok }       else         format.html { render :action => "edit" }         format.xml { render :xml => @query.errors, :status => :unprocessable_entity }       end     end   end

[log] Rendering queries/edit Completed in 0.20789 (4 reqs/sec) | Rendering: 0.00468 (2%) | DB: 0.00000 (0%) | 200 OK [http://localhost/queries/25/edit\]

Processing QueriesController#update (for 127.0.0.1 at 2008-08-05 10:29:03) [PUT]   Session ID: BAh7BzoMY3NyZl9pZCIlNzI2YjkxOWFiM2VhM2U4NDU4NTIzZDdlNmUyZTFm ZGMiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh c2h7AAY6CkB1c2VkewA=--61d650921b3c0ce3c4165301c271771ef873f8eb   Parameters: {"commit"=>"Update", "authenticity_token"=>"e1303142494a26327be638a323ce4b1c7a13a78b", "_method"=>"put", "action"=>"update", "id"=>"25", "controller"=>"queries", "query"=>{"query_type_id"=>"1", "query_string_id"=>"1", "comment"=>"updated at 10:28", "query_status_id"=>"1"}} false {ie query id 25 exists already} Redirected to http://localhost:3000/queries/26 Completed in 0.25446 (3 reqs/sec) | DB: 0.00000 (0%) | 302 Found [http://localhost/queries/25\]

== back end == Processing QueriesController#show (for 127.0.0.1 at 2008-08-05 10:29:03) [GET]   Session ID: 72d6d6a58c3fb2234fc134e6f4efc25c   Parameters: {"format"=>"xml", "action"=>"show", "id"=>"25", "controller"=>"queries"}   Query Load (0.000559) SELECT * FROM "queries" WHERE ("queries"."id" = 25) Completed in 0.01947 (51 reqs/sec) | Rendering: 0.00015 (0%) | DB: 0.00056 (2%) | 200 OK [http://localhost/queries/25.xml\]

Processing QueriesController#create (for 127.0.0.1 at 2008-08-05 10:29:04) [POST]   Session ID: 25abed8e86dd5cbc7810ed9cc3b3d33a   Parameters: {"format"=>"xml", "action"=>"create", "controller"=>"queries", "query"=>{"query_type_id"=>"1", "query_string_id"=>"1", "comment"=>"updated at 10:28", "query_status_id"=>"1"}}   Query Create (0.000358) INSERT INTO "queries" ("updated_at", "query_type_id", "query_string_id", "comment", "query_status_id", "created_at") VALUES('2008-08-05 09:29:04', 1, 1, 'updated at 10:28', 1, '2008-08-05 09:29:04') Completed in 0.02947 (33 reqs/sec) | Rendering: 0.00243 (8%) | DB: 0.00036 (1%) | 201 Created [http://localhost/queries.xml\]