Ruby on Rails Tuesday, December 26, 2017

On Mon, Dec 25, 2017 at 5:35 PM, André Luiz Abdalla Silveira
<andreluizsa00@gmail.com> wrote:

> But I didn't understand why this doesn't belong to the controller

Business logic doesn't belong in controllers, it belongs in models or
service objects. It's accepted good practice and makes testing much
much easier. Reading up on the MVC pattern would probably be a
good thing too.

> also have a difficulty on describing my problem as a set of tests, since
> it's not completely clear to me the complete set of states of execution my
> app will go through

Writing tests is a way to explore the problem space, it doesn't mean
having a completely architected solution first.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yB0Br4sN0sK%3D4F1T3cCHDDtTpqm97nwNJT90_46NAnB7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment