diff options
author | Andrew White <pixeltrix@users.noreply.github.com> | 2017-02-26 12:08:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-26 12:08:01 +0000 |
commit | 228c6c07f1b5e786c72d9e30b2755d764f7a425d (patch) | |
tree | 981c086a9e1c52a1ba449c79c1b660e16da67990 | |
parent | 38d05cee5342094bba0ef17d25f5cf5d0eccfbb5 (diff) | |
parent | b2548869bc6a30a19a992b7a29f07868e1359985 (diff) | |
download | rails-228c6c07f1b5e786c72d9e30b2755d764f7a425d.tar.gz rails-228c6c07f1b5e786c72d9e30b2755d764f7a425d.tar.bz2 rails-228c6c07f1b5e786c72d9e30b2755d764f7a425d.zip |
Merge pull request #28176 from kamipo/push_valid_type_up_to_abstract_adapter
Push `valid_type?` up to abstract adapter
4 files changed, 3 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index 24007db8f0..5e3b8fd393 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -154,8 +154,8 @@ module ActiveRecord Arel::Visitors::ToSql.new(self) end - def valid_type?(type) - false + def valid_type?(type) # :nodoc: + !native_database_types[type].nil? end def schema_creation diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index f14ac92cf9..21a547bab2 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -648,10 +648,6 @@ module ActiveRecord self.class.type_cast_config_to_boolean(@config.fetch(:strict, true)) end - def valid_type?(type) - !native_database_types[type].nil? - end - def default_index_type?(index) # :nodoc: index.using == :btree || super end diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index c89e29ba44..6c59bd9a15 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -376,10 +376,6 @@ module ActiveRecord @use_insert_returning end - def valid_type?(type) - !native_database_types[type].nil? - end - def update_table_definition(table_name, base) #:nodoc: PostgreSQL::Table.new(table_name, base) end diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb index f55efe7d07..221445dd3b 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb @@ -163,7 +163,7 @@ module ActiveRecord true end - def valid_type?(type) + def valid_type?(type) # :nodoc: true end |