We fully spell out variable names.
In the following case, variable p
is used.
Looking at the code,
it takes the brain a few seconds to decipher
that p
is an instance of model.
validates_format_of :email, with: email_regex,
if: -> (p) { p.email.present? }
Here is the same code with p
fully spelled out.
validates_format_of :email, with: email_regex,
if: -> (patient) { patient.email.present? }