/usr/lib/ruby/vendor_ruby/database_cleaner/couch_potato/truncation.rb is in ruby-database-cleaner 1.3.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | require 'database_cleaner/generic/truncation'
module DatabaseCleaner
module CouchPotato
class Truncation
include ::DatabaseCleaner::Generic::Truncation
def initialize(options = {})
if options.has_key?(:only) || options.has_key?(:except)
raise ArgumentError, "The :only and :except options are not available for use with CouchPotato/CouchDB."
elsif !options.empty?
raise ArgumentError, "Unsupported option. You specified #{options.keys.join(',')}."
end
super
end
def clean
database.recreate!
end
private
def database
::CouchPotato.couchrest_database
end
end
end
end
|