I expected that if I specify the :select option inside a find
tag, it will always be respected; but apparently, if also specify
conditions which rely on an 'included' model, it just does a select
*:
?> Comment.first(:select => 'comments.*', :conditions
=> "users.first_name = 'Arash'", :include => :user) Comment
Load Including Associations (0.9ms) SELECT
comments.id AS t0_r0,
comments.comment AS t0_r1,
comments.owner_table AS t0_r2,
comments.owner_id AS t0_r3,
comments.user_id AS t0_r4,
comments.status_id AS t0_r5,
comments.deleted AS t0_r6,
comments.created_at AS t0_r7,
comments.updated_at AS t0_r8,
users.id AS t1_r0,
users.account_name AS t1_r1,
users.first_name AS t1_r2,
users.last_name AS t1_r3,
users.email AS t1_r4,
users.deleted AS t1_r8,
users.created_at AS t1_r9,
users.updated_at AS t1_r10 FROM
comments LEFT OUTER JOIN users ON
users.id = comments.user_id AND
users.deleted = 0 WHERE ((
users.first_name = 'Arash' ) AND
comments.deleted = 0) LIMIT 1
The occurs in rails 2.3.4