active_record-json_associations 0.6.2 → 0.6.3
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f910924a4b7db4fbb8b85ae587d920bd6d3dd443
|
|
4
|
+
data.tar.gz: 29b868a54bf20c8a0aac20273d0b03555bb7dd44
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3fdbaf90f761a9c81cc43468abc4b6c004e3c1ddac60be7eb97420f4b65e930dffc80ba09b320614006ae07934a0d5549772947e50d0f56f6d9b21722963ccbc
|
|
7
|
+
data.tar.gz: b1675d6693fb78632dfef7a9c021fad62370ed0068bbefd7fd16f1690cb16d22296617a12d856f23eaad562bb0ccc4337556c92bd9005cbd88677e61636a1e84
|
|
@@ -39,7 +39,7 @@ module ActiveRecord
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def has_many many, scope = nil, options = {}, &extension
|
|
42
|
-
unless scope.
|
|
42
|
+
unless (scope.is_a?(Hash) && scope[:json_foreign_key]) || (options.is_a?(Hash) && options[:json_foreign_key])
|
|
43
43
|
return super
|
|
44
44
|
end
|
|
45
45
|
|
|
@@ -28,6 +28,11 @@ describe ActiveRecord::JsonAssociations do
|
|
|
28
28
|
|
|
29
29
|
class Pet < ActiveRecord::Base
|
|
30
30
|
has_many :parents, json_foreign_key: :fuzzy_ids
|
|
31
|
+
|
|
32
|
+
# ensure that regular .has_many invocations still work
|
|
33
|
+
has_many :fallback_parents
|
|
34
|
+
has_many :fallback_parents_with_options, class_name: "Pet"
|
|
35
|
+
has_many :fallback_parents_with_scope, -> { order(:id) }
|
|
31
36
|
end
|
|
32
37
|
end
|
|
33
38
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_record-json_associations
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Micah Geisel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-03-
|
|
11
|
+
date: 2017-03-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|