Forum: Rails France Problème de dépendence circulaire ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
98872bd7af9f6b8238bfa06d784cf6a7?d=identicon&s=25 Gros Gros (gros)
on 2006-03-01 11:40
Bonjour,

Je suis sous rails 1.0
J'ai l'impression de tomber sur un problème de dépendence circulaire que
je n'arrive pas a résoudre, que faire ? :-)

Voici mes modèles

class Customer < ActiveRecord::Base
  has_and_belongs_to_many :projects
end

class Project < ActiveRecord::Base
  has_and_belongs_to_many :customers
end

Customer.count ne marche et me pond l'erreur suivante:

e:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:207:in
`load'
e:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:207:in
`load'
e:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:39:in
`require_or_load'
e:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:22:in
`depend_on'
e:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:30:in
`associate_with'
e:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:179:in
`require_association'
e:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:179:in
`require_association'
e:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations.rb:780:in
`require_association_class'
e:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations.rb:650:in
`has_and_belongs_to_many_without_reflection'
(eval):5:in `has_and_belongs_to_many'
#{RAILS_ROOT}/app/models/customer.rb:2
#{RAILS_ROOT}/app/views/search/test.rhtml:1
-e:3:in `load'
-e:3
This topic is locked and can not be replied to.