behavior

Behaviors

Behaviors are ways to enable the reuse of Model functions. For example, instead of adding our slug creation function into every model, which could be a lot of redundant code, we can create a Behavior to encapsulate the code and add the Behavior to our Model's initialize(), just like the Timestamp Behavior.