activerecord-batch_touching 1.1 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/activerecord/batch_touching/version.rb +1 -1
- data/lib/activerecord/batch_touching.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a79724b8d5920ced2e53071d67a37739bd098a6f66080c60a831d056c1fe4d2
|
4
|
+
data.tar.gz: 3ee4356cdc64f37ed0349f2f6e39c648f2013c04762021cb19959b3a9ac89b20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c72e5f701b3573d121c9034f2e5751821b8b129c3411584ada3b6fff0b2e12ac52b717128b257808ce54416588dfea4b3dcc597e2e375fda31b0757cf599d770
|
7
|
+
data.tar.gz: 61cf15c6e237c604347af26f37c1033fdb2e895a5ead9e01078b706e73a0642a332795828c7ca81b4e17628bd81dd9385e7e3bfea2005f6b66f012347d07fa74
|
@@ -178,7 +178,8 @@ module ActiveRecord
|
|
178
178
|
sql = columns.map { |column| "#{klass.connection.quote_column_name(column)} = :time" }.join(", ")
|
179
179
|
sql += ", #{klass.locking_column} = #{klass.locking_column} + 1" if klass.locking_enabled?
|
180
180
|
|
181
|
-
|
181
|
+
ids = records.map { |record| record.send(klass.primary_key) }.sort
|
182
|
+
klass.unscoped.where(klass.primary_key => ids).update_all([sql, time: time])
|
182
183
|
end
|
183
184
|
|
184
185
|
# Set new timestamp in memory, without updating the DB just yet.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-batch_touching
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Morearty
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-07-
|
12
|
+
date: 2022-07-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|