makandra / active_type

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

Caching classes generated by ActiveType::Record.[] #80

Closed jkr2255 closed 6 years ago

jkr2255 commented 7 years ago

By current implement of ExtendedRecord, A new class is generated each time ActiveType::Record.[] is invoked.

It might be a problem in some use cases:

Caching generated classes will solve these problems.

triskweline commented 7 years ago

I think that caching developer classes in a gem global would cause havoc with Rails' autoloading.

For what purpose are you calling ActiveType::Record.[] that often?