Disclaimer: I learned about it yesterday. Woops.
I was building out an email sending feature, and the basic idea was to assign a role to a user th...
For further actions, you may consider blocking this person and/or reporting abuse
ooooh i got a shout out 😍
I don't have all the context of your application but they way I understood, if the role is not updated for some reason, the user will get notified that they have a super power when they not. You should move the check after the role is updated.
Also it's worth the mention that attr_acccessor (Ruby method apidock.com/ruby/Module/attr_accessor) acts as an alias for attr_reader and attr_writer methods, both options will work for this case.
Examples:
Hope this makes it clear, since the line about why you use attr_accessor can be misleading.
Good writing, thanks for sharing.
Gotcha, thanks for that. I updated my article to clarify my point.
And yeah, good point about the email sending even if the role is not properly updated.
Thanks for reading!
There is a typo mistake.
should be
Fixed, thanks!
btw where did you asked for help ? it a rails slack ?