mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
getting rid of InstanceMethods anti-pattern...
This commit is contained in:
parent
45b2079e6a
commit
b3eefb7219
1 changed files with 25 additions and 31 deletions
|
@ -1,11 +1,6 @@
|
|||
module DatabaseCleaner
|
||||
module Generic
|
||||
module Truncation
|
||||
def self.included(base)
|
||||
base.send(:include, InstanceMethods)
|
||||
end
|
||||
|
||||
module InstanceMethods
|
||||
def initialize(opts={})
|
||||
if !opts.empty? && !(opts.keys - [:only, :except]).empty?
|
||||
raise ArgumentError, "The only valid options are :only and :except. You specified #{opts.keys.join(',')}."
|
||||
|
@ -40,4 +35,3 @@ module DatabaseCleaner
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue