mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Revert "checking in the abstractions for valid type checking:"
This reverts commit c321b309a9
.
Conflicts:
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
Reason: failing test
1) Error:
test_valid_column(ActiveRecord::ConnectionAdapters::SQLite3AdapterTest):
NoMethodError: undefined method `column' for
test/cases/adapters/sqlite3/sqlite3_adapter_test.rb:29:in
`test_valid_column'
This commit is contained in:
parent
2f997797a5
commit
c65b076328
4 changed files with 1 additions and 28 deletions
|
@ -118,7 +118,7 @@ HEADER
|
|||
|
||||
# then dump all non-primary key columns
|
||||
column_specs = columns.map do |column|
|
||||
raise StandardError, "Unknown type '#{column.sql_type}' for column '#{column.name}'" unless @connection.valid_type?(column.type)
|
||||
raise StandardError, "Unknown type '#{column.sql_type}' for column '#{column.name}'" if @types[column.type].nil?
|
||||
next if column.name == pk
|
||||
@connection.column_spec(column, @types)
|
||||
end.compact
|
||||
|
|
|
@ -16,15 +16,6 @@ module ActiveRecord
|
|||
eosql
|
||||
end
|
||||
|
||||
def test_valid_column
|
||||
column = @conn.column('ex').find { |col| col.name == 'id' }
|
||||
assert @conn.valid_type?(column.type)
|
||||
end
|
||||
|
||||
def test_invalid_column
|
||||
assert !@conn.valid_type?(:foobar)
|
||||
end
|
||||
|
||||
def test_client_encoding
|
||||
assert_equal Encoding::UTF_8, @conn.client_encoding
|
||||
end
|
||||
|
|
|
@ -10,15 +10,6 @@ module ActiveRecord
|
|||
@connection.exec_query('create table ex(id serial primary key, number integer, data character varying(255))')
|
||||
end
|
||||
|
||||
def test_valid_column
|
||||
column = @connection.column('ex').find { |col| col.name == 'id' }
|
||||
assert @connection.valid_type?(column.type)
|
||||
end
|
||||
|
||||
def test_invalid_column
|
||||
assert !@connection.valid_type?(:foobar)
|
||||
end
|
||||
|
||||
def test_primary_key
|
||||
assert_equal 'id', @connection.primary_key('ex')
|
||||
end
|
||||
|
|
|
@ -25,15 +25,6 @@ module ActiveRecord
|
|||
@conn.intercepted = true
|
||||
end
|
||||
|
||||
def test_valid_column
|
||||
column = @conn.column('items').find { |col| col.name == 'id' }
|
||||
assert @conn.valid_type?(column.type)
|
||||
end
|
||||
|
||||
def test_invalid_column
|
||||
assert @conn.valid_type?(:foobar)
|
||||
end
|
||||
|
||||
def teardown
|
||||
@conn.intercepted = false
|
||||
@conn.logged = []
|
||||
|
|
Loading…
Reference in a new issue