Skip to content

Instantly share code, notes, and snippets.

@silentshade
Created February 15, 2015 22:41
Show Gist options
  • Save silentshade/b7fee8f7fb33295bc62b to your computer and use it in GitHub Desktop.
Save silentshade/b7fee8f7fb33295bc62b to your computer and use it in GitHub Desktop.
if args['polygon'].present?
if (num = args['polygon'].match(/^(?:\-)?\d+$/)) && num[0].to_i > 0 && Polygon.exists?(num[0])
event[:polygon_id] = args['polygon']
else
event[:declared_polygon] = args['polygon']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment