[ANN] Polite Strings

D

David Pollak

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://dppruby.com/dppsrubyplayground/show/Polite+Strings

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.)
 
A

Ab Cd

David said:
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,190
Latest member
ClayE7480

Latest Threads

Top