Use builder to initialize related record
Use builder to initialize related record

When automatically creating a related record via delegated attributes prefer the
`build_*` method instead of doing a straight assignment from an instance of the
class of the related object. This ensures relationship constraints are followed.
Without the meta-programming mess this is basically the difference between:

    product.master = Spree::Variant.new

and

    product.build_master

This is important because `Spree::Product.new(price: 0).master.is_master` will return `false` as
the assignment of `price` (a delegated attribute) will cause a new variant to be assigned to master
but that variant won't have the `is_master` flag automatically set.

I believe this is sort of fixed up by `set_master_variants_default`[1] in the case of
products but this is a more general fix. It might be worth investigating if the callback
can be removed. Not causing any real performance issue but had having unnecessary
code hanging around.

1. https://github.com/spree/spree/blob/master/core/app/models/spree/product.rb#L322
odk211/spree,hoanghiep90/spree,brchristian/spree,KMikhaylovCTG/spree,welitonfreitas/spree,piousbox/spree,dafontaine/spree,JDutil/spree,yiqing95/spree,useiichi/spree,wolfieorama/spree,softr8/spree,gautamsawhney/spree,cutefrank/spree,imella/spree,CiscoCloud/spree,raow/spree,JDutil/spree,jasonfb/spree,njerrywerry/spree,FadliKun/spree,vcavallo/spree,CJMrozek/spree,cutefrank/spree,piousbox/spree,calvinl/spree,siddharth28/spree,karlitxo/spree,gregoryrikson/spree-sample,kewaunited/spree,jasonfb/spree,omarsar/spree,lsirivong/spree,jasonfb/spree,robodisco/spree,patdec/spree,vinayvinsol/spree,JDutil/spree,rakibulislam/spree,mindvolt/spree,joanblake/spree,gregoryrikson/spree-sample,brchristian/spree,dafontaine/spree,firman/spree,JuandGirald/spree,vcavallo/spree,ayb/spree,KMikhaylovCTG/spree,jparr/spree,raow/spree,lyzxsc/spree,trigrass2/spree,piousbox/spree,quentinuys/spree,njerrywerry/spree,karlitxo/spree,mindvolt/spree,odk211/spree,quentinuys/spree,zaeznet/spree,patdec/spree,lsirivong/spree,firman/spree,jaspreet21anand/spree,azranel/spree,TimurTarasenko/spree,DarkoP/spree,progsri/spree,priyank-gupta/spree,groundctrl/spree,groundctrl/spree,KMikhaylovCTG/spree,rakibulislam/spree,ahmetabdi/spree,vcavallo/spree,CiscoCloud/spree,Hawaiideveloper/shoppingcart,omarsar/spree,jasonfb/spree,welitonfreitas/spree,edgward/spree,JuandGirald/spree,hoanghiep90/spree,groundctrl/spree,jaspreet21anand/spree,calvinl/spree,ahmetabdi/spree,jimblesm/spree,jimblesm/spree,joanblake/spree,vmatekole/spree,beni55/spree,odk211/spree,patdec/spree,azranel/spree,Hawaiideveloper/shoppingcart,AgilTec/spree,CJMrozek/spree,beni55/spree,FadliKun/spree,piousbox/spree,azranel/spree,gregoryrikson/spree-sample,calvinl/spree,jparr/spree,volpejoaquin/spree,locomotivapro/spree,orenf/spree,grzlus/spree,maybii/spree,locomotivapro/spree,gautamsawhney/spree,KMikhaylovCTG/spree,grzlus/spree,edgward/spree,rajeevriitm/spree,TimurTarasenko/spree,zaeznet/spree,rajeevriitm/spree,jimblesm/spree,AgilTec/spree,CiscoCloud/spree,robodisco/spree,softr8/spree,pulkit21/spree,orenf/spree,edgward/spree,DarkoP/spree,rakibulislam/spree,locomotivapro/spree,priyank-gupta/spree,vcavallo/spree,mleglise/spree,gautamsawhney/spree,robodisco/spree,yiqing95/spree,cutefrank/spree,zaeznet/spree,vinsol/spree,DarkoP/spree,vmatekole/spree,locomotivapro/spree,Hawaiideveloper/shoppingcart,jaspreet21anand/spree,kewaunited/spree,volpejoaquin/spree,zamiang/spree,vinayvinsol/spree,vinsol/spree,siddharth28/spree,quentinuys/spree,quentinuys/spree,beni55/spree,imella/spree,azranel/spree,firman/spree,kewaunited/spree,raow/spree,pulkit21/spree,vmatekole/spree,berkes/spree,grzlus/spree,volpejoaquin/spree,DarkoP/spree,orenf/spree,AgilTec/spree,brchristian/spree,robodisco/spree,volpejoaquin/spree,dafontaine/spree,priyank-gupta/spree,vinayvinsol/spree,cutefrank/spree,JuandGirald/spree,softr8/spree,lyzxsc/spree,useiichi/spree,progsri/spree,shekibobo/spree,rakibulislam/spree,progsri/spree,abhishekjain16/spree,vinsol/spree,maybii/spree,trigrass2/spree,shekibobo/spree,mleglise/spree,lsirivong/spree,yiqing95/spree,TimurTarasenko/spree,trigrass2/spree,AgilTec/spree,omarsar/spree,karlitxo/spree,priyank-gupta/spree,hoanghiep90/spree,beni55/spree,FadliKun/spree,shekibobo/spree,gregoryrikson/spree-sample,JDutil/spree,siddharth28/spree,FadliKun/spree,progsri/spree,JuandGirald/spree,karlitxo/spree,calvinl/spree,njerrywerry/spree,pulkit21/spree,welitonfreitas/spree,gautamsawhney/spree,ayb/spree,CJMrozek/spree,jparr/spree,wolfieorama/spree,lsirivong/spree,raow/spree,rajeevriitm/spree,joanblake/spree,maybii/spree,lyzxsc/spree,shekibobo/spree,mindvolt/spree,zamiang/spree,berkes/spree,jparr/spree,CiscoCloud/spree,useiichi/spree,dafontaine/spree,maybii/spree,grzlus/spree,vinsol/spree,jimblesm/spree,abhishekjain16/spree,trigrass2/spree,kewaunited/spree,TimurTarasenko/spree,jaspreet21anand/spree,orenf/spree,abhishekjain16/spree,mindvolt/spree,berkes/spree,omarsar/spree,imella/spree,patdec/spree,siddharth28/spree,firman/spree,joanblake/spree,brchristian/spree,ahmetabdi/spree,berkes/spree,hoanghiep90/spree,groundctrl/spree,rajeevriitm/spree,njerrywerry/spree,mleglise/spree,ayb/spree,CJMrozek/spree,softr8/spree,pulkit21/spree,ayb/spree,odk211/spree,yiqing95/spree,mleglise/spree,zamiang/spree,wolfieorama/spree,ahmetabdi/spree,zamiang/spree,welitonfreitas/spree,zaeznet/spree,lyzxsc/spree,useiichi/spree,wolfieorama/spree,vinayvinsol/spree,edgward/spree,vmatekole/spree,Hawaiideveloper/shoppingcart,abhishekjain16/spree