mover 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -1
- data/lib/mover.rb +5 -1
- data/lib/mover/version.rb +1 -1
- 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
|
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
|
)
|
data/lib/mover.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/mover/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
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-
|
17
|
+
date: 2010-12-05 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|