aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/cast.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/cast.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb b/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb
index acc4cdc9e8..a865c5c310 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb
@@ -3,7 +3,11 @@ module ActiveRecord
module PostgreSQL
module Cast # :nodoc:
def point_to_string(point) # :nodoc:
- "(#{point[0]},#{point[1]})"
+ "(#{number_for_point(point[0])},#{number_for_point(point[1])})"
+ end
+
+ def number_for_point(number)
+ number.to_s.gsub(/\.0$/, '')
end
def hstore_to_string(object, array_member = false) # :nodoc: