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:
commit
831a277d49
3 changed files with 16 additions and 1 deletions
|
@ -154,7 +154,7 @@ module ActiveRecord
|
|||
end
|
||||
|
||||
def valid_type?(type)
|
||||
true
|
||||
false
|
||||
end
|
||||
|
||||
def schema_creation
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -17,6 +17,17 @@ class Mysql2AdapterTest < ActiveRecord::Mysql2TestCase
|
|||
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
|
||||
assert_equal "posts.id",
|
||||
@conn.columns_for_distinct("posts.id", [])
|
||||
|
|
Loading…
Reference in a new issue