forked from jeanmartin/bootstrapper
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding truncate_table to ActiveRecord::ConnectionAdapters::AbstractAd…
…apter and using "DELETE FROM". Overriding truncate_table in the MysqlAdapter to use "TRUNCATE TABLE" instead. I HAVE NOT TESTED THIS ON ANYTHING BUT MYSQL YET.
- Loading branch information
Brandon Arbini
committed
Jan 6, 2009
1 parent
eddadc2
commit e5bf675
Showing
4 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
require File.dirname(__FILE__) + '/lib/bootstrapper.rb' | ||
Dir.glob(File.dirname(__FILE__) + '/lib/**/*.rb').each {|f| require f } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module ActiveRecord | ||
|
||
module ConnectionAdapters | ||
|
||
class AbstractAdapter | ||
|
||
def truncate_table(table_name) | ||
execute "DELETE FROM #{table_name}" | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module ActiveRecord | ||
|
||
module ConnectionAdapters | ||
|
||
class MysqlAdapter | ||
|
||
def truncate_table(table_name) | ||
execute "TRUNCATE TABLE #{table_name}" | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end |