persisted?()
Instance Public methods
Indicates if the model is persisted. Default
is false
.
1 2 3 4 5 6 7 | class Person include ActiveModel::Model attr_accessor :id , :name end person = Person. new (id: 1 , name: 'bob' ) person.persisted? # => false |
Please login to continue.