instance method persisted?

Ruby on Rails edge

Since v7.0.10

Available in: v7.0.10 v7.1.6 v7.2.4 v8.0.5.1 v8.1.4 edge

Signature

persisted?()

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 “‘

Source
# File activemodel/lib/active_model/api.rb, line 107
    def persisted?
      false
    end

Defined in activemodel/lib/active_model/api.rb line 107 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveModel::API

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close