Class: Avm::EacWordpressBase0::Instance

Inherits:
Avm::EacWebappBase0::Instance
  • Object
show all
Defined in:
lib/avm/eac_wordpress_base0/instance.rb

Constant Summary collapse

FILES_UNITS =
{ uploads: 'wp-content/uploads', themes: 'wp-content/themes' }.freeze

Instance Method Summary collapse

Instance Method Details

#database_unitObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/avm/eac_wordpress_base0/instance.rb', line 11

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