You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recursive restore with has_many/one through assocs
The query to find deleted has_many or has_one through associations
was being generated incorrectly because of specifying the wrong
foreign key for the table. This change uses the has_one/has_many
model's primary key as the foreign key.
'paranoid_has_one_throughs'=>'paranoid_has_through_restore_parent_id INTEGER NOT NULL, empty_paranoid_model_id INTEGER NOT NULL, deleted_at DATETIME',
56
+
'paranoid_has_many_throughs'=>'paranoid_has_through_restore_parent_id INTEGER NOT NULL, empty_paranoid_model_id INTEGER NOT NULL, deleted_at DATETIME',
53
57
}.eachdo |table_name,columns_as_sql_string|
54
58
ActiveRecord::Base.connection.execute"CREATE TABLE #{table_name} (id INTEGER NOT NULL PRIMARY KEY, #{columns_as_sql_string})"
0 commit comments