Ticket #7932: method_missing_for_table_definitions.diff
| File method_missing_for_table_definitions.diff, 1.3 kB (added by norbert, 1 year ago) |
|---|
-
activerecord/test/migration_test.rb
old new 93 93 Person.connection.drop_table :testings rescue nil 94 94 end 95 95 96 def test_create_table_with_method_missing 97 Person.connection.create_table :testings do |t| 98 t.foo :string 99 end 100 101 assert_equal %w(foo id), 102 Person.connection.columns(:testings).map { |c| c.name }.sort 103 ensure 104 Person.connection.drop_table :testings rescue nil 105 end 106 96 107 def test_create_table_with_not_null_column 97 108 assert_nothing_raised do 98 109 Person.connection.create_table :testings do |t| -
activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
old new 340 340 @columns * ', ' 341 341 end 342 342 343 def method_missing(name, *args) 344 column(name, *args) 345 end 346 343 347 private 344 348 def native 345 349 @base.native_database_types