I am trying to insert a set of data into a junction. I want to be able to set the default set of products to every new merchant that is created, then the merchant will have options to set their prices availability etc based on their needs.
I have the current method define
def add_products
@product = Product.all
@product.each do |product|
@merchant = MerchantProducts.create!(product_id: product.id, merchant_id: self.id)
end
end
problem I am getting is the below
uninitialized constant Merchant::MerchantProducts