[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Polite Strings

David Pollak

7/27/2006 11:54:00 PM

Do you have ActiveRecord classes that contain strings?

Do you sometimes put strings into those classes that are too wide for
the database column?

Is it really suboptimal when you get a SQL error when you .save the object?

Are there string columns that you'd like to convert to lower case
before they're stored in the database?

What you need is Polite Strings.
http://d.../dppsrubyplayground/show/Poli...

Polite Strings is a module that you can add to your ActiveRecord
classes. Polite Strings will make sure strings don't overflow the
column widths in the database (you can disable this function on a
field-by-field basis). Polite Strings will optionally convert a
column to lower case. Polite Strings will optionally convert bytes in
your strings that have the high bit set to spaces (thus avoiding
problems with older versions of PostgreSQL.)

--
--------
David Pollak's Ruby Playground
http://d...

1 Answer

Ab Cd

7/28/2006 4:07:00 AM

0

David Pollak wrote:
> Do you have ActiveRecord classes that contain strings?
>
> Do you sometimes put strings into those classes that are too wide for
> the database column?
>
> Is it really suboptimal when you get a SQL error when you .save the
> object?
>
> Are there string columns that you'd like to convert to lower case
> before they're stored in the database?

Do you like to ask rhetorical questions?

--
Posted via http://www.ruby-....