method

new?

Importance_3
v3.1.0 - Show latest stable - 2 notes - Class: ActiveResource::Base
new?() public

Returns true if this object hasn’t yet been saved, otherwise, returns false.

Examples

not_new = Computer.create(:brand => 'Apple', :make => 'MacBook', :vendor => 'MacMall')
not_new.new? # => false

is_new = Computer.new(:brand => 'IBM', :make => 'Thinkpad', :vendor => 'IBM')
is_new.new? # => true

is_new.save
is_new.new? # => false
Show source
Register or log in to add new notes.
December 3, 2008 - (v2.2.1)
5 thanks

Method doesn't exists

Don’t confuse it with new_record? in ActiveRecord