diff options
author | noam <CLUSTERfoo@users.noreply.github.com> | 2014-11-17 12:54:40 -0500 |
---|---|---|
committer | noam <CLUSTERfoo@users.noreply.github.com> | 2014-12-03 11:35:40 -0500 |
commit | b64fb3020b34a8b9607802613d13e81b362dbae2 (patch) | |
tree | 3ebc4bceb70327405d55b7a2dd2306a5290115d2 /activerecord/lib/active_record | |
parent | 497544f0b3eba83c1385579de50a3d521188e448 (diff) | |
download | rails-b64fb3020b34a8b9607802613d13e81b362dbae2.tar.gz rails-b64fb3020b34a8b9607802613d13e81b362dbae2.tar.bz2 rails-b64fb3020b34a8b9607802613d13e81b362dbae2.zip |
Failure to rollback t.timestamps when within a change_table migration
When running the following migration:
change_table(:table_name) { |t| t/timestamps }
The following error was produced:
wrong number of arguments (2 for 1) .... /connection_adapters/abstract/schema_statements.rb:851:in `remove_timestamps'
This is due to `arguments` containing an empty hash as its second
argument.
Diffstat (limited to 'activerecord/lib/active_record')
3 files changed, 4 insertions, 4 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 d2236d046b..537e21029e 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -509,8 +509,8 @@ module ActiveRecord # Removes the timestamp columns (+created_at+ and +updated_at+) from the table. # # t.remove_timestamps - def remove_timestamps - @base.remove_timestamps(name) + def remove_timestamps(options = {}) + @base.remove_timestamps(name, options) end # Renames a column. diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index aa7c406050..fd52cdf716 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -854,7 +854,7 @@ module ActiveRecord # # remove_timestamps(:suppliers) # - def remove_timestamps(table_name) + def remove_timestamps(table_name, options = {}) remove_column table_name, :updated_at remove_column table_name, :created_at end diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index bf16804aa0..a741314ac6 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -779,7 +779,7 @@ module ActiveRecord [add_column_sql(table_name, :created_at, :datetime, options), add_column_sql(table_name, :updated_at, :datetime, options)] end - def remove_timestamps_sql(table_name) + def remove_timestamps_sql(table_name, options = {}) [remove_column_sql(table_name, :updated_at), remove_column_sql(table_name, :created_at)] end |