MVC interplay to query multiple models

I’m trying to track down why I’m getting close to desired output, but
not
quite. It looks like the webpage sorta-kinda is grabbing the right
data. For instance, there are three Login objects which should be
showing and it looks like the show is grabbing three objects, so that
fits, to a degree. However, it’s just grabbing the hexadecimal object
id, and not displaying the corresponding fields.

How can I get the view to give more meaningful information?

Viewing the source of
http://localhost:3000/calls/show/1
shows:

####

which correlates with:

thufir@arrakis ~/goodfellow-tool $
thufir@arrakis ~/goodfellow-tool $ cat -n app/views/calls/show.rhtml |
head -n 8 | tail -n 1
8

<%= @call.report %>


thufir@arrakis ~/goodfellow-tool $
thufir@arrakis ~/goodfellow-tool $ cat app/models/call.rb
class Call < ActiveRecord::Base
belongs_to :login

    def report
            Call.find(:all, :include => [:login, :login])
    end

end
thufir@arrakis ~/goodfellow-tool $

And mongrel reports:

Processing CallsController#show (for 127.0.0.1 at 2008-02-08 22:58:53)
[GET]
Session ID: fd47ae8903e9f82697145c71e7b3d43d
Parameters: {“action”=>“show”, “id”=>“1”, “controller”=>“calls”}
Call Load (0.001115) SELECT * FROM calls WHERE (calls.“id” = 1)
Rendering within layouts/calls
Rendering calls/show
Call Load Including Associations (0.002511) SELECT calls.“id” AS
t0_r0, calls.“login_id” AS t0_r1, calls.“created_at” AS t0_r2,
calls.“comment” AS t0_r3, logins.“id” AS t1_r0, logins.“login” AS t1_r1,
logins.“employee_id” AS t1_r2 FROM calls LEFT OUTER JOIN logins ON
logins.id = calls.login_id
Completed in 0.08172 (12 reqs/sec) | Rendering: 0.03247 (39%) | DB:
0.00363 (4%) | 200 OK [http://localhost/calls/show/1]

which certainly looks to be close to the desired output:

thufir@arrakis ~/goodfellow-tool $ sqlite3 db/development.sqlite3
SQLite version 3.4.1
Enter “.help” for instructions
sqlite> SELECT calls.“id” AS t0_r0, calls.“login_id” AS t0_r1,
calls.“created_at” AS t0_r2, calls.“comment” AS t0_r3, logins.“id” AS
t1_r0, logins.“login” AS t1_r1, logins.“employee_id” AS t1_r2 FROM calls
LEFT OUTER JOIN logins ON logins.id = calls.login_id ;
1|1|2008-02-08 15:12:13|start work|1|0123|1
2|1|2008-02-08 15:12:13|start call|1|0123|1
3|1|2008-02-08 15:12:13|start break|1|0123|1
4|2|2008-02-08 15:12:13|start work|2|1234|1
sqlite> .quit
thufir@arrakis ~/goodfellow-tool $

Which looks like it’s just joining the data, and then, what I really
want, is a subset of the above query, where
calls.login_id==logins.login,
and then print most every non-id field for that row of the “answer”
table
(the above table).

thanks,

Thufir