ruby / gem_rbs_collection

A collection of RBS for gems.
MIT License
255 stars 106 forks source link

Allow multiple if/unless conditions in ActiveModel::Validations #614

Closed aki19035vc closed 3 months ago

aki19035vc commented 3 months ago

Allow multiple if/unless conditions in ActiveModel::Validations as described in the Rails guide.

Reference: https://github.com/yasslab/railsguides.jp/blob/3c243cf2a78ff99a58f4646d4794810599f38a9a/guides/source/active_record_validations.md?plain=1#L1042-L1054

class Computer < ApplicationRecord
  validates :mouse, presence: true,
                    if: [Proc.new { |c| c.market.retail? }, :desktop?],
                    unless: Proc.new { |c| c.trackpad.present? }
end
github-actions[bot] commented 3 months ago

@aki19035vc Thanks for your contribution!

Please follow the instructions below for each change. See also: https://github.com/ruby/gem_rbs_collection/blob/main/docs/CONTRIBUTING.md

Available commands

You can use the following commands by commenting on this PR.


activemodel

You changed RBS files for an existing gem. You need to get approval from the reviewers of this gem.

@hibariya, @ksss, please review this pull request. If this change is acceptable, please make a review comment including APPROVE from here. Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR. Just comment /merge to merge this PR.

github-actions[bot] commented 3 months ago

Thanks for your review, @ksss!

@aki19035vc, @ksss This PR is ready to be merged. Just comment /merge to merge this PR.

aki19035vc commented 3 months ago

/merge