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

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -