[ANN] Polite Strings

Discussion in 'Ruby' started by David Pollak, Jul 28, 2006.

  1. David Pollak

    David Pollak Guest

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

    --
    --------
    David Pollak's Ruby Playground
    http://dppruby.com
     
    David Pollak, Jul 28, 2006
    #1
    1. Advertising

  2. David Pollak

    Ab Cd Guest

    Re: Polite Strings

    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/.
     
    Ab Cd, Jul 28, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kurt Krueckeberg
    Replies:
    2
    Views:
    730
    =?ISO-8859-1?Q?Ney_Andr=E9_de_Mello_Zunino?=
    Nov 17, 2004
  2. Rick

    Comparing strings from within strings

    Rick, Oct 21, 2003, in forum: C Programming
    Replies:
    3
    Views:
    394
    Irrwahn Grausewitz
    Oct 21, 2003
  3. Klaus Neuner
    Replies:
    7
    Views:
    527
    Klaus Neuner
    Jul 26, 2004
  4. Ben

    Strings, Strings and Damned Strings

    Ben, Jun 22, 2006, in forum: C Programming
    Replies:
    14
    Views:
    810
    Malcolm
    Jun 24, 2006
  5. Ian Sedwell

    A matter of being polite

    Ian Sedwell, Sep 7, 2004, in forum: Javascript
    Replies:
    21
    Views:
    237
    Michael Winter
    Sep 8, 2004
Loading...

Share This Page