These are my models:
class Company < ActiveRecord::Base
has_many :products
end
class Product < ActiveRecord::Base
belongs_to :company
has_many :prices
end
class Price < ActiveRecord::Base
belongs_to :product
end
I defined them in routes as nested resources
resources :companies
namespace :company do
scope ":company_id" do
resources :products do
resources :prices
resources :production_capabilities
end
end
end
I wanted to put controllers and views in catalogs matching that structure
app/controllers/companies_controller.rb
app/controllers/company/products_controller.rb
app/controllers/company/product
app/controllers/company/product/prices_controller.rb
As soon as i create product directory inside company and i try to call
Company.find(1).products
i get
NoMethodError: undefined method 'quoted_table_name' for Company::Product:Module
Does anybody know what am i doing wrong?