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
I'm slowly transitioning my tests to use transaction based cleaning instead of truncation. To do this, I'm currently using an around method which will use the strategy I want only for that test;
module DatabaseCleaner
class Base
def cleaning_with(*args, &block)
create_strategy(*args).cleaning(&block)
end
end
class << self
def cleaning_with(*args, &inner_block)
connections.reduce(inner_block) do |curr_block, connection|
proc { connection.cleaning_with(*args, &curr_block) }
end.call
end
end
end
Would you consider adding this to the project itself? Btw, I realise doing this introduces some code repetition, I haven't yet looked at that because I didn't want to touch the original source code yet ;-)
The text was updated successfully, but these errors were encountered:
Hi,
I'm slowly transitioning my tests to use transaction based cleaning instead of truncation. To do this, I'm currently using an around method which will use the strategy I want only for that test;
This is my extension:
Would you consider adding this to the project itself? Btw, I realise doing this introduces some code repetition, I haven't yet looked at that because I didn't want to touch the original source code yet ;-)
The text was updated successfully, but these errors were encountered: