mover 0.3.0 → 0.3.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.
Files changed (4) hide show
  1. data/README.md +2 -1
  2. data/lib/mover.rb +5 -1
  3. data/lib/mover/version.rb +1 -1
  4. metadata +3 -3
data/README.md CHANGED
@@ -79,8 +79,9 @@ There are other options, in addition to <code>conditions</code>:
79
79
  Article.move_to(
80
80
  ArticleArchive,
81
81
  :copy => true, # Do not delete Article after move
82
- :generic => true, # UPDATE using a JOIN instead of ON DUPLICATE KEY UPDATE (default on non-MySQL engines)
82
+ :generic => true, # UPDATE using a JOIN instead of ON DUPLICATE KEY UPDATE (default: false on MySQL engines)
83
83
  :magic => 'updated_at', # Custom magic column
84
+ :migrate => true, # Copies the original value of the magic column
84
85
  :quick => true # You are certain only INSERTs are necessary, no primary key collisions possible
85
86
  # May only be a little faster on MySQL, but dramatically faster on other engines
86
87
  )
@@ -46,7 +46,11 @@ module Mover
46
46
  # Magic columns
47
47
  if to_class.column_names.include?(magic)
48
48
  insert << connection.quote_column_name(magic)
49
- select << connection.quote(Time.now.utc)
49
+ if options[:migrate]
50
+ select << connection.quote_column_name(magic)
51
+ else
52
+ select << connection.quote(Time.now.utc)
53
+ end
50
54
  end
51
55
 
52
56
  # Callbacks
@@ -1,3 +1,3 @@
1
1
  module Mover
2
- VERSION = "0.3.0" unless defined?(::Mover::VERSION)
2
+ VERSION = "0.3.1" unless defined?(::Mover::VERSION)
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 0
9
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Winton Welsh
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-04 00:00:00 -08:00
17
+ date: 2010-12-05 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency