Skip to content

Files

Latest commit

 

History

History
23 lines (15 loc) · 535 Bytes

Rails-DelegateAllowBlank.md

File metadata and controls

23 lines (15 loc) · 535 Bytes

Pattern: Use of allow_blank as option to delegate

Issue: -

Description

This rule looks for delegations that pass :allow_blank as an option instead of :allow_nil. :allow_blank is not a valid option to pass to ActiveSupport#delegate.

Examples

# bad
delegate :foo, to: :bar, allow_blank: true

# good
delegate :foo, to: :bar, allow_nil: true

Further Reading