instance method
create
Ruby on Rails 3.1.12
Since v3.0.20 Last seen in v3.2.22.5 PrivateSignature
create()
Creates a record with values matching those of the instance attributes and returns its id.
Source
# File activerecord/lib/active_record/persistence.rb, line 310
def create
attributes_values = arel_attributes_values(!id.nil?)
new_id = self.class.unscoped.insert attributes_values
self.id ||= new_id
IdentityMap.add(self) if IdentityMap.enabled?
@new_record = false
id
end
Defined in activerecord/lib/active_record/persistence.rb line 310
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Persistence