wisper-activerecord icon indicating copy to clipboard operation
wisper-activerecord copied to clipboard

Fixing incompatibilities caused by Rails 6

Open alecslupu opened this issue 4 years ago • 3 comments

Addresses issue reported in #29

alecslupu avatar May 30 '20 08:05 alecslupu

Given what has been found as being the root cause of this (details), I wonder if Wisper could black list ActiveRecord::SchemaMigration as a known AR model users are not really interested in anyway.

fxn avatar May 31 '20 10:05 fxn

@fxn, In theory Wisper could filter out the SchemaMigration, however, I think the real issue resides in the fact that ActiveRecord callbacks are invoked when SchemaMigration changes are performed. Maybe the hooks should not be called for ShemaMigration?

alecslupu avatar Jun 01 '20 11:06 alecslupu

From the point of view of Active Record, ActiveRecord::SchemaMigration is a class mapped to a database table. The ORM is using itself. In that sense, it is not special. Active Record has no concept of internal vs "application" models. In particular, the model lifecycle is generic.

On the other hand, that class might be considered to be special for Wisper. I mean, are users enabling Wisper::ActiveRecord.extend_all interested in all AR models for real? Or are they interested in application models only really? (I don't have an opinion, Wisper authors are the best ones to judge.)

fxn avatar Jun 01 '20 12:06 fxn