lib/config_scripts/seeds/seed_type.rb
# This method takes a value from the CSV file and gives back the value
# that should be set on the record.
#
# If the attribute is an association, this will pass it to the seed set
# as a seed identifier. If it is a polymorphic association, it will use
# the first part of the seed identifier as a class name.
#
# @param [String] value
#   The value from the CSV file.
#
# @param [Symbol] attribute
#   The name of the attribute that we are formatting.
#
# @return [Object]
#   The value to set on the record.
This method takes a value from the CSV file and gives back the value
that should be set on the record.

If the attribute is an association, this will pass it to the seed set
as a seed identifier. If it is a polymorphic association, it will use
the first part of the seed identifier as a class name.
This method takes a value from the CSV file and gives back the value that should be set on the record . If the attribute is an association this will pass it to the seed set as a seed identifier . If it is a polymorphic association it will use the first part of the seed identifier as a class name .
def read_value_for_attribute(value, attribute)
        if @dynamic_readers[attribute]
          value = @dynamic_readers[attribute].call(value)
        end
        if @associations.has_key?(attribute)
          return nil if value.blank?
          value = self.read_value_for_association(attribute, value.split("::"))
        end
        value
      end
def read_value_for_attribute ( value , attribute ) if @dynamic_readers [ attribute ] value = @dynamic_readers [ attribute ] . call ( value ) end if @associations . has_key? ( attribute ) return nil if value . blank? value = self . read_value_for_association ( attribute , value . split ( "::" ) ) end value end
This method takes a value from the CSV file and gives back the value
that should be set on the record.
This method takes a value from the CSV file and gives back the value that should be set on the record .
The value to set on the record.
The value to set on the record .
Object
value
<not_specific>
attribute
<not_specific>
<not_specific>
attribute The name of the attribute that we are formatting.
attribute The name of the attribute that we are formatting .