Displaying 1 result from an estimated 1 matches for "update_product_nam".
Did you mean:
update_product_name
2009 Jan 13
9
Updating multiple databases at the same time
...as the master. This works fine, but there
are a few situations where I need all databases to update in real-time.
What would be the best way to achieve this in rails?
Here is an example of what I am trying to do. I want to update the name
of a product on my website. Here is the controller:
def update_product_name
product = Product.find(params[:id])
product.name = params[:name]
product.save
#Say I want to save this to 3 other databases
#can I do this with activerecord?
#PSUEDO CODE... I know it cant do this
product.save(mysql_host2)
product.save(mysql_host3)
product.save(mysql_host4)
end...