ActiveRecord handle timestamps doing something like this:
- Inserting data? created_at is defined
- Updating data? updated_at is redefined
How would I do it using SORM?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
At a first glance something like this could work:
But then how would you create those artist instances from scratch? Should those date fields be assigned with messy
nulls or null-ish date values or should they maybe get wrapped inOptions? Well, either of those should solve the problem, but here is another option:I gotta tell you the whole problem doesn’t feel very natural to me. I can’t imagine scenarios where that kinda behaviour would be benefitial. But then again I’ve presented you the options.