I have two models in namespace project
like this: class Project::Foo
and class Project::Bar
They have this relationship
in app/models/project/foo.rb
has_many :bars
in app/models/project/bar.rb
belongs_to :foo
However when I want to call Project::Foo.create(...)
or even Project::Bar.create(...)
I get a NameError
with uninitialized constant Foo
or Bar
respectively.
Do I need to put something like this in the models? belongs_to :project::foo
? or how do I fix this?
EDIT
in app/models/project/foo.rb
now reads:
module Project
class Foo
has_many :bars
end
end
and bars has the same structure but with the belongs_to
in it
I still get the same error