Ruby Ohm: do not raise unique index violation, just return false -


When I try to save a unique feature, it generates an error if the feature is not unique Is there any way that instead of raising the error, just false change can be returned?

This is the type of code I want, but if a domain is not unique, then it raises an error, so it's never other section:

  domain = domain.new (: domain = & gt; root_domain) if domain ) Finally use the Ruby Rescue:  

  Domain.save Domain Rescue Om: UIINDEXExIllation Returns False and  

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -