Do not override initialize This can break a lot of things in your models. IF we knew why you needed us to be able to help better (do not fully understand your explanation of the form, which is the skeleton, you want the attributes of the form to create other attributes, see below). I often use a hook, as Marcel suggested. But if you want this to happen all the time, and not just before creating or saving an object, use the after_initialize hook.
def after_initialize
Also, if you are just looking for some default values, you can provide default access devices, for example: (where some_attribute matches the column name of your model attribute)
def some_attribute attributes[:some_attribute] || "Some Default Value" end
or writer
def some_attribute=(something) attributes[:some_attribute] = something.with_some_changes end
If I understand your comment correctly, it looks like you are revealing a form that will make your model incomplete, and other attributes based on parts of this form? In this case, you can use any of the above methods after_initialize or some_attribute= to then create other attributes in your model.
brad Dec 07 2018-10-14T00: 00Z
source share