Quote:
Originally Posted by gaming_mouse
no no no no no.
you should NEVER have to do any of this, that's the point. if you're unit testing your domain code you should never have to think about or load rails or a database or any other nonsense.
and business logic doesn't belong in AR models. i'd say this is the primary sin of doing things the standard rails way. people went from fat controllers to fat AR models and felt all good about themselves, but fat AR models are almost as wrong as fat controllers.
Every software architecture is wrong in the long run. There's nothing necessarily wrong with fat controllers or fat models or whatever - just do what makes sense for your application and your (and your colleagues') level of expertise. "Business logic" is also not a well-defined phrase.
Anyway, I mostly wanted to highlight what doesn't constitute as learning and becoming a better programmer. If you want to become a better programmer, you have to get better at understanding and more importantly, utilizing at a high level, fundamental computational concepts, like functions, closures, promises/futures, actors, monads, type classes, semaphores, trees, graphs, parsers, compilers, unification, public-key cryptography, paging, garbage collection, heap allocation, memory hierarchy, etc. Learning new things helps, getting better what you already know is even better.
Learning frameworks and architectural fads, or in some cases, just learning how to structure boilerplate code that does nothing, may situationally make you more productive - and maybe that's all you care about - but won't have an impact 5-10 years down the road. In most cases, after enough time, you will be harder to work with and less desirable as a new hire you've accumulated more opinions than knowledge, many of which will be unpopular in the future.