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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -