mover 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/mover.rb +12 -2
  2. data/lib/mover/version.rb +1 -1
  3. metadata +3 -3
@@ -96,7 +96,11 @@ module Mover
96
96
  SQL
97
97
  elsif !options[:generic] && connection.class.to_s.include?('Mysql')
98
98
  update = insert.collect do |i|
99
- "#{to_class.table_name}.#{i} = #{from_class.table_name}.#{i}"
99
+ if i.include?("'")
100
+ "#{to_class.table_name}.#{i} = #{i}"
101
+ else
102
+ "#{to_class.table_name}.#{i} = #{from_class.table_name}.#{i}"
103
+ end
100
104
  end
101
105
 
102
106
  connection.execute(<<-SQL)
@@ -111,7 +115,13 @@ module Mover
111
115
  conditions.gsub!(to_class.table_name, 't')
112
116
  conditions.gsub!(from_class.table_name, 'f')
113
117
  select.collect! { |s| s.include?('`') ? "f.#{s}" : s }
114
- set = insert.collect { |i| "t.#{i} = f.#{i}" }
118
+ set = insert.collect do |i|
119
+ if i.include?("'")
120
+ "t.#{i} = #{i}"
121
+ else
122
+ "t.#{i} = f.#{i}"
123
+ end
124
+ end
115
125
 
116
126
  connection.execute(<<-SQL)
117
127
  UPDATE #{to_class.table_name}
@@ -1,3 +1,3 @@
1
1
  module Mover
2
- VERSION = "0.3.1" unless defined?(::Mover::VERSION)
2
+ VERSION = "0.3.2" 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
- - 1
9
- version: 0.3.1
8
+ - 2
9
+ version: 0.3.2
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-05 00:00:00 -08:00
17
+ date: 2010-12-12 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency