Skip to content

Fix .validate_duration(s) when used in combination with duration_attribute_accessor#162

Merged
nsommer merged 1 commit into
mainfrom
fix-validates-durations
Apr 30, 2026
Merged

Fix .validate_duration(s) when used in combination with duration_attribute_accessor#162
nsommer merged 1 commit into
mainfrom
fix-validates-durations

Conversation

@nsommer

@nsommer nsommer commented Apr 30, 2026

Copy link
Copy Markdown
Member

When used in combination with duration_attribute_accessor the reader returns an ActiveSupport::Duration object rather than the bare string which made the validation method fail. This obviously should work, but was missed because the specs just used ActiveModels with normal attr_accessors. Both scenarios should work ultimately.

@nsommer nsommer requested review from a-berg-gs and chiibis April 30, 2026 16:49
@nsommer nsommer merged commit faf9836 into main Apr 30, 2026
3 checks passed
@nsommer nsommer deleted the fix-validates-durations branch April 30, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants