instance method create

Ruby on Rails 3.2.22.5

Since v3.0.20 Last seen in v3.2.22.5 Private

Available in: v3.0.20 v3.1.12 v3.2.22.5

Signature

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 364
    def create
      attributes_values = arel_attributes_values(!id.nil?)

      new_id = self.class.unscoped.insert attributes_values

      self.id ||= new_id if self.class.primary_key

      IdentityMap.add(self) if IdentityMap.enabled?
      @new_record = false
      id
    end

Defined in activerecord/lib/active_record/persistence.rb line 364 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Persistence

Type at least 2 characters to search.

↑↓ navigate · open · esc close