diff options
author | Kuldeep Aggarwal <kd.engineer@yahoo.co.in> | 2015-03-31 12:14:03 +0530 |
---|---|---|
committer | Kuldeep Aggarwal <kd.engineer@yahoo.co.in> | 2015-03-31 12:14:03 +0530 |
commit | bf6a33fd82a205c9ef1a5b6efec3487f9e266122 (patch) | |
tree | 0721cd27f2b53ce0bf81cf11c3e41b6e4c7f25e9 /activerecord/test/cases/attributes_test.rb | |
parent | 151aa690a2f62e2daee106079e88ff43cd770611 (diff) | |
download | rails-bf6a33fd82a205c9ef1a5b6efec3487f9e266122.tar.gz rails-bf6a33fd82a205c9ef1a5b6efec3487f9e266122.tar.bz2 rails-bf6a33fd82a205c9ef1a5b6efec3487f9e266122.zip |
use Model.reset_column_information to clear table cache connection wide.
`widgets` table is being created in `primary_keys_test.rb` for PostgreSQLAdapter, MysqlAdapter, Mysql2Adapter
and it makes test to fail earlier.
Before:
`bundle exec rake mysql2:test`
```
Finished in 127.287669s, 35.5258 runs/s, 97.8885 assertions/s.
1) Error:
PersistenceTest::SaveTest#test_save_touch_false:
ActiveModel::UnknownAttributeError: unknown attribute 'name' for #<Class:0x0000000a7d6ef0>.
/home/kd/projects/kd-rails/activerecord/lib/active_record/attribute_assignment.rb:36:in `rescue in _assign_attribute'
/home/kd/projects/kd-rails/activerecord/lib/active_record/attribute_assignment.rb:34:in `_assign_attribute'
/home/kd/projects/kd-rails/activemodel/lib/active_model/attribute_assignment.rb:40:in `block in _assign_attributes'
/home/kd/projects/kd-rails/activemodel/lib/active_model/attribute_assignment.rb:39:in `each'
/home/kd/projects/kd-rails/activemodel/lib/active_model/attribute_assignment.rb:39:in `_assign_attributes'
/home/kd/projects/kd-rails/activerecord/lib/active_record/attribute_assignment.rb:26:in `_assign_attributes'
/home/kd/projects/kd-rails/activemodel/lib/active_model/attribute_assignment.rb:33:in `assign_attributes'
/home/kd/projects/kd-rails/activerecord/lib/active_record/core.rb:293:in `initialize'
/home/kd/projects/kd-rails/activerecord/lib/active_record/inheritance.rb:61:in `new'
/home/kd/projects/kd-rails/activerecord/lib/active_record/inheritance.rb:61:in `new'
/home/kd/projects/kd-rails/activerecord/lib/active_record/persistence.rb:50:in `create!'
/home/kd/projects/kd-rails/activerecord/test/cases/persistence_test.rb:913:in `test_save_touch_false'
4522 runs, 12460 assertions, 0 failures, 1 errors, 4 skips
```
After:
`bundle exec rake mysql2:test`
```
Finished in 135.785086s, 33.3026 runs/s, 91.7774 assertions/s.
4522 runs, 12462 assertions, 0 failures, 0 errors, 4 skips
```
Diffstat (limited to 'activerecord/test/cases/attributes_test.rb')
0 files changed, 0 insertions, 0 deletions