Sha256: a255b68569d5f7403409867639d36b50c6f386cead23821d86d4371aea8c2f64

Contents?: true

Size: 765 Bytes

Versions: 5

Compression:

Stored size: 765 Bytes

Contents

# -*- encoding : utf-8 -*-

class UpgradeRecaptchaToV3 < Cardio::Migration::Core
  def up
    update_card! [:recaptcha_settings, :self, :structure],
                 content: <<-STRING
{{+site key}}
{{+secret key}}
{{+minimum score}}
{{+proxy}}
    STRING

    { public: :site, private: :secret }.each do |old_name, new_name|
      codename = "recaptcha_#{old_name}_key".to_sym
      next unless Card::Codename[codename]

      update_card! codename,
                   name: "#{Card[:recaptcha_settings].name}+#{new_name} key",
                   codename: "recaptcha_#{new_name}_key"
    end

    ensure_card [Card[:recaptcha_settings].name, "minimum score"],
                codename: "recaptcha_minimum_score",
                type_id: Card::NumberID
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
card-1.101.4 db/migrate_core_cards/20190320091257_upgrade_recaptcha_to_v3.rb
card-1.101.3 db/migrate_core_cards/20190320091257_upgrade_recaptcha_to_v3.rb
card-1.101.2 db/migrate_core_cards/20190320091257_upgrade_recaptcha_to_v3.rb
card-1.101.1 db/migrate_core_cards/20190320091257_upgrade_recaptcha_to_v3.rb
card-1.101.0 db/migrate_core_cards/20190320091257_upgrade_recaptcha_to_v3.rb