syncable_models 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/syncable_models/importer.rb +4 -2
- data/lib/syncable_models/version.rb +1 -1
- data/test/dummy/log/test.log +7 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWEzMmMwODJhOWE0MDNmM2QwMWU3MjA5ZTg5YTU4YTQ5NTkzMjg2NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDg3OWFmZTVhYTVmNzM1MDI4NmJkYjY5NGI3NjJlZWNkNzA2YjRlYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjJjOTIxNTVlNzllMDdmYjllNzNiZTA5YzA3ZjE0ZDBlZTkzY2IzOGFkMzM4
|
10
|
+
MWUwNjdhY2MxYzA1ZTdhMGJjNzY2NmQzM2JlYzZlYmE0OTUwODNhNmQzNjY0
|
11
|
+
NWE2MGVlOTEyNzVmYzkyOWRhNGE5NWViMjU2YjExZDMwYTIxODM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzE5MDRhNjIzOTI4NDU5YjZlMTBkZDliNWZjZWYxNzM0ZmU3NThhOTQ5YjJl
|
14
|
+
Yjc3Zjk2ZjAwZjM3ZDZmYzE2YmZkMzMxMDJjNGE0ZTQ4YWYxM2I5ZTUzYmIz
|
15
|
+
YjYwYWNjNWZlYjJkNjMwM2MxNzUxMjE0OTA5M2JkNzZjZTlhOTU=
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'faraday'
|
2
|
+
load 'tasks/syncable_models.rake'
|
2
3
|
|
3
4
|
module SyncableModels
|
4
5
|
module Importer
|
@@ -61,9 +62,10 @@ module SyncableModels
|
|
61
62
|
synced_ids = []
|
62
63
|
|
63
64
|
response['objects'].each do |o|
|
65
|
+
id = o[params[:id_key].to_s]
|
64
66
|
result = klass.from_import_hash(o)
|
65
|
-
puts "[SyncableModels::Importer] Importing #{model_name} (id=#{
|
66
|
-
synced_ids <<
|
67
|
+
puts "[SyncableModels::Importer] Importing #{model_name} (id=#{id}): #{ result ? 'OK' : 'FAIL' }"
|
68
|
+
synced_ids << id if result
|
67
69
|
end
|
68
70
|
|
69
71
|
if synced_ids.any?
|
data/test/dummy/log/test.log
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
[1m[36m (
|
2
|
-
[1m[35m (0.
|
3
|
-
[1m[36m (
|
1
|
+
[1m[36m (3.0ms)[0m [1mCREATE TABLE "syncs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "subject_id" integer, "subject_type" varchar, "destination" varchar, "created_at" datetime, "updated_at" datetime) [0m
|
2
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3
|
+
[1m[36m (1.9ms)[0m [1mCREATE INDEX "index_syncs_on_destination" ON "syncs" ("destination")[0m
|
4
4
|
[1m[35m (0.1ms)[0m SELECT sql
|
5
5
|
FROM sqlite_master
|
6
6
|
WHERE name='index_syncs_on_destination' AND type='index'
|
@@ -9,11 +9,11 @@
|
|
9
9
|
FROM sqlite_temp_master
|
10
10
|
WHERE name='index_syncs_on_destination' AND type='index'
|
11
11
|
|
12
|
-
[1m[36m (2.
|
13
|
-
[1m[35m (
|
14
|
-
[1m[36m (
|
12
|
+
[1m[36m (2.1ms)[0m [1mCREATE INDEX "index_syncs_on_subject_id_and_subject_type_and_destination" ON "syncs" ("subject_id", "subject_type", "destination")[0m
|
13
|
+
[1m[35m (1.8ms)[0m CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
|
14
|
+
[1m[36m (2.0ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
15
15
|
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
16
|
-
[1m[36m (
|
16
|
+
[1m[36m (1.4ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20160225141153')[0m
|
17
17
|
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
18
18
|
[1m[35m (0.2ms)[0m begin transaction
|
19
19
|
------------------------------
|