method

generate_primary_key

Importance_0
v7.0.0 - Show latest stable - 0 notes - Class: PrimaryKeyError
generate_primary_key() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/fixture_set/table_row.rb, line 119
        def generate_primary_key
          # generate a primary key if necessary
          if model_metadata.has_primary_key_column? && !@row.include?(model_metadata.primary_key_name)
            @row[model_metadata.primary_key_name] = ActiveRecord::FixtureSet.identify(
              @label, model_metadata.primary_key_type
            )
          end
        end
Register or log in to add new notes.