Relative Content

Tag Archive for model

Convention on model names in ruby on rails

I was doing my ER diagram for a rails application I’m about to begin with and there I have an entity called Class News so I’d have a model ClassNew but I don’t know if I will have problems in the future with the New part or what would be the right way to do this o how should I call the model? since the right thing would be ClassNews and the table should be class_news

Achieving decoupling in Model classes

I am trying to test-drive (or at least write unit tests) my Model classes but I noticed that my classes end up being too coupled. Since I can’t break this coupling, writing unit tests is becoming harder and harder.

How to create view models – Constructor, Factory Method, …?

I’m trying to lead a charge for re factoring our rather bloated controllers.
We currently have a BaseModel from which all our other models inherit. The BaseModel contains things common to all pages, such as the page title, css files needed, current user.

Is it ‘safe’ to expect myClasses to agree not to only call package Scope methods from other Package scope methods?

The questions says it all, but a quick overview of the situation. I’m creating a Model which contains classes (all inherriting myObject) which have a large amount of interconnection. I want the controller to be able to create any of these objects any time, without modifying the Model. Only an explicit cal to the model to “AddToModel” would ‘install’ the object into the model (including updating all the connected objects). myObjects will use a factory pattern, if a user tries to create something already represented in the Model the already-instanced object in the model will be returned instead of constructing a new one.