@@ -60,8 +60,8 @@ def run_adopt_tests_for(model_class)
6060 assert_equal p2 , p3 . parent
6161
6262 hierarchy = model_class . hierarchy_class
63- initial_p2_hierarchies = hierarchy . where ( ancestor_id : p2 . id ) . count
64- initial_p3_hierarchies = hierarchy . where ( descendant_id : p3 . id ) . count
63+ hierarchy . where ( ancestor_id : p2 . id ) . count
64+ hierarchy . where ( descendant_id : p3 . id ) . count
6565
6666 # Destroy p1 (root node)
6767 p1 . destroy
@@ -210,7 +210,7 @@ def run_adopt_tests_for(model_class)
210210 leaf = model_class . create! ( name : 'leaf' , parent : p2 )
211211
212212 hierarchy = model_class . hierarchy_class
213- initial_count = hierarchy . count
213+ hierarchy . count
214214
215215 # Destroy leaf (has no children)
216216 leaf . destroy
@@ -255,16 +255,10 @@ def run_adopt_tests_for(model_class)
255255end
256256
257257# Test with PostgreSQL
258- if postgresql? ( ApplicationRecord . connection )
259- run_adopt_tests_for ( AdoptableTag )
260- end
258+ run_adopt_tests_for ( AdoptableTag ) if postgresql? ( ApplicationRecord . connection )
261259
262260# Test with MySQL
263- if mysql? ( MysqlRecord . connection )
264- run_adopt_tests_for ( MysqlAdoptableTag )
265- end
261+ run_adopt_tests_for ( MysqlAdoptableTag ) if mysql? ( MysqlRecord . connection )
266262
267263# Test with SQLite
268- if sqlite? ( SqliteRecord . connection )
269- run_adopt_tests_for ( MemoryAdoptableTag )
270- end
264+ run_adopt_tests_for ( MemoryAdoptableTag ) if sqlite? ( SqliteRecord . connection )
0 commit comments