I wrote a rails application that follows the usual directory structure (model code in models, controller code in controllers).
But now I'm working on a new function, and for this I wrote a few (what I would call) "service" code.
A new feature is to import some data into the system, at the moment these are two classes for import, but can expand to more.
I do not believe that the new code belongs to the model, because it does not model any object (it is not directly connected to any object. I, of course, do not think that this belongs to the controller, since this is not presentation logic.
So, I created the "application / service" directory and placed it there. I also created the "test / services" directory, where I put my tests.
Everything is good and good, what I thought, but when I run "rake: test" or "autotest", my tests of new services are not executed.
Now I expect that there is a way to make the rake pick them up, but is it a warning flag that I did something wrong?
Is there another place the code should live in, or am I somehow not doing the "Rails path"?
As a rule, whenever I came across such a problem, before I discovered that the rails already have a solution, but I did not know about this agreement. Is this one of these cases?
ruby ruby-on-rails rake
Darren Greaves Nov 12 '08 at 20:02 2008-11-12 20:02
source share