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
I already saw a ticket about belongs_to assignment auto saving the record, but this seems to happen when any association is assigned.
Our dynamoid models double as both serializable and display object. However, if we create a model on the fly and assign associations to it, that model is auto saved, though we don't want it to be.
In the example below, if i don't create the position associations, then the "widget" is not persisted. If I do, it is. This is a big issue for us, as it definitely affects performance, but also makes our dynamoid models not very reusable.
Thanks for the help on this!
eg:
widgets = ArchiveLoader.get_all_widgets;
if widgets
widgets.each do |w|
widget = Display::Widgets::Base.create(:name => w.name)
w.positions.each do |pos|
#widget and position are auto saved with this line
position = widget.positions.create(:module => pos.module)
end
result << widget
end
end
end
The text was updated successfully, but these errors were encountered:
Hey guys,
I already saw a ticket about belongs_to assignment auto saving the record, but this seems to happen when any association is assigned.
Our dynamoid models double as both serializable and display object. However, if we create a model on the fly and assign associations to it, that model is auto saved, though we don't want it to be.
In the example below, if i don't create the position associations, then the "widget" is not persisted. If I do, it is. This is a big issue for us, as it definitely affects performance, but also makes our dynamoid models not very reusable.
Thanks for the help on this!
eg:
The text was updated successfully, but these errors were encountered: