rails validation: :allow_nil and :inclusion both needed at the same time
In Rails 5 you can use allow_blank: true outside or inside inclusion block: validates :kind, inclusion: { in: [‘a’, ‘b’], allow_blank: true } or validates :kind, inclusion: { in: [‘a’, ‘b’] }, allow_blank: true tip: you can use in: %w(a b) for text values