Sha256: 9a29d27f4bcc891484b929f89657377d2ffe089ea03742a87d34dc63f5690361

Contents?: true

Size: 715 Bytes

Versions: 11

Compression:

Stored size: 715 Bytes

Contents

# frozen_string_literal: true

require 'avm/instances/entry_keys'
require 'avm/eac_webapp_base0/instance'

module Avm
  module Stereotypes
    module EacWordpressBase0
      class Instance < ::Avm::EacWebappBase0::Instance
        FILES_UNITS = { uploads: 'wp-content/uploads', themes: 'wp-content/themes' }.freeze

        def database_unit
          web_url = read_entry(::Avm::Instances::EntryKeys::WEB_URL)
          super.after_load do
            info 'Fixing web addresses...'
            run_sql(<<~SQL)
              update wp_options
              set option_value = '#{web_url}'
              where option_name in ('siteurl', 'home')
            SQL
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
avm-tools-0.74.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.73.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.72.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.71.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.70.2 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.70.1 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.70.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.69.3 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.69.2 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.69.1 lib/avm/stereotypes/eac_wordpress_base0/instance.rb
avm-tools-0.69.0 lib/avm/stereotypes/eac_wordpress_base0/instance.rb