Skip to content

Instantly share code, notes, and snippets.

@hannahwhy
Created November 7, 2011 05:59
Show Gist options
  • Save hannahwhy/1344274 to your computer and use it in GitHub Desktop.
Save hannahwhy/1344274 to your computer and use it in GitHub Desktop.
From ea208c896d471195c16b1ba23836f29642a61b62 Mon Sep 17 00:00:00 2001
From: David Yip <yipdw@northwestern.edu>
Date: Sun, 6 Nov 2011 23:55:06 -0600
Subject: [PATCH] A test case demonstrating that integer[] columns are mapped
to :string.
---
test/postgres_native_type_mapping_test.rb | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/test/postgres_native_type_mapping_test.rb b/test/postgres_native_type_mapping_test.rb
index 4f24aed..2887c92 100644
--- a/test/postgres_native_type_mapping_test.rb
+++ b/test/postgres_native_type_mapping_test.rb
@@ -17,7 +17,8 @@ class CreateNativeTypeMappingTestSchema < ActiveRecord::Migration
bool_should_be_boolean bool,
interval_should_be_string interval,
bigint_should_be_integer bigint,
- uuid_should_be_string uuid
+ uuid_should_be_string uuid,
+ integer_array_should_be_string integer[]
)}
end
@@ -86,4 +87,8 @@ class PostgresNativeTypeMappingTest < Test::Unit::TestCase
def test_bigint_should_be_mapped_to_integer
assert_equal :integer, column_type("bigint_should_be_integer")
end
+
+ def test_integer_array_should_be_mapped_to_string
+ assert_equal :string, column_type("integer_array_should_be_string")
+ end
end
--
1.7.5.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment