From 2af2d6b0571fb10d165ad60395b43d86d8cb34c0 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Mon, 25 Apr 2016 23:35:36 +0530 Subject: Dont simply assume a type is a valid database type. This is only always true in the case of sqlite. Others adapters need to perform a check for validity. Add coverage for mysql2 db type validation --- .../lib/active_record/connection_adapters/abstract_adapter.rb | 2 +- activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index 86de8f1ca0..373c082f65 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -154,7 +154,7 @@ module ActiveRecord end def valid_type?(type) - true + false end def schema_creation diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb index 1d7ce92b29..e3793e6c77 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb @@ -154,6 +154,10 @@ module ActiveRecord true end + def valid_type?(type) + true + end + # Returns 62. SQLite supports index names up to 64 # characters. The rest is used by rails internally to perform # temporary rename operations -- cgit v1.2.3