activerecord_snapshot_view 0.11.0 → 0.11.1

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.11.0
1
+ 0.11.1
@@ -237,14 +237,16 @@ module ActiveRecord
237
237
  end
238
238
 
239
239
  # like new_version, but instead of an empty table you start with
240
- # a copy of the previous version
241
- def updated_version(&block)
240
+ # a copy of the previous version (if update=true)
241
+ def updated_version(update=true, &block)
242
242
  new_version do
243
- sql = <<-EOF
244
- insert into #{working_table_name}
245
- select * from #{active_table_name}
246
- EOF
247
- connection.execute(sql)
243
+ if update
244
+ sql = <<-EOF
245
+ insert into #{working_table_name}
246
+ select * from #{active_table_name}
247
+ EOF
248
+ connection.execute(sql)
249
+ end
248
250
  block.call
249
251
  end
250
252
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 11
8
- - 0
9
- version: 0.11.0
8
+ - 1
9
+ version: 0.11.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - mccraig mccraig of the clan mccraig