activerecord_worm_table 0.6.0 → 0.8.0

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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/activerecord_worm_table.rb +4 -8
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.8.0
@@ -115,14 +115,9 @@ module ActiveRecord
115
115
  end
116
116
 
117
117
  def default_active_table_name
118
- if !defined?(RAILS_ENV) || (RAILS_ENV !~ /^test/)
119
- base_table_name
120
- else
121
- # if in a test environment, make the default version table
122
- # one of the suffixed tables : code which doesn't use Model.table_name
123
- # will fail
124
- suffixed_table_names.first
125
- end
118
+ # no longer use a different table name for test environments...
119
+ # it makes a mess with named scopes
120
+ base_table_name
126
121
  end
127
122
 
128
123
  # name of the active table read direct from db
@@ -198,6 +193,7 @@ module ActiveRecord
198
193
  begin
199
194
  self.active_working_table_name = working_table_name
200
195
  ensure_version_table(working_table_name)
196
+ connection.execute("truncate table #{working_table_name}")
201
197
  r = block.call
202
198
  advance_version
203
199
  r
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord_worm_table
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mccraig mccraig of the clan mccraig
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-15 00:00:00 +01:00
12
+ date: 2010-02-17 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency