lib/valhammer/validations.rb in valhammer-0.1.1 vs lib/valhammer/validations.rb in valhammer-0.1.2
- old
+ new
@@ -54,10 +54,10 @@
end
def valhammer_inclusion(validations, column, opts)
return unless opts[:inclusion] && column.type == :boolean
- validations[:inclusion] = { in: [false, true], allow_nil: true }
+ validations[:inclusion] = { in: [false, true], allow_nil: column.null }
end
def valhammer_unique(validations, column, opts)
return unless opts[:uniqueness]