Sha256: 838482fce706b22b08f82b96d2e11da499efb10d6c30c4a7781dd625126026ff

Contents?: true

Size: 848 Bytes

Versions: 2

Compression:

Stored size: 848 Bytes

Contents

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

class UpgradeRecaptchaToV3 < Cardio::Migration::Transform
  def up
    update_card! %i[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: [:recaptcha_settings, "#{new_name} key"].cardname,
                   codename: "recaptcha_#{new_name}_key"
    end

    Card.ensure name: [:recaptcha_settings, "minimum score"].cardname,
                codename: "recaptcha_minimum_score",
                type: :number
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
card-1.108.1 mod/core/data/transform/20190320091257_upgrade_recaptcha_to_v3.rb
card-1.108.0 mod/core/data/transform/20190320091257_upgrade_recaptcha_to_v3.rb