Martin Tithonium (tithonium) wrote,
Martin Tithonium
tithonium

Didn't finish the submission pipeline. Got sidetracked by cleaning up some problems with the new mixed real/virtual countries and states. A particular issue is when you have a country 'code' that's numbers. .find() treats that as an ID and looks up the database entry, rather than looking up by code. So, I had to switch from calling the super-smart .find to calling .find_by_code directly. Ah well.
Added .valid? to country and state, to simplify submission validation.
Stripped out Iconv, and now do my own accented-latin deaccentation. Had to use hex codes, because - again - ruby didn't like (which is to say, barfed on) some of the accented characters when the source was stored in latin1.

BUT. I can now submit the form, get back an .inspect of the to-be-created location object, as well as validation - with error messages - of the country and state.
There's some more validation to put in, plus I want to make sure I don't make it difficult for myself to later put in a preview step ('cause, frankly, I've had some crappy submissions that would have been much better if only they'd seen what they were about to send me. here's a hint: if you paste html for an iframe into the url field, I'm just going to reject your entry without trying to sort out what you were really trying to send me).


Thinking ahead to after I get all this stuff done, recreating the system as it is, I am actually beginning to look forward to some of the improvements I want to add. Like the submission preview, handling of non-google urls, providing non-google displays (if and where possible), showing nearby sites on the same map, showing all sites from a given submitter, being able to edit existing entries using the same UI as approval...



My wrists hurt. My jaw still hurts (interesting point: I'm pretty sure what's still hurting are the injection points for the local. I'll have to talk to the dentist about that.)

Sleep now.
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 2 comments