On Domingo, 2 de Mayo de 2010 03:41:45 Iñaki Baz Castillo escribió: > Hi, is it possible to automatically 'strip' string values before > storing them into the table? This is: removing the spaces at the > begining and at the end of a string field before saving it. > Now I do it in "before_create_save()" and "before_update_save()", but > it would be great an automatic field property that does automatically > the job.
I think that feature is not used frequently to add it in core. You can do it in your model too, overriding coumn setter: def column=(value) self[column] = value.strip end Also, you can make a plugin to extend ActiveScaffold with that feature. -- Sergio Cambra .:: entreCables S.L. ::. Mariana Pineda 23, 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) [email protected] -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en.
