Skip to content

Commit 228c6c0

Browse files
authored
Merge pull request rails#28176 from kamipo/push_valid_type_up_to_abstract_adapter
Push `valid_type?` up to abstract adapter
2 parents 38d05ce + b254886 commit 228c6c0

File tree

4 files changed

+3
-11
lines changed

4 files changed

+3
-11
lines changed

activerecord/lib/active_record/connection_adapters/abstract_adapter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ def arel_visitor # :nodoc:
154154
Arel::Visitors::ToSql.new(self)
155155
end
156156

157-
def valid_type?(type)
158-
false
157+
def valid_type?(type) # :nodoc:
158+
!native_database_types[type].nil?
159159
end
160160

161161
def schema_creation

activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,6 @@ def strict_mode?
648648
self.class.type_cast_config_to_boolean(@config.fetch(:strict, true))
649649
end
650650

651-
def valid_type?(type)
652-
!native_database_types[type].nil?
653-
end
654-
655651
def default_index_type?(index) # :nodoc:
656652
index.using == :btree || super
657653
end

activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,6 @@ def use_insert_returning?
376376
@use_insert_returning
377377
end
378378

379-
def valid_type?(type)
380-
!native_database_types[type].nil?
381-
end
382-
383379
def update_table_definition(table_name, base) #:nodoc:
384380
PostgreSQL::Table.new(table_name, base)
385381
end

activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def supports_index_sort_order?
163163
true
164164
end
165165

166-
def valid_type?(type)
166+
def valid_type?(type) # :nodoc:
167167
true
168168
end
169169

0 commit comments

Comments
 (0)