I'm getting this error when the after_create callback is executed in an activerecord model.
first of all, I have 2 after_create callbacks, one should run for everyone, and the other should only run if the user is a sibling:
# callbacks
after_create :couple_with_role
after_create :enroll_in_plan, :match_to_sibling, if: :is_sibling?
def is_sibling?
roles.include?('sibling')
end
and the error looks like this:
NameError: undefined local variable or method `is_sibling' for //User:0x007ffcae55c618// Did you mean? is_sibling?
What's the correct way to do this?