makandra / active_type

Make any Ruby object quack like ActiveRecord
MIT License
1.09k stars 74 forks source link

Rails 6.0.0.rc1 ActiveRecord has a new check for schema cache. Calls columns_hash? method. #109

Closed teamhqapp closed 5 years ago

teamhqapp commented 5 years ago

https://github.com/makandra/active_type/blob/7485a03991b3fafd5fb26d42f79a2e0313e77294/lib/active_type/no_table.rb#L101

ActiveRecord 6.0.0.rc1 folks added a new method columns_hash? When I startup a blank db app with ActiveType object, it fails because that method is missing in the ActiveType/NoTable/DummySchemaCache class.

Here's the link to the columns_cache? method. https://github.com/rails/rails/commit/0007501669879a8560090897f78cf1d1b69bf30d

teamhqapp commented 5 years ago

Looking at the railtie.rb for active record, it looks like they added this check 9 months ago. Only happens if eager_load is true, which it is in production.

https://github.com/rails/rails/blame/41503f3d08418fb2dfe0eb85ac797059d9590051/activerecord/lib/active_record/railtie.rb#L158

teamhqapp commented 5 years ago

Submitted a pull request with the missing method.

kratob commented 5 years ago

Thanks for the fix. Released as 1.2.1.