excid3/madmin

NoMethodError in Madmin::ActiveStorage::Blobs#index

Closed this issue · 3 comments

undefined method `truncate' for {"identified"=>true, "analyzed"=>true}:ActiveSupport::HashWithIndifferentAccess
Did you mean?  trust

The real issue here is that store :metadata is not being ignored. https://github.com/rails/rails/blob/main/activestorage/app/models/active_storage/blob.rb#L42

We should make sure that Madmin resouce generator ignores metadata and generates attributes for each of the store accessors. I thought that was working.

That said, #112 does fix it if attribute :metadata was left in or added so that's definitely good to have.

@jitingcn Was this an issue with the freshly generated app or with the Madmin dummy app? The stored_attributes method call works fine on ActiveStorage::Blob, and so store value should be ignored. Additionally, its accessors should be included as attributes when generating.

Maybe this is a case where the dummy app still had attribute :metadata left in its ActiveStorage::Blob directory? I've noticed that the dummy app's resources tend to get out of sync with changes to the library sometimes.

Maybe this is a case where the dummy app still had attribute :metadata left in its ActiveStorage::Blob directory? I've noticed that the dummy app's resources tend to get out of sync with changes to the library sometimes.

Yeah, my app haven't removed attribute :metadata, since stored_attributes support just add recently and I won't regenerate resource file all the time. But this is just an small issue :)