baseapi 0.1.26 → 0.1.27
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/lib/baseapi/active_record/relation_extension.rb +2 -2
- data/lib/baseapi/version.rb +1 -1
- 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: 22da57893ec046859ea2945046b0a04aa7588c62
|
4
|
+
data.tar.gz: f456bc0f3bea3c443a5ab80e8832f0f333fb43dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 132ea0d1d4c1623c9bf59f2bcc2fdeba3655015448e7c570aef6051b92bb2f85e89b163303e9be6da493ec914086899b3151229109d6dc940943a6ee997c5a7b
|
7
|
+
data.tar.gz: 739c0d09956805c14d83a11080519d34b849991cb7c159b4942d7321676f2fbe415c6732a0ec991694e07df29f6b76eb24ecfaf02aa20724d0df82d8bf8e71fb
|
@@ -17,7 +17,6 @@ module ActiveRecordRelationExtension
|
|
17
17
|
# belongs_to, has_many search
|
18
18
|
else
|
19
19
|
relationSearch = -> (models, currentModel, key, value, prefix = '', joins = []) {
|
20
|
-
joins.push key
|
21
20
|
associations = currentModel.get_associations()
|
22
21
|
associations.keys.each do |association|
|
23
22
|
if currentModel.column_names.include?(key)
|
@@ -29,11 +28,12 @@ module ActiveRecordRelationExtension
|
|
29
28
|
elsif associations[association].include?(key)
|
30
29
|
# prefix = first association
|
31
30
|
prefix = association if prefix == ''
|
31
|
+
joins.push key
|
32
32
|
models.joins_array!(joins)
|
33
33
|
currentModel = key.camelize.singularize.constantize
|
34
34
|
value.each do |k, v|
|
35
35
|
# this fnuction collback
|
36
|
-
|
36
|
+
relationSearch.call(models, currentModel, k, v, prefix, joins)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
data/lib/baseapi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baseapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moriyuki Arakawa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|