See the documentation :
:virtual - When true, the field is not stored in the database.
Virtual fields exist temporary in the Scheme and were not stored in the database. This is useful for local processes and checks.
Example: password confirmation field.
schema "users" do field :username, :string field :password, :string field :password_confirmation, :string, virtual: true timestamps end
Hope this helps.
Fabi755
source share