AlchemyCMS / alchemy_cms

Alchemy is the Open Source Rails CMS framework for the component based web that can be used as classic server side rendered or headless CMS.
https://www.alchemy-cms.com
BSD 3-Clause "New" or "Revised" License
839 stars 315 forks source link

Support for Dragonfly Memory store #2401

Closed phantomwhale closed 1 year ago

phantomwhale commented 1 year ago

Is your feature request related to a problem? Please describe. We are upgrading our Alchemy stack, and have got as far as Alchemy 5.1 - but this doesn't support the Dragonfly Memory Store we use in our tests

This line causing the issues is:

https://github.com/AlchemyCMS/alchemy_cms/blob/main/app/models/alchemy/picture_thumb/create.rb#L46

Describe the solution you'd like To be able to use file or memory store for Dragonfly, without Alchemy throwing errors

Describe alternatives you've considered Monkey patching DragonflyMemoryStore to have the missing server_root method, returning nil

Additional context We are hitting the following stacktrace when we create a new alchemy_picture, using the alchemy provided factories, running under Alchemy 5.1:

Failure/Error: let(:picture) { FactoryBot.create(:alchemy_picture) }

NoMethodError:
 undefined method `server_root' for #<Dragonfly::MemoryDataStore:0x000055884d2d4648>
# /usr/local/bundle/gems/alchemy_cms-5.1.10/app/models/alchemy/picture_thumb/create.rb:34:in `server_path'
# /usr/local/bundle/gems/alchemy_cms-5.1.10/app/models/alchemy/picture_thumb/create.rb:19:in `call'
 [ SNIP ]
# /usr/local/bundle/gems/factory_bot-6.2.1/lib/factory_bot/factory_runner.rb:28:in `run'
# /usr/local/bundle/gems/factory_bot-6.2.1/lib/factory_bot/strategy_syntax_method_registrar.rb:28:in `block in define_singular_strategy_method'
# ./spec/controllers/admin/admin_controller.rb:15:in `block (3 levels) in <top (required)>'
github-actions[bot] commented 1 year ago

This issue has not seen any activity in a long time. Please create a pull request with a fix or ask someone of the community if they can help. This issue will be closed in 7 days if no further activity happens.

github-actions[bot] commented 1 year ago

This issue has not seen any activity in a long time. If the issue described still exists in recent versions of Alchemy, please open a new issue with. Thanks for reporting.