Class: DataMapper::Property::PgArray

Inherits:
Object
  • Object
show all
Defined in:
lib/dm-pg-types/pg_array.rb

Direct Known Subclasses

DecimalArray, StringArray

Instance Method Summary collapse

Instance Method Details

#dump(value) ⇒ Object



11
12
13
# File 'lib/dm-pg-types/pg_array.rb', line 11

def dump(value)
  "{#{CSV.generate_line(value, :row_sep => '')}}" if value
end

#load(value) ⇒ Object



7
8
9
# File 'lib/dm-pg-types/pg_array.rb', line 7

def load(value)
  CSV.parse_line(value.gsub(/[{}]/,'')) || [] if value
end