I have a model and the model has several attributes. What I want to do is to turn one of the boolean attributes to true based on other attributes.
Let's say we have a model called User and user has attributes like..
- id (int)
- name (text)
- birthday (date)
- legal_age (boolean)
I was asked to change legal age attribute, based on birthday. (If user were 20 years old turn it true, if not, keep it false.) I named the function as check_legal_age, because it checks legal age column to true.
However, one of my colleagues advised me that the name is too vague and hard to figure out what the function does and what kind of value does the function returns.
After some conversation, I decided to name the function as make_legal_age_true, a wordy but straight-forward name. The colleague also suggested me to name trufy_legal_age
Is there a conventional way to name a method like this that makes the intentions clear to others reading the code?