You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like it is not possible to insert, update, or save an ActiveModel without selecting it. This can be an issue for big entities (e.g. models with potentially very big BLOBs). It is currently possible using Entity::insert_many and Entity::update_many, but 1. it is kinda unintuitive and 2. these don't trigger the methods in ActiveModelBehavior.
My idea would be implementing methods like ActiveModelTrait::do_{save,insert_update} that do not return the Model, but return an InsertResult or UpdateResult (similar methods could be added to EntityTrait).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It seems like it is not possible to
insert
,update
, orsave
anActiveModel
without selecting it. This can be an issue for big entities (e.g. models with potentially very big BLOBs). It is currently possible usingEntity::insert_many
andEntity::update_many
, but 1. it is kinda unintuitive and 2. these don't trigger the methods inActiveModelBehavior
.My idea would be implementing methods like
ActiveModelTrait::do_{save,insert_update}
that do not return theModel
, but return anInsertResult
orUpdateResult
(similar methods could be added toEntityTrait
).Beta Was this translation helpful? Give feedback.
All reactions