search for: client_variations

Displaying 3 results from an estimated 3 matches for "client_variations".

2006 May 20
3
Navigation between DB Items with active Record
...without using <find_by_sql> or other ugly tricks. So far, I have managed to do a lot of stuff without it but I decided that I need to learn how it works this weekend! So I need your help to figure that out... I have the following 4 models: class Client < ActiveRecord::Base has_many :client_variations has_many :variations, :through => :client_variations end class ClientVariation < ActiveRecord::Base belongs_to :client belongs_to :variation end class Variation < ActiveRecord::Base belongs_to :concept has_many :client_variations, :dependent => :destroy end class Concept &l...
2006 May 17
0
teardown not cleaning the BD?
Hi, I am a bit confused, I have a few functionnal tests were I add/delete records on top of the ones provided in the fixture and it seems like the records are surviving the teardown. Isnt teardown supposed to be ran after each test? So if I have something like: def teardown Client.delete_all Concept.delete_all Variation.delete_all ClientVariation.delete_all end All the
2006 May 19
1
Need help with a test
Hi, I have this controller method that I need to test: def link_concept_to_client concept_to_link = Concept.find(params[:concept_id]) # take all the variations for the concept for variation in concept_to_link.variations new_client_variation = ClientVariation.new new_client_variation.client = session[:active_client] new_client_variation.variation = variation