Custom field to the Devise user doesn't work in seeds.rb file

This is the error I get when running seeds.rb

ActiveModel::UnknownAttributeError: unknown 
attribute 'extra_cash' for User. 
    raise, k.to_s)

My seeds:

user = User.create!(
  email: "", 
  password: "Password123!", 
  extra_cash:, "USD")

Using the annotate gem I can confirm the field is added to the database and my app is “aware” of it right?

# frozen_string_literal: true

class DeviseCreateUsers < ActiveRecord::Migration[7.1]
  def change
    create_table :users, id: :uuid do |t|
      t.monetize :extra_cash, amount: { precision: 20, scale: 4 }

So what’s going on? Do I need to somehow let Devise know of this field? How do I do that?

I figured it out, the extra_cash field is only available after I use the monetize callback.

class User < ApplicationRecord
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :validatable

  monetize :extra_cash_cents

  has_many :bank_accounts      

Now it works fine!