bulk_update 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -187,10 +187,13 @@ module BulkUpdate
|
|
187
187
|
conditions << "#{args[:condition].gsub('--tt--', model.table_name)} AND #{args[:condition].gsub('--tt--', compare_table)}" if args[:condition]
|
188
188
|
model.attribute_names.each do |an|
|
189
189
|
unless exclude.include?(an)
|
190
|
-
|
191
|
-
|
190
|
+
case ActiveRecord::Base.connection_config[:adapter]
|
191
|
+
when /mysql?/
|
192
|
+
conditions2 << "NOT #{model.table_name}.#{an} <=> #{compare_table}.#{an}"
|
193
|
+
when 'postgresql'
|
194
|
+
conditions2 << "#{model.table_name}.#{an} IS DISTINCT FROM #{compare_table}.#{an}"
|
192
195
|
else
|
193
|
-
conditions2 << "NOT (#{model.table_name}.#{an}
|
196
|
+
conditions2 << "(#{model.table_name}.#{an} IS NOT NULL AND #{compare_table}.#{an} IS NOT NULL AND #{model.table_name}.#{an} != #{compare_table}.#{an}) OR (#{model.table_name}.#{an} IS NOT NULL AND #{compare_table}.#{an} IS NULL) OR (#{model.table_name}.#{an} IS NULL AND #{compare_table}.#{an} IS NOT NULL)"
|
194
197
|
end
|
195
198
|
end
|
196
199
|
end
|
data/lib/bulk_update/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bulk_update
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02
|
12
|
+
date: 2013-05-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|