method

persisted?

Importance_1
v3.1.0 - Show latest stable - 0 notes - Class: ActiveResource::Base
persisted?() public

Returns true if this object has been saved, otherwise returns false.

Examples

persisted = Computer.create(:brand => 'Apple', :make => 'MacBook', :vendor => 'MacMall')
persisted.persisted? # => true

not_persisted = Computer.new(:brand => 'IBM', :make => 'Thinkpad', :vendor => 'IBM')
not_persisted.persisted? # => false

not_persisted.save
not_persisted.persisted? # => true
Show source
Register or log in to add new notes.