One of the cool features in
It helps you remove duplication:
However, there is one gotcha which was unclear for me after reading apidock.
When using ActiveRecord associations you have to use block variable to define associations like in example above. So this:
Will not work! However, when using validations, delegations, attr_* it’s not required and you can write this:
with_options, but remember to add block variable when using it for ActiveRecord associations.