ika 1.0.0 → 1.0.1
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 -4
- data/lib/ika/version.rb +1 -1
- data/lib/ika.rb +9 -4
- 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: 445850d5ed265759a2d0fbf1e139ea2af728b2d2
|
4
|
+
data.tar.gz: ae8be98de4260f41331a00be42991cb6b7922a4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b05f0fa66d21a8521298d4118ff59e615712c5c9bd5c546d0d9106c0d1f44e55f04eade81b7edf01b7f490a010ee15d4d226dc1b457e7cc6a667c59b5bb00106
|
7
|
+
data.tar.gz: 5e49528daa04168f46033066a439f0a0fffe1a89d11066e7e9ed17f6b4a79c3c349d5a7bfea7675d61331f6ac4a22189e7b737a35ed8417cfeff3136ac991926
|
data/README.md
CHANGED
@@ -76,13 +76,10 @@ User.exist?(id: 2)
|
|
76
76
|
|
77
77
|
## Others
|
78
78
|
|
79
|
+
* **DO NOT USE sync mode if you are using `include` option.**
|
79
80
|
* If the same id exists, Ika uses `UPDATE`.
|
80
81
|
* Uploaded files by `carrierwave` will be checked their md5 hash and do nothing if they exist and md5 is matched.
|
81
82
|
|
82
|
-
## Not yet implemented features
|
83
|
-
|
84
|
-
* Sync mode (If class method `import` is called with sync mode, delete all data that are not contained exporting json)
|
85
|
-
|
86
83
|
## License
|
87
84
|
|
88
85
|
Copyright (c) 2015 Aqutras
|
data/lib/ika/version.rb
CHANGED
data/lib/ika.rb
CHANGED
@@ -34,11 +34,16 @@ module Ika
|
|
34
34
|
else
|
35
35
|
if new.try(key.to_sym).class.superclass == CarrierWave::Uploader::Base
|
36
36
|
need_update = true
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
obj_url = object[key]['url'] || object[key][:url]
|
38
|
+
obj_md5 = object[key]['md5'] || object[key][:md5]
|
39
|
+
obj_data = object[key]['data'] || object[key][:data]
|
40
|
+
obj_name = object[key]['name'] || object[key][:name]
|
41
|
+
if obj_url && File.exist?('public' + obj_url)
|
42
|
+
md5 = Digest::MD5.file('public' + obj_url)
|
43
|
+
need_update = false if md5 == obj_md5 && record_exists == true
|
44
|
+
elsif obj_url
|
45
|
+
object_params[key] = base64_conversion(obj_data, obj_name) if need_update
|
40
46
|
end
|
41
|
-
object_params[key] = base64_conversion(object[key]['data'], object[key]['name']) if need_update
|
42
47
|
else
|
43
48
|
object_params[key] = object[key]
|
44
49
|
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.
|
4
|
+
version: 1.0.1
|
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: 2015-07-
|
12
|
+
date: 2015-07-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|