Tuesday, 28 October 2014

rescue InvalidTextRepresentation ActiveRecord::StatementInvalid

def partner_exist(id)
begin
Partner.find(id)
rescue PG::InvalidTextRepresentation
rescue ActiveRecord::StatementInvalid
false
end
end
view raw gistfile1.rb hosted with ❤ by GitHub

No comments:

Post a Comment