Handling namespace models (classes) in namespace

The

models/ns1/articles.rb

is basically setting the table name prefix for all the model classes under that namespace. Thats its use. It’s more DRY’ish to do in there (in a single file), rather than setting the prefix in every model class under that namespace.

I am not a big fan of using namespaces in my models. However you could refer to the following articles to gain a better understanding about using namespaces in modules.

  • Namespaced models and controllers

Some alternatives to using namespaces in models

  • A simple alternative to namespaced models

Hope this helps.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)