Skip to content

Commit c2f3338

Browse files
authored
Merge branch 'master' into jul-18-changes
2 parents 0f73f85 + 99efc21 commit c2f3338

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/tasks/data_migrations.rake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)