Sha256: eb8edb9b679149bc782958a54e216633b1b0f88dcc0f724387aa2c1245a111bf
Contents?: true
Size: 618 Bytes
Versions: 3
Compression:
Stored size: 618 Bytes
Contents
module Itiel module DB # # Truncates specified tables # # Usage: # # @truncator = Itiel::DB::Truncator.new "tables", "to", "truncate" # @truncator.connection = :database # @truncator.truncate! # class Truncator include Itiel::Nameable include Itiel::DB::SQLConnectable attr_accessor :tables def initialize(*tables) self.tables = tables end def truncate! tables.each do |table| db = self.class.sequel_connection(connection) db[table.to_sym].truncate end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
itiel-0.1.2 | lib/itiel/db/truncator.rb |
itiel-0.1.1 | lib/itiel/db/truncator.rb |
itiel-0.1.0 | lib/itiel/db/truncator.rb |