activerecord-import 0.20.1 → 0.20.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/activerecord-import/synchronize.rb +1 -1
- data/lib/activerecord-import/version.rb +1 -1
- data/test/models/topic.rb +2 -0
- data/test/synchronize_test.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aedb604a103a355bb35e3373239fb12e1e9877cd
|
4
|
+
data.tar.gz: 235a13a5819d9181aaa478686ec42596c54806fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e9349db11dd48246fb292215d4dd43efd2c8fe0c2e544e6fa585d4ad0aa7eb2ba612d8b7a84bbbaf991958b8c7897135314c6e73b4520d05a31861ec68ba5e7
|
7
|
+
data.tar.gz: 58de95004307eb2cfe48d0a6e534313612ed90c69df08e1bdb0372cb065d857189d23fa12552d652d0fbfb4a7ba91cedcba8c7c14c44dfd72c5bff26442bf0bd
|
data/CHANGELOG.md
CHANGED
@@ -31,7 +31,7 @@ module ActiveRecord # :nodoc:
|
|
31
31
|
|
32
32
|
klass = instances.first.class
|
33
33
|
|
34
|
-
fresh_instances = klass.where(conditions).order(order)
|
34
|
+
fresh_instances = klass.unscoped.where(conditions).order(order)
|
35
35
|
instances.each do |instance|
|
36
36
|
matched_instance = fresh_instances.detect do |fresh_instance|
|
37
37
|
keys.all? { |key| fresh_instance.send(key) == instance.send(key) }
|
data/test/models/topic.rb
CHANGED
data/test/synchronize_test.rb
CHANGED
@@ -30,4 +30,12 @@ describe ".synchronize" do
|
|
30
30
|
assert_equal false, topics[1].changed?, "the second record was dirty"
|
31
31
|
assert_equal false, topics[2].changed?, "the third record was dirty"
|
32
32
|
end
|
33
|
+
|
34
|
+
it "ignores default scope" do
|
35
|
+
# update records outside of ActiveRecord knowing about it
|
36
|
+
Topic.connection.execute( "UPDATE #{Topic.table_name} SET approved='0' WHERE id=#{topics[0].id}", "Updating record 1 without ActiveRecord" )
|
37
|
+
|
38
|
+
Topic.synchronize topics
|
39
|
+
assert_equal false, topics[0].approved
|
40
|
+
end
|
33
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-import
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zach Dennis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|