Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [ANN] Polite Strings

Reply
Thread Tools

[ANN] Polite Strings

 
 
David Pollak
Guest
Posts: n/a
 
      07-27-2006
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/dppsrubyplaygroun...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.)

--
--------
David Pollak's Ruby Playground
http://dppruby.com

 
Reply With Quote
 
 
 
 
Ab Cd
Guest
Posts: n/a
 
      07-28-2006
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-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strings, Strings and Damned Strings Ben C Programming 14 06-24-2006 05:09 AM
Catching std::strings and c-style strings at once Kurt Krueckeberg C++ 2 11-17-2004 03:53 AM
A matter of being polite Ian Sedwell Javascript 21 09-08-2004 07:28 AM
Polite and honest robot wisefool Computer Support 3 01-23-2004 09:02 AM
Comparing strings from within strings Rick C Programming 3 10-21-2003 09:10 AM



Advertisments