Flowdock
method

new?

Importance_3
Ruby on Rails latest stable (v6.1.7.7) - 2 notes - Class: ActiveResource::Base

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.2.13) is shown here.

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