mardi 28 juin 2016

Having a module class with the same name as a top level class: 'expected module_classe_file to define top_level class'

My apps/model folder looks like that:

models/
  module/
    category.rb
  category.rb

But I can't seem to find a way to correctly autoload module/category: I always have the error Expected /app/models/module/category.rb to define Category.

As of now I only see two options: not adding it to autoloading, or renaming module/category.rb to module/module_category.rb, neither seems like a good idea

Aucun commentaire:

Enregistrer un commentaire