Skip to content

リリース 2.14

以下の変更が準備・実装されました。

コンフィグレーション

action_shortcutsの改善

action_shortcutsオプションの拡張モードのサポートを追加しました。

ruby
configuration do
  action_shortcuts(
    {
      restrict: {             # replacement for make
        prefix: :create,      # method name prefix
        suffix: :restriction  # method name suffix
      }
    }
  )
end
ruby
class PaymentsService::Restrictions::Create < ApplicationService::Base
  input :payment, type: Payment

  # The exclamation mark will be moved to the end of the method name
  restrict :payment!

  private

  def create_payment_restriction!
    inputs.payment.restrictions.create!(
      reason: "Suspicion of fraud"
    )
  end
end

Ruby

Ruby 3.5 Preview 1のサポートが確認されました。

Ruby 3.1のサポートが削除されました。