So I have this model Request, that was working perfectly. I decided to add it a "status" field, with a default value
def change
create_table :requests do |t|
t.references :owner, index: true
t.references :pretender, index: true
t.belongs_to :book, index: true
t.string :status, value: "pending", null: false
t.timestamps null: false
end
end
But now I get an COnSTRAINT NOT NULL on this line:
...
user.requests.build owner_id: oid, pretender_id: pid, book_id: bid
...
Which was working just fine. If the field has a default value, I shouldn't need to define it on the buildmethod, no?