Skip to content

Commit

Permalink
fix: Ensure DefineEnumForMatcher#validating handles Hash enum values …
Browse files Browse the repository at this point in the history
…correctly (#1646)

Previously, DefineEnumForMatcher#validating only worked with Array enum values. This fix ensures it now also correctly handles Hash enum values.
  • Loading branch information
mi-wada authored Aug 13, 2024
1 parent d56a4b8 commit 2e93c6d
Show file tree
Hide file tree
Showing 2 changed files with 323 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ def find_enum_validator
record.class.validators.detect do |validator|
validator.kind == :inclusion &&
validator.attributes.include?(attribute_name.to_s) &&
validator.options[:in] == expected_enum_values
validator.options[:in] == expected_enum_value_names
end
end

Expand Down
Loading

0 comments on commit 2e93c6d

Please sign in to comment.