Displaying 1 result from an estimated 1 matches for "uservote".
Did you mean:
user_vote
2006 May 13
4
undesireable lazy loading
Hi,
My work with Rails has been fairly straightforward, until yesterday...
I''ve encountered rather a peculiar problem that I''m not able to solve
myself as a rails-newbie.
The model code looks like this:
class Link < ActiveRecord::Base
has_one :user_vote
end
class UserVote < ActiveRecord::Base
belongs_to :user
belongs_to :link
end
I have a SQL query that is responsible for pulling out all links along
with votes from a database:
links = Link.find_by_sql(
["SELECT * FROM links LEFT JOIN user_votes ON links.id =
user_votes.link_id" +
" AND...