File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ namespace :data_migrations do
5858 referencing_page = nil
5959 referenced_page = nil
6060
61- if link . name == Deityship . name
61+ if link . class . name == Deityship . name
6262 referencing_page = link . send ( referencing_page_type . downcase )
6363 referenced_page = link . send ( :deity_character )
6464
@@ -85,7 +85,7 @@ namespace :data_migrations do
8585 attribute_category_id : categories_for_this_page_type_and_user ,
8686 user_id : referencing_page . user_id ,
8787 field_type : 'link' ,
88- old_column_source : relation_params [ :through_relation ] . pluralize
88+ old_column_source : link . class . name == Deityship . name ? 'deity_characters' : relation_params [ :through_relation ] . pluralize
8989 )
9090
9191 if attribute_field . count > 1
@@ -115,6 +115,7 @@ namespace :data_migrations do
115115 entity_type : referencing_page_type ,
116116 entity_id : referencing_page . id
117117 )
118+ puts "Migrating attribute ID #{ attribute . id } "
118119 if attribute . value . nil?
119120 attribute . value = JSON . parse ( '["' + referenced_page_type + '-' + referenced_page . id . to_s + '"]' )
120121 else
You can’t perform that action at this time.
0 commit comments