diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-10 08:34:37 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-10 08:43:18 +0900 |
commit | c83254db7ad2dbcc73b3eb1e103ba2bae666ab91 (patch) | |
tree | 5d275fcfbbef1c3bcccbfbb2d355ab62ac9a7dae /activerecord/lib/active_record/connection_adapters | |
parent | ea0eaced55465ce8054cf54ff583d75272bd8505 (diff) | |
parent | 0914ea8477aab6620983cee9b51be4c2c574705f (diff) | |
download | rails-c83254db7ad2dbcc73b3eb1e103ba2bae666ab91.tar.gz rails-c83254db7ad2dbcc73b3eb1e103ba2bae666ab91.tar.bz2 rails-c83254db7ad2dbcc73b3eb1e103ba2bae666ab91.zip |
Merge pull request #35203 from chiastolite/add_column_without_column_names
Do not allow to add column without column name
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb index dfb4953cbd..198898b764 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -229,6 +229,7 @@ module ActiveRecord column_types.each do |column_type| module_eval <<-RUBY, __FILE__, __LINE__ + 1 def #{column_type}(*names, **options) + raise ArgumentError, "Missing column name(s) for #{column_type}" if names.empty? names.each { |name| column(name, :#{column_type}, options) } end RUBY |