File: C:/Ruby27-x64/lib/ruby/gems/2.7.0/doc/activeresource-6.0.0/ri/ActiveResource/Base/create-c.ri
U:RDoc::AnyMethod[iI"create:ETI"!ActiveResource::Base::create;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"OCreates a new resource instance and makes a request to the remote service ;TI"Pthat it be saved, making it equivalent to the following simultaneous calls:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I")ryan = Person.new(:first => 'ryan')
;TI"ryan.save
;T:@format0o;
; [ I"FReturns the newly created resource. If a failure has occurred an ;TI"Rexception will be raised (see <tt>save</tt>). If the resource is invalid and ;TI"Ihas not been saved then <tt>valid?</tt> will return <tt>false</tt>, ;TI"9while <tt>new?</tt> will still return <tt>true</tt>.;T@S:RDoc::Markup::Heading:
leveli : textI"
Examples;To;; [I"WPerson.create(:name => 'Jeremy', :email => 'myname@nospam.com', :enabled => true)
;TI"%my_person = Person.find(:first)
;TI",my_person.email # => myname@nospam.com
;TI"
;TI"Ydhh = Person.create(:name => 'David', :email => 'dhh@nospam.com', :enabled => true)
;TI"dhh.valid? # => true
;TI"dhh.new? # => false
;TI"
;TI"O# We'll assume that there's a validation that requires the name attribute
;TI"]that_guy = Person.create(:name => '', :email => 'thatguy@nospam.com', :enabled => true)
;TI" that_guy.valid? # => false
;TI"that_guy.new? # => true;T;
0:
@fileI" lib/active_resource/base.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(attributes = {});T@*FI" Base;TcRDoc::NormalClass00