method

persisted?

rails latest stable - Class: ActiveModel::Model

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v6.1.7.7) is shown here.

persisted?()
public

Indicates if the model is persisted. Default is false.

class Person
  include ActiveModel::Model
  attr_accessor :id, :name
end

person = Person.new(id: 1, name: 'bob')
person.persisted? # => false