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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjM5MDVhOWMwZGRkMGIyMmI3NTI1NTNlZjk2ZTVmZWE5NzJmY2NkMA==
4
+ OWEzMmMwODJhOWE0MDNmM2QwMWU3MjA5ZTg5YTU4YTQ5NTkzMjg2NA==
5
5
  data.tar.gz: !binary |-
6
- OGI3NTFhOWI4OWNjZDYzZmE1YmYyZGNlNDNlYjcyMjgyMDllZWRlZA==
6
+ MDg3OWFmZTVhYTVmNzM1MDI4NmJkYjY5NGI3NjJlZWNkNzA2YjRlYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OWU5M2Q2NDA5MmE2NGUxNjI4ODQ5YjNjZjAxMjRkMjQ1NjYyMjhiYmU5MDlh
10
- NTFhMTIyZmMxNTZjYWIxNGY2YmY3OTBiMTcyZjczMWMxZTRhZjU4NzBiOGI4
11
- NDZjMjU2YWZjMzg2OWJlMzBkMjAyODVjNTRhOTdmNmQ1NTc4Y2U=
9
+ MjJjOTIxNTVlNzllMDdmYjllNzNiZTA5YzA3ZjE0ZDBlZTkzY2IzOGFkMzM4
10
+ MWUwNjdhY2MxYzA1ZTdhMGJjNzY2NmQzM2JlYzZlYmE0OTUwODNhNmQzNjY0
11
+ NWE2MGVlOTEyNzVmYzkyOWRhNGE5NWViMjU2YjExZDMwYTIxODM=
12
12
  data.tar.gz: !binary |-
13
- OWI5MjQzYjM4MDU4MTY0MzkyMGI3YTY5NTg1ZTY0YjYwOGFlMWRmOTEwN2Y1
14
- NzE2YTNmM2Q2Y2M5MjY1YzMzNDMyNTQ1NzM2N2JkOTZlNTVkNGFhZTA2ZmE3
15
- ZmZhMjZkYWI0MWQyNmRhM2UyM2JhZWQxOGUzNTNlNDViNTdlZjE=
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=#{o[params[:id_key].to_s]}): #{ result ? 'OK' : 'FAIL' }"
66
- synced_ids << o[params[:id_key].to_s] if result
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?
@@ -1,3 +1,3 @@
1
1
  module SyncableModels
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -1,6 +1,6 @@
1
-  (38.8ms) CREATE TABLE "syncs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "subject_id" integer, "subject_type" varchar, "destination" varchar, "created_at" datetime, "updated_at" datetime) 
2
-  (0.2ms) select sqlite_version(*)
3
-  (2.6ms) CREATE INDEX "index_syncs_on_destination" ON "syncs" ("destination")
1
+  (3.0ms) CREATE TABLE "syncs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "subject_id" integer, "subject_type" varchar, "destination" varchar, "created_at" datetime, "updated_at" datetime) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (1.9ms) CREATE INDEX "index_syncs_on_destination" ON "syncs" ("destination")
4
4
   (0.1ms) 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
-  (2.5ms) CREATE INDEX "index_syncs_on_subject_id_and_subject_type_and_destination" ON "syncs" ("subject_id", "subject_type", "destination")
13
-  (6.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
14
-  (4.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
12
+  (2.1ms) CREATE INDEX "index_syncs_on_subject_id_and_subject_type_and_destination" ON "syncs" ("subject_id", "subject_type", "destination")
13
+  (1.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
14
+  (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
15
15
   (0.1ms) SELECT version FROM "schema_migrations"
16
-  (7.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20160225141153')
16
+  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20160225141153')
17
17
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
18
18
   (0.2ms) begin transaction
19
19
  ------------------------------
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syncable_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serafim Nenarokov