search for: keyword_listings

Displaying 2 results from an estimated 2 matches for "keyword_listings".

2009 May 24
11
Class method not being stubbed
Hi guys. I''m setting an expectation on a class method. For some reason, the method isn''t being stubbed, and the expectation isn''t seeing the call. In KeywordListsController#create, I call the private method #create_keywords_and_associate, which calls AdSenseHeavenParser#parse . Thus, some of my specs set an expectation on AdSenseHeavenParser#parse . However, that
2006 Jun 26
4
has_many :through
...KeywordLink < ActiveRecord::Base belongs_to :keyword belongs_to :listing end the problem is, when i loop through all the @listing.keywords, I get ALL the keyword_links instead of just the keyword_links for that listing. For instance, if my @listing has an ID of 7, I''ll still have keyword_listings with ''listing_id''s of 2, 3, etc. i notice (in the logs) when I loop through @listing.keywords and access keyword_link, AR makes a query of SELECT count(*) AS count_all FROM keyword_links WHERE (keyword_links.keyword_id = 13) obviously missing the listing_id part of the WHERE....