ika 1.0.9 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/lib/ika.rb +2 -2
  4. data/lib/ika/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1dab61ca98c6d97af927448afd52dcfaf5310bd
4
- data.tar.gz: 3df6fffe9fdb0f0585032180d0ef8ccdde1daff8
3
+ metadata.gz: 0b679ead83c1241604f025295599823f7c68ee35
4
+ data.tar.gz: 25912adcc7557199a593c5a1e1d5b0a8131021b6
5
5
  SHA512:
6
- metadata.gz: 313887f19ab40584f035f4cfdcc27e70037b36cf84183d2f7cdef6d19aae4fed3a866930b24ae50d878c1c1da20b117c7457f5c83500d8f9fa41ba50ed4c2a4a
7
- data.tar.gz: fdd26b3270ada82f0b167e8dfd838f692db45afc67bf2ab295277ec290cbcdd42fb75596265e6e736639bacc7d1b7bd628e9394b56fead02912ea65a05738647
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(:relation).to_json(include: relation))
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
@@ -1,3 +1,3 @@
1
1
  module Ika
2
- VERSION = '1.0.9'
2
+ VERSION = '1.0.10'
3
3
  end
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.9
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-01-08 00:00:00.000000000 Z
12
+ date: 2016-03-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails