1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #24731 from vipulnsward/database-type

Change valid_type? from abstract adapter
This commit is contained in:
Sean Griffin 2016-04-25 14:05:40 -06:00
commit 831a277d49
3 changed files with 16 additions and 1 deletions

View file

@ -154,7 +154,7 @@ module ActiveRecord
end end
def valid_type?(type) def valid_type?(type)
true false
end end
def schema_creation def schema_creation

View file

@ -154,6 +154,10 @@ module ActiveRecord
true true
end end
def valid_type?(type)
true
end
# Returns 62. SQLite supports index names up to 64 # Returns 62. SQLite supports index names up to 64
# characters. The rest is used by rails internally to perform # characters. The rest is used by rails internally to perform
# temporary rename operations # temporary rename operations

View file

@ -17,6 +17,17 @@ class Mysql2AdapterTest < ActiveRecord::Mysql2TestCase
end end
end end
def test_valid_column
with_example_table do
column = @conn.columns('ex').find { |col| col.name == 'id' }
assert @conn.valid_type?(column.type)
end
end
def test_invalid_column
assert_not @conn.valid_type?(:foobar)
end
def test_columns_for_distinct_zero_orders def test_columns_for_distinct_zero_orders
assert_equal "posts.id", assert_equal "posts.id",
@conn.columns_for_distinct("posts.id", []) @conn.columns_for_distinct("posts.id", [])