ika 1.0.9 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/ika.rb +2 -2
- data/lib/ika/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: 0b679ead83c1241604f025295599823f7c68ee35
|
4
|
+
data.tar.gz: 25912adcc7557199a593c5a1e1d5b0a8131021b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 762e15750fe49a33caa15cf7cd1e7225f26fb61265776ae39b3ec6e7fea832a778e6d15332d90583516dfd3754d67ff5310fede62098d82402b008c052e30335
|
7
|
+
data.tar.gz: a5256e9347cad3333c4a104612cf5ed6343f0670282eacd09d857a8d2e02e5147519f9e5e9ebcd3d177cfcf5281a99b2d7a9e58c8e75c48bb65eebba0b4bf349
|
data/README.md
CHANGED
@@ -79,6 +79,7 @@ User.exist?(id: 2)
|
|
79
79
|
* **DO NOT USE sync mode if you are using `include` option.**
|
80
80
|
* If the same id exists, Ika uses `UPDATE`.
|
81
81
|
* Uploaded files by `carrierwave` will be checked their md5 hash and do nothing if they exist and md5 is matched.
|
82
|
+
* If already exists `import` or `export` methods, you can use `ika_import` or `ika_export` methods.
|
82
83
|
|
83
84
|
## License
|
84
85
|
|
data/lib/ika.rb
CHANGED
@@ -90,14 +90,14 @@ module Ika
|
|
90
90
|
|
91
91
|
whole_obj_arr = []
|
92
92
|
objects.each do |object|
|
93
|
-
obj_arr =
|
93
|
+
obj_arr = JSON.parse(object.to_json)
|
94
94
|
options[:include].each do |relation|
|
95
95
|
if relation.is_a?(::Hash)
|
96
96
|
relation.keys.each do |property|
|
97
97
|
obj_arr[property] = JSON.parse(object.try(property).export({include: relation[property]}, object.try(property)))
|
98
98
|
end
|
99
99
|
elsif relation.is_a?(Symbol)
|
100
|
-
obj_arr[relation] = JSON.parse(object.try(
|
100
|
+
obj_arr[relation] = JSON.parse(object.try(relation).present? ? object.try(relation).to_json : '[]')
|
101
101
|
end
|
102
102
|
end
|
103
103
|
whole_obj_arr.push(obj_arr)
|
data/lib/ika/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ika
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Makoto NAKAYA
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|