Class: Lanes::SystemSettings::ExtensionSettings

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/lanes/system_settings.rb

Instance Method Summary collapse

Constructor Details

#initialize(ext_id, settings) ⇒ ExtensionSettings

Returns a new instance of ExtensionSettings.



14
15
16
17
# File 'lib/lanes/system_settings.rb', line 14

def initialize(ext_id, settings)
    @extension_id = ext_id
    super(settings)
end

Instance Method Details

#apply!Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/lanes/system_settings.rb', line 21

def apply!
    require 'shrine/storage/file_system'
    ext = Extensions.controlling
    Lanes::Concerns::AssetUploader.storages = {
        cache: Shrine::Storage::FileSystem.new(ext.root_path,
                                               prefix: "tmp/cache"),
        store: Shrine::Storage::FileSystem.new(ext.root_path,
                                               prefix: "public/files")
    }
end

#persist!Object



18
19
20
# File 'lib/lanes/system_settings.rb', line 18

def persist!
    SystemSettings.persist!(@extension_id, self.to_h)
end