Rails Best Practices 2: Move logic to model

Today we continue our analysis of the Rails Best Practices. In the previous post we saw Named Scope, Model Association and Following the same direction, in today’s post we’ll examine the use of Callback Model and Virtual Attribute.1. Virtual AttributeSuppose we have a customers list table defined as follows123456create_table "clients", ...

Read more