Sha256: 2b102548c0999373bae43fb0e919ceb9d6367eb8f7af68391101dbbf0094d4b5

Contents?: true

Size: 811 Bytes

Versions: 2

Compression:

Stored size: 811 Bytes

Contents

# frozen_string_literal: true

if !Rails.env.production? || ENV.fetch("SEED", nil)
  print "Creating seeds for decidim_awesome...\n" unless Rails.env.test?

  organization = Decidim::Organization.first

  # Set the htmleditor on to facilitate development
  admin_user = Decidim::User.find_by(
    organization:,
    email: "admin@example.org"
  )

  Decidim.traceability.update!(
    organization,
    admin_user,
    rich_text_editor_in_public_views: true
  )

  # Enable images in general
  setting = Decidim::DecidimAwesome::AwesomeConfig.find_or_initialize_by(var: :allow_images_in_editors, organization:)
  setting.value = true
  setting.save!
  setting = Decidim::DecidimAwesome::AwesomeConfig.find_or_initialize_by(var: :allow_videos_in_editors, organization:)
  setting.value = true
  setting.save!
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
decidim-decidim_awesome-0.11.2 db/seeds.rb
decidim-decidim_awesome-0.11.1 db/seeds.rb