You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the combination of some extensions and the recent code merged that included support for ActiveStorage, it is no longer possible to specify a custom taxon attachment definition, the changes are in this commit d802e5b
For example, solidus_paypal_braintree gem has an initializer, that adds a custom helper that calls Solidus Payments Controller, which inherits from Admin Base Controller, which also inherits from BaseController, and it has the Spree::Config.active_storage_enabled? check, it compares the current taxon_attachment_module with ActiveStorages one, this initializer runs before any of my initializers including config/initializers/spree.rb, that's where I usually override default taxon_attachment_module to use my custom module, but it just sets the value but it was already loaded in taxon model
Steps to reproduce
Create a new solidus app with active storage changes included
Add solidus_paypal_braintree to gemfile
Create another taxon/paperclip_attachment with a custom method and add it to spree.rb initializer
Open rails console, find a taxon then try to call the custom method, it says undefined method since it loaded the default one instead of the custom one
Not sure how to fix it, maybe the most compatible one with current extensions ecosystem is to modify this check to not invoke the module?
What do you think?
The text was updated successfully, but these errors were encountered:
softr8
changed the title
Unable to override config.taxon_attachment_module
Unable to specify a custom attachment definition via config.taxon_attachment_module
May 4, 2020
Yep, I think that active_storage_enabled? should not check the classes set to determine if we are using ActiveStorage, we can also be using it without using the modules provided by default in Solidus.
Yep, I think that active_storage_enabled? should not check the classes set to determine if we are using ActiveStorage, we can also be using it without using the modules provided by default in Solidus.
With the combination of some extensions and the recent code merged that included support for ActiveStorage, it is no longer possible to specify a custom taxon attachment definition, the changes are in this commit d802e5b
For example, solidus_paypal_braintree gem has an initializer, that adds a custom helper that calls Solidus Payments Controller, which inherits from Admin Base Controller, which also inherits from BaseController, and it has the Spree::Config.active_storage_enabled? check, it compares the current taxon_attachment_module with ActiveStorages one, this initializer runs before any of my initializers including config/initializers/spree.rb, that's where I usually override default taxon_attachment_module to use my custom module, but it just sets the value but it was already loaded in taxon model
Steps to reproduce
Not sure how to fix it, maybe the most compatible one with current extensions ecosystem is to modify this check to not invoke the module?
What do you think?
The text was updated successfully, but these errors were encountered: