activerecord-postgres-array icon indicating copy to clipboard operation
activerecord-postgres-array copied to clipboard

Added support for parsing multi-dimensional array string

Open saurabhnanda opened this issue 12 years ago • 1 comments

Added support for parsing multi-dimensional array strings

  • Used the Sequel::Postgres::PGArray::Parser class from https://github.com/jeremyevans/sequel/blob/master/lib/sequel/extensions/pg_array.rb (MIT licensed code)
  • The saner method to parse multi-dimensional array-strings is to NOT use regexps and use some sort of parser instead
  • Changed String.valid_postgres_array? to use constants instead of variables to define the regexps
  • Converting timestamps to current Rails timezone using in_time_zone
  • Removed String.valid_postgres_array? because there is no easy way to validate array-string using Regexps alone. One will have to parse the string into an array to check if it's valid -- a task that the PG database would anyways do.

saurabhnanda avatar Aug 11 '13 07:08 saurabhnanda

Did you get a chance to review this PR?

saurabhnanda avatar Aug 12 '13 11:08 saurabhnanda