Displaying 2 results from an estimated 2 matches for "air_canada".
2006 May 20
3
Navigation between DB Items with active Record
...t
has_many :client_variations, :dependent => :destroy
end
class Concept < ActiveRecord::Base
has_many :variations, :order =>"id", :dependent => :destroy
end
How can I get one of the Concept record associated with a specific
Client? So far I have this:
temp = clients(:air_canada).variations.concept.find(:all, limit => 1)
But I get this error:
NoMethodError: undefined method `concept'' for Variation:Class
Any help would be great because I am tired to hacking AR by using SQL
calls..
Thanks!
--
Posted via http://www.ruby-forum.com/.
2006 May 19
1
Need help with a test
...= "nom de la variation"
new_variation.description = "name of the variation"
new_variation.concept_id = new_concept.id
new_variation.save
#link it to the client
get :link_concept_to_client, {:concept_id => new_concept.id},
{:active_client => clients(:air_canada)}
#there should now be a client_variation for the variation
assert_not_nil
ClientVariation.find_by_variation_id(new_variation.id)
assert_equal new_variation.name_fr, (ClientVariation.find_by_name_fr
new_variation.name_fr).name_fr
end
Sorry for the blooted code, I had to decompose...