method

persisted?

Importance_1
v7.0.0 - Show latest stable - 0 notes - Class: API
persisted?() public

Indicates if the model is persisted. Default is false.

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

person = Person.new(id: 1, name: 'bob')
person.persisted? # => false
Show source
Register or log in to add new notes.