In ohm when I try to save a unique attribute it raises an error if the attribute is not unique. Is there a way to have it simply return false instead of raising the error?
This is the type of code I want, but it raises an error if the domain is not unique, so it never reaches the else
clause:
domain = Domain.new(:domain => root_domain)
if domain.save
return domain
else
return Domain.with(:domain => root_domain)
end