Currently for the composition plugin, if you set a composed argument, it
will not get decomposed until before_validation:
def before_validation
# decomposer_method is private
@compositions.keys.each{|n| send(model.compositions[n][:decomposer_method])}
if @compositions
super
end
Any reason this is hard coded in place?
If you use FactoryBot for instance, and you want to do build(:record_name),
the composed fields will not be decomposed into their attributes unless you
just randomly run "valid?" on it.
Seems like there should be a way to call it ahead of time if needed or
change where it happens.
Maybe a "decompose_compositions" function that one could call directly?
Aryk
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/1a8d58d2-c5a4-4c19-9f38-5c45d0f7ba96o%40googlegroups.com.