lib/config_scripts/seeds/seed_set.rb
# This method gets a unique identifier for a record when writing seeds
# that refer to it.
#
# It will look for a seed type that handles seeds for a class in the
# record's class heirarchy, and use that seed type's
# {#seed_identifier_for_record} method. If it cannot find a seed type,
# it will use the record's ID.
#
# @param [ActiveRecord::Base] record
#   The record whose identifier we are generating.
#
# @return [String]
This method gets a unique identifier for a record when writing seeds
that refer to it.

It will look for a seed type that handles seeds for a class in the
record's class heirarchy, and use that seed type's
{#seed_identifier_for_record} method. If it cannot find a seed type,
it will use the record's ID.
This method gets a unique identifier for a record when writing seeds that refer to it . It will look for a seed type that handles seeds for a class in the record ' s class heirarchy and use that seed type ' s { #seed_identifier_for_record } method . If it cannot find a seed type it will use the record ' s ID .
def seed_identifier_for_record(record)
        seed_type = self.seed_type_for_class(record.class)
        if seed_type
          seed_type.seed_identifier_for_record(record)
        else
          record.id rescue nil
        end
      end
def seed_identifier_for_record ( record ) seed_type = self . seed_type_for_class ( record . class ) if seed_type seed_type . seed_identifier_for_record ( record ) else record . id rescue nil end end
This method gets a unique identifier for a record when writing seeds
that refer to it.
This method gets a unique identifier for a record when writing seeds that refer to it .
None
String
record
<not_specific>
<not_specific>
record The record whose identifier we are generating.
record The record whose identifier we are generating .