Method: Bumbleworks::Configuration#storage_adapter
- Defined in:
- lib/bumbleworks/configuration.rb
#storage_adapter ⇒ Object
If storage_adapter is not explicitly set, find first registered adapter that can use Bumbleworks.storage.
274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/bumbleworks/configuration.rb', line 274 def storage_adapter @storage_adapter ||= begin all_adapters = storage_adapters raise UndefinedSetting, "No storage adapters configured" if all_adapters.empty? adapter = all_adapters.detect do |potential_adapter| potential_adapter.use?(storage) end raise UndefinedSetting, "Storage is missing or not supported. Supported: #{all_adapters.map(&:display_name).join(', ')}" unless adapter adapter end end |