I’m wanting to initialize an ActiveRecord object.
I understand that there is a method called after_initialize that appears
to get called right after the ActiveRecord object is instantiated.
Is after_initialize a Ruby thing or a Rails thing?
Where is after_initialize documented?
Can I pass parameters to it? If so, how?
I want to initialize the “belongs_to” attribute of my new ActiveRecord
object but can’t figure out how to do it.
Should I just write a standalone public (!) method that will take
whatever parameters I need to set on my new object and then call this
method after my call to Object.new? (I’m not calling Object.create so
before_save is not useful to me here).
In general, what is the best way to perform custom initialization on an