As it happens, I have a rack middleware plugin that does something
similar for request attributes. Waiting for my laptop to be repaired
so u can push it as a gem.

I like having both in place as there are times the data comes from say
a file, a socket, etc where I don't want to duplicate the trimming
logic for each case. Having it the model is my safety net :)

FWIW, I've never encountered a scenario that called for leading/
trailing spaces to be preserved though I could probably think of some,
I can also think of better ways to represent the significance if them.

On Oct 13, 7:59 am, Ashley Moran <[email protected]>
wrote:
> On 12 Oct 2009, at 21:19, Simon Harris wrote:
>
> > Have you tried my dm-trimmer plugin? 
> > Http://github.com/harukizaemon/dm-trimmer
>
> Simon/Tony
>
> This is a recurrent problem in webapps.  Browsers don't (and can't)  
> distinguish between a missing field and a blank string field.  I have  
> a gut feeling the data should be cleansed at the controller level.  
> But wherever, this is, IMHO, not an ORM problem, but a web framework  
> one.
>
> Any thoughts on how a good solution may be implemented?
>
> Ashley
>
> --http://www.patchspace.co.uk/http://www.linkedin.com/in/ashleymoranhttp://aviewfromafar.net/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to