Difference between null: false and required: true in rails -
in rails migrations difference between null: false
, required: true
?
for eg. if write:
t.string :phone_number, required: true
is same as:
t.string :phone_number, null: false
if both different how differ?
thanks in advance:)
required:true
doesn't in migrations. perhaps getting confused active record validations?
tl;dr: use null:false
.
Comments
Post a Comment