Intention of SOLID principle is to make better code and more testable code. Here’s how.
In a shipping class example,
Now these can be wrapped by methods.
Liskoff Substitution Principle
Derived classes must be substitutable for their base classes
- Dependency inversion
- Open Closed
- Interface Segregation
“I’m not a great programmer; I’m just a good programmer with great habits” —Kent Beck
SOLID principles help you acquire great habits. @sebasoga
Question: Any of these principles good for testing ActiveRecord models?
Answer: Only have your model info specific to database (scopes, etc). Business logic put into different classes.