File: //usr/local/rvm/gems/ruby-2.7.4/doc/activerecord-6.1.4.1/ri/ActiveRecord/Relation/create-i.ri
U:RDoc::AnyMethod[iI"create:ETI""ActiveRecord::Relation#create;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"BTries to create a new record with the same scoped attributes ;TI"Qdefined in the relation. Returns the initialized object if validation fails.;To:RDoc::Markup::BlankLine o;
; [I"-Expects arguments in the same format as ;TI"L{ActiveRecord::Base.create}[rdoc-ref:Persistence::ClassMethods#create].;T@S:RDoc::Markup::Heading:
leveli : textI"
Examples;T@o:RDoc::Markup::Verbatim; [I"'users = User.where(name: 'Oscar')
;TI"9users.create # => #<User id: 3, name: "Oscar", ...>
;TI"
;TI"users.create(name: 'fxn')
;TI"7users.create # => #<User id: 4, name: "fxn", ...>
;TI"
;TI"6users.create { |user| user.name = 'tenderlove' }
;TI"1# => #<User id: 5, name: "tenderlove", ...>
;TI"
;TI"2users.create(name: nil) # validation on name
;TI")# => #<User id: nil, name: nil, ...>;T:@format0:
@fileI""lib/active_record/relation.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(attributes = nil, &block);T@#FI"
Relation;TcRDoc::NormalClass00