Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/seed_dump/dump_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ def dump_record(record, options)
# We select only string attribute names to avoid conflict
# with the composite_primary_keys gem (it returns composite
# primary key attribute names as hashes).
record.attributes.select {|key| key.is_a?(String) }.each do |attribute, value|
attribute_strings << dump_attribute_new(attribute, value, options) unless options[:exclude].include?(attribute.to_sym)
record.attributes_before_type_cast.select {|key| key.is_a?(String) }.each do |attribute, value|
new_value = value
if (options[:serialized]==false)
new_value = record.instance_variable_get("@attributes")[attribute].try(:serialized_value) ? record.instance_variable_get("@attributes")[attribute].serialized_value : value
end
attribute_strings << dump_attribute_new(attribute, new_value, options) unless options[:exclude].include?(attribute.to_sym)
end

open_character, close_character = options[:import] ? ['[', ']'] : ['{', '}']
Expand Down