We've moved discussions to Discord

_*_ object methods

JP Whitaker
I asked on stack overflow what "_" and "__" designated on methods, I got some vague comment responses, no answers, saying they are naming conventions borrowed from python to designate private methods.

I was wondering if anyone had any additional information.  Are they safe to use?  Only mention I've found in rails docs are here: https://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html where it says:
The callback chain is accessible via the _*_callbacks method on an object.



Screen Shot 2022-08-05 at 12.32.42 AM.png 84.2 KB
JP Whitaker
I asked on stack overflow what "_" and "__" designated on methods, I got some vague comment responses, no answers, saying they are naming conventions borrowed from python to designate private methods.

I was wondering if anyone had any additional information.  Are they safe to use?  Only mention I've found in rails docs are here: https://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html where it says:
The callback chain is accessible via the _*_callbacks method on an object.



Screen Shot 2022-08-05 at 12.32.42 AM.png 84.2 KB
Notifications
You’re not receiving notifications from this thread.
© 2022 Jumpstart Pro by GoRails, LLC