fixturease 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/bin/fixturease.rb +5 -3
- metadata +2 -2
data/Rakefile
CHANGED
data/bin/fixturease.rb
CHANGED
@@ -16,15 +16,17 @@ else
|
|
16
16
|
ActiveRecord::Base.connection.rollback_db_transaction
|
17
17
|
ActiveRecord::Base.send :decrement_open_transactions
|
18
18
|
klass = mod.is_a?(Class) ? mod : mod.singularize.camelize.constantize
|
19
|
-
|
20
|
-
|
19
|
+
if klass.count > 0
|
20
|
+
max_id = klass.find(:first,:order => "id DESC").id
|
21
|
+
ActiveRecord::Base.connection.execute "ALTER TABLE #{klass.table_name} AUTO_INCREMENT=#{max_id}"
|
22
|
+
end
|
21
23
|
ActiveRecord::Base.send :increment_open_transactions
|
22
24
|
ActiveRecord::Base.connection.begin_db_transaction
|
23
25
|
else
|
24
26
|
puts "Database adapter #{adapter} is not yet supported. Sorry"
|
25
27
|
end
|
26
28
|
end
|
27
|
-
|
29
|
+
|
28
30
|
def reset_sequences!
|
29
31
|
Dir[ENV['RAILS_ROOT']+'/'+ENV['FIXTURES_ROOT']+'/*.yml'].each do |fixture_file|
|
30
32
|
reset_sequence! File.basename(fixture_file,".yml")
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: fixturease
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
7
|
-
date: 2007-01-
|
6
|
+
version: 0.2.7
|
7
|
+
date: 2007-01-30 00:00:00 +02:00
|
8
8
|
summary: Easy fixture creation tool
|
9
9
|
require_paths:
|
10
10
|
- lib
|