standardapi 1.0.14 → 1.0.15
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: f892bfaae15d0e0561eedcf89269ff98d18f2044
|
4
|
+
data.tar.gz: c9e734b482f12719dae0b6da8d384aadf64ac02c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c749360b6a4ceb688dbb0914bccf1c0d4680304a682e1fd57bd7a221552a8731ae3c93fd5f15de2ea6f4f46ae0c1101cc8ca652392553d795799e1f9d873061
|
7
|
+
data.tar.gz: 548a8a618e9769b88ba0bab84e921ab0fdd4e36a8c04b3f7cc8958f1927c3e689c29b512f6398402e247363ed4b5090e4c5a7840ef9282c794516ae0d8541e68
|
data/README.md
CHANGED
@@ -79,10 +79,20 @@ module StandardAPI
|
|
79
79
|
end
|
80
80
|
else
|
81
81
|
m = assigns(:record).send(included).first.try(:reload)
|
82
|
+
|
83
|
+
m_json = if m && m.has_attribute?(:id)
|
84
|
+
json[included.to_s].find { |x| x['id'] == normalize_to_json(m, :id, m.id) }
|
85
|
+
elsif m
|
86
|
+
json[included.to_s].find { |x| x.keys.all? { |key| x[key] == normalize_to_json(m, key, m[key]) } }
|
87
|
+
else
|
88
|
+
nil
|
89
|
+
end
|
90
|
+
|
82
91
|
view_attributes(m).each do |key, value|
|
83
92
|
message = "Model / Attribute: #{m.class.name}##{key}"
|
84
|
-
assert_equal normalize_to_json(m, key, value)
|
93
|
+
assert_equal m_json[key.to_s], normalize_to_json(m, key, value)
|
85
94
|
end
|
95
|
+
|
86
96
|
end
|
87
97
|
end
|
88
98
|
end
|
@@ -56,10 +56,20 @@ module StandardAPI
|
|
56
56
|
end
|
57
57
|
else
|
58
58
|
m = assigns(:records).first.send(included).first.try(:reload)
|
59
|
+
|
60
|
+
m_json = if m && m.has_attribute?(:id)
|
61
|
+
json[included.to_s].find { |x| x['id'] == normalize_to_json(m, :id, m.id) }
|
62
|
+
elsif m
|
63
|
+
json[included.to_s].find { |x| x.keys.all? { |key| x[key] == normalize_to_json(m, key, m[key]) } }
|
64
|
+
else
|
65
|
+
nil
|
66
|
+
end
|
67
|
+
|
59
68
|
view_attributes(m).each do |key, value|
|
60
69
|
message = "Model / Attribute: #{m.class.name}##{key}"
|
61
|
-
assert_equal
|
70
|
+
assert_equal m_json[key.to_s], normalize_to_json(m, key, value)
|
62
71
|
end
|
72
|
+
|
63
73
|
end
|
64
74
|
end
|
65
75
|
end
|
@@ -30,10 +30,20 @@ module StandardAPI
|
|
30
30
|
end
|
31
31
|
else
|
32
32
|
m = assigns(:record).send(included).first.try(:reload)
|
33
|
+
|
34
|
+
m_json = if m && m.has_attribute?(:id)
|
35
|
+
json[included.to_s].find { |x| x['id'] == normalize_to_json(m, :id, m.id) }
|
36
|
+
elsif m
|
37
|
+
json[included.to_s].find { |x| x.keys.all? { |key| x[key] == normalize_to_json(m, key, m[key]) } }
|
38
|
+
else
|
39
|
+
nil
|
40
|
+
end
|
41
|
+
|
33
42
|
view_attributes(m).each do |key, value|
|
34
43
|
message = "Model / Attribute: #{m.class.name}##{key}"
|
35
|
-
assert_equal normalize_to_json(m, key, value)
|
44
|
+
assert_equal m_json[key.to_s], normalize_to_json(m, key, value)
|
36
45
|
end
|
46
|
+
|
37
47
|
end
|
38
48
|
end
|
39
49
|
end
|
@@ -65,10 +65,19 @@ module StandardAPI
|
|
65
65
|
end
|
66
66
|
else
|
67
67
|
m = assigns(:record).send(included).first.try(:reload)
|
68
|
+
m_json = if m && m.has_attribute?(:id)
|
69
|
+
json[included.to_s].find { |x| x['id'] == normalize_to_json(m, :id, m.id) }
|
70
|
+
elsif m
|
71
|
+
json[included.to_s].find { |x| x.keys.all? { |key| x[key] == normalize_to_json(m, key, m[key]) } }
|
72
|
+
else
|
73
|
+
nil
|
74
|
+
end
|
75
|
+
|
68
76
|
view_attributes(m).each do |key, value|
|
69
77
|
message = "Model / Attribute: #{m.class.name}##{key}"
|
70
|
-
assert_equal normalize_to_json(
|
78
|
+
assert_equal m_json[key.to_s], normalize_to_json(m, key, value)
|
71
79
|
end
|
80
|
+
|
72
81
|
end
|
73
82
|
end
|
74
83
|
end
|