Can not use with library 'activestorage'
ksss opened this issue · comments
It cannot be used with activestorage, which is currently added at ruby/gem_rbs_collection#61.
It has the following problems.
activestorage creates key
and filename
columns.
Current rbs_rails will automatically create a rbs definition for these column, but gem_rbs_collection's activestorage also has a definition for the ActiveStorage::Blob#key
and ActiveStorage::Blob#filename
method, so the definitions overlap.
The cause is in the implementation in ActiveStorage.
In ActiveStorage, ActiveStorage::Blob#key
and ActiveStorage::Blob#filename
are redefined.
The following is my idea.
ActiveStorage::Blob#filename
returns ActiveStorage::Filename
object, so it needs rbs definition. (It is still untyped
for now.)
Therefore, I think rbs_rails should not generate rbs definitions for ActiveStorage::Blob#key
and ActiveStorage::Blob#filename
.
I am going to implement a solution to this problem.
Thanks for reporting the issue!
ActiveStorage::Blob#filename returns ActiveStorage::Filename object, so it needs rbs definition. (It is still untyped for now.)
Therefore, I think rbs_rails should not generate rbs definitions for ActiveStorage::Blob#key and ActiveStorage::Blob#filename.
Looks good, go ahead 👍
By the way, I'm a little busy in a week, and I'm not familiar with Active Storage. So probably I'll have a delay to review if you'll make a pull request. 🙏
Workarounds are easy.
Enjoy the road trip 🚗
I'll close this issue because this is solved by #192, but feel free to re-open this issue if you still have any related problems. Thanks!