activerecord-postgres-array
activerecord-postgres-array copied to clipboard
Added support for parsing multi-dimensional array string
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.
Did you get a chance to review this PR?