I have models/controllers Class Facility has_many :facilities_services, :dependent => :delete_all Class Service has_many :facilities_services, :dependent => :delete_all Class FacilitiesServices belongs_to :facility belongs_to :service so in my test/functional/facilities_controller_test.rb, I have post :destroy, :id => 5 which tosses an error... test_destroy(FacilitiesControllerTest): NameError: uninitialized constant Facility::FacilitiesService /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:477:in `const_missing'' (eval):1:in `configure_dependency_for_has_many'' Is this because the Model for the join table should have been, FacilitiesService ? Craig --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Yes. Looks that way. On May 28, 1:30 pm, Craig White <craigwh...-BQ75lA0ptkhBDgjK7y7TUQ@public.gmane.org> wrote:> I have models/controllers > > Class Facility > has_many :facilities_services, :dependent => :delete_all > > Class Service > has_many :facilities_services, :dependent => :delete_all > > Class FacilitiesServices > belongs_to :facility > belongs_to :service > > so in my test/functional/facilities_controller_test.rb, I have > > post :destroy, :id => 5 > > which tosses an error... > > test_destroy(FacilitiesControllerTest): > NameError: uninitialized constant Facility::FacilitiesService > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:477:in `const_missing'' > (eval):1:in `configure_dependency_for_has_many'' > > Is this because the Model for the join table should have been, > FacilitiesService ? > > Craig--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Craig White
2008-May-28 18:51 UTC
Re: ****[Rails] Re: functional testing joins table problem
On Wed, 2008-05-28 at 11:37 -0700, JDevine wrote:> Yes. Looks that way. > > On May 28, 1:30 pm, Craig White <craigwh...-BQ75lA0ptkhBDgjK7y7TUQ@public.gmane.org> wrote: > > I have models/controllers > > > > Class Facility > > has_many :facilities_services, :dependent => :delete_all > > > > Class Service > > has_many :facilities_services, :dependent => :delete_all > > > > Class FacilitiesServices > > belongs_to :facility > > belongs_to :service > > > > so in my test/functional/facilities_controller_test.rb, I have > > > > post :destroy, :id => 5 > > > > which tosses an error... > > > > test_destroy(FacilitiesControllerTest): > > NameError: uninitialized constant Facility::FacilitiesService > > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:477:in `const_missing'' > > (eval):1:in `configure_dependency_for_has_many'' > > > > Is this because the Model for the join table should have been, > > FacilitiesService ?---- yup...thank heavens for sed Thanks Craig --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---