Skip to content

Commit 9bf4b9c

Browse files
committed
typecast timestamps with .to_time
1 parent 29ab73e commit 9bf4b9c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/activerecord-postgres-array/string.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ def from_postgres_array(base_type = :string)
3232
elements.collect(&:to_f)
3333
elsif base_type == :integer || base_type == :bigint
3434
elements.collect(&:to_i)
35+
elsif base_type == :timestamp
36+
elements.collect(&:to_time)
3537
else
3638
elements
3739
end

0 commit comments

Comments
 (0)