From f6ee1fc0bf1908281d10b1dc3e2c441258bef0df Mon Sep 17 00:00:00 2001 From: Ben Mabey Date: Fri, 26 Feb 2010 15:21:40 -0700 Subject: [PATCH] aliases clean methods as ! variants since they are rather destructive -thanks nofxx :) --- History.txt | 3 +++ lib/database_cleaner/configuration.rb | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/History.txt b/History.txt index fa2cc48..618b509 100644 --- a/History.txt +++ b/History.txt @@ -1,5 +1,8 @@ 0.5.x (In Git) + === New features + * clean and clean_with methods are now aliased to clean! and clean_with!. (Ben Mabey) + == 0.5.0 2010-02-22 - The CouchPotato Release === New features diff --git a/lib/database_cleaner/configuration.rb b/lib/database_cleaner/configuration.rb index 078b3e9..8d74263 100644 --- a/lib/database_cleaner/configuration.rb +++ b/lib/database_cleaner/configuration.rb @@ -41,6 +41,8 @@ module DatabaseCleaner strategy end + alias clean_with! clean_with + def strategy=(args) strategy, *strategy_args = args if strategy.is_a?(Symbol) @@ -64,6 +66,8 @@ module DatabaseCleaner strategy.clean end + alias clean! clean + private def strategy