Active Storage Validations Gem and Active Storage problems in nestted params
gem active_storage_validations 1.0.3
I have two models with "has_one_attached :image", 1 model is created with a form, and the second model is created "after_created callback", when i try to update, the :image for my first model, the validation "attached: true" doesn´t work, the solution that i use is using this line @my_model.image.attach(params[:my_model][:image]) and it works!
But, In my second model, when i try to update the image doing the same logic only works on the first attempt,and the second attempt throws me an error "undefined method 'attachment_reflections' for nil:NilClass", the solution for this and i know is very very very wrong is using puts @my_model.image.attached?.
What am I doing wrong, what errors would it cause in Active Storage and what possible solutions are there?
Thank you for your read my questions and sorry for my bad english )