I have a table Student(class_id(integer),marks(integer),rank(integer))
In my Seeds.rb file i have written something like this to make entry to table
Student.create(class_id:2 ,marks:"abcdef", rank: 2)
when i add these data to table by rake db:seed command ,i was expecting i would not be allowed to add this ,because for marks field of student, string is being inserted instead of integer.But rails added this record without any problem.
so how do i ensure this kind of entry doesnot happen and my table ensures type check.Me a newbie to rails and postgres
Studentmodel to check the same. Then you will get the error.