syncable_models 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +1 -1
- data/Rakefile +4 -14
- data/app/models/syncable_models/sync.rb +22 -0
- data/db/migrate/20160225141153_create_syncs.rb +5 -1
- data/lib/syncable_models/active_record.rb +20 -7
- data/lib/syncable_models/controller.rb +25 -6
- data/lib/syncable_models/engine.rb +5 -0
- data/lib/syncable_models/importer.rb +54 -23
- data/lib/syncable_models/syncable.rb +20 -0
- data/lib/syncable_models/version.rb +1 -1
- data/lib/syncable_models.rb +1 -0
- data/lib/tasks/syncable_models.rake +2 -2
- data/spec/controllers/syncable_models/import_api_controller_spec.rb +101 -0
- data/{test → spec}/dummy/README.rdoc +0 -0
- data/{test → spec}/dummy/Rakefile +0 -0
- data/{test → spec}/dummy/app/assets/javascripts/application.js +0 -0
- data/{test → spec}/dummy/app/assets/stylesheets/application.css +0 -0
- data/{test → spec}/dummy/app/controllers/application_controller.rb +0 -0
- data/spec/dummy/app/controllers/import_api_controller.rb +6 -0
- data/{test → spec}/dummy/app/helpers/application_helper.rb +0 -0
- data/spec/dummy/app/models/project.rb +12 -0
- data/spec/dummy/app/models/team.rb +12 -0
- data/{test → spec}/dummy/app/views/layouts/application.html.erb +0 -0
- data/{test → spec}/dummy/bin/bundle +0 -0
- data/{test → spec}/dummy/bin/rails +0 -0
- data/{test → spec}/dummy/bin/rake +0 -0
- data/{test → spec}/dummy/bin/setup +0 -0
- data/{test → spec}/dummy/config/application.rb +7 -1
- data/{test → spec}/dummy/config/boot.rb +0 -0
- data/{test → spec}/dummy/config/database.yml +0 -0
- data/{test → spec}/dummy/config/environment.rb +0 -0
- data/{test → spec}/dummy/config/environments/development.rb +0 -0
- data/{test → spec}/dummy/config/environments/production.rb +0 -0
- data/{test → spec}/dummy/config/environments/test.rb +0 -0
- data/{test → spec}/dummy/config/initializers/assets.rb +0 -0
- data/{test → spec}/dummy/config/initializers/backtrace_silencers.rb +0 -0
- data/{test → spec}/dummy/config/initializers/cookies_serializer.rb +0 -0
- data/{test → spec}/dummy/config/initializers/filter_parameter_logging.rb +0 -0
- data/{test → spec}/dummy/config/initializers/inflections.rb +0 -0
- data/{test → spec}/dummy/config/initializers/mime_types.rb +0 -0
- data/{test → spec}/dummy/config/initializers/session_store.rb +0 -0
- data/{test → spec}/dummy/config/initializers/wrap_parameters.rb +0 -0
- data/{test → spec}/dummy/config/locales/en.yml +0 -0
- data/spec/dummy/config/routes.rb +11 -0
- data/{test → spec}/dummy/config/secrets.yml +0 -0
- data/{test → spec}/dummy/config.ru +0 -0
- data/spec/dummy/db/migrate/20160327104327_create_projects.rb +13 -0
- data/spec/dummy/db/migrate/20160327111225_create_teams.rb +9 -0
- data/spec/dummy/db/migrate/20160327154807_create_syncs.syncable_models.rb +19 -0
- data/{test → spec}/dummy/db/schema.rb +23 -2
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +819 -0
- data/{test → spec}/dummy/public/404.html +0 -0
- data/{test → spec}/dummy/public/422.html +0 -0
- data/{test → spec}/dummy/public/500.html +0 -0
- data/{test → spec}/dummy/public/favicon.ico +0 -0
- data/spec/dummy/spec/factories/projects.rb +21 -0
- data/spec/dummy/spec/factories/teams.rb +17 -0
- data/spec/models/syncable_models/importer/import_spec.rb +104 -0
- data/spec/models/syncable_models/sync_spec.rb +106 -0
- data/spec/rails_helper.rb +19 -0
- data/spec/spec_helper.rb +85 -0
- data/{test → spec}/syncable_models_test.rb +0 -0
- metadata +106 -80
- data/test/dummy/config/routes.rb +0 -4
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +0 -22
- data/test/test_helper.rb +0 -21
@@ -0,0 +1,19 @@
|
|
1
|
+
# This migration comes from syncable_models (originally 20160225141153)
|
2
|
+
class CreateSyncs < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :syncs do |t|
|
5
|
+
t.integer :subject_id
|
6
|
+
t.string :subject_type
|
7
|
+
t.string :destination, null: false
|
8
|
+
|
9
|
+
t.string :subject_external_id, null: false
|
10
|
+
t.boolean :subject_destroyed, null: false, default: false
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
|
15
|
+
add_index :syncs, [:subject_id, :subject_type, :destination]
|
16
|
+
add_index :syncs, :destination
|
17
|
+
add_index :syncs, [:subject_external_id, :subject_destroyed]
|
18
|
+
end
|
19
|
+
end
|
@@ -11,17 +11,38 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20160327154807) do
|
15
|
+
|
16
|
+
create_table "projects", force: :cascade do |t|
|
17
|
+
t.string "name", null: false
|
18
|
+
t.string "uuid", null: false
|
19
|
+
t.datetime "deleted_at"
|
20
|
+
t.string "external_id"
|
21
|
+
t.datetime "created_at", null: false
|
22
|
+
t.datetime "updated_at", null: false
|
23
|
+
end
|
24
|
+
|
25
|
+
add_index "projects", ["uuid"], name: "index_projects_on_uuid", unique: true
|
15
26
|
|
16
27
|
create_table "syncs", force: :cascade do |t|
|
17
28
|
t.integer "subject_id"
|
18
29
|
t.string "subject_type"
|
19
|
-
t.string "destination"
|
30
|
+
t.string "destination", null: false
|
31
|
+
t.string "subject_external_id", null: false
|
32
|
+
t.boolean "subject_destroyed", default: false, null: false
|
20
33
|
t.datetime "created_at"
|
21
34
|
t.datetime "updated_at"
|
22
35
|
end
|
23
36
|
|
24
37
|
add_index "syncs", ["destination"], name: "index_syncs_on_destination"
|
38
|
+
add_index "syncs", ["subject_external_id", "subject_destroyed"], name: "index_syncs_on_subject_external_id_and_subject_destroyed"
|
25
39
|
add_index "syncs", ["subject_id", "subject_type", "destination"], name: "index_syncs_on_subject_id_and_subject_type_and_destination"
|
26
40
|
|
41
|
+
create_table "teams", force: :cascade do |t|
|
42
|
+
t.string "name", null: false
|
43
|
+
t.string "external_id"
|
44
|
+
t.datetime "created_at", null: false
|
45
|
+
t.datetime "updated_at", null: false
|
46
|
+
end
|
47
|
+
|
27
48
|
end
|
Binary file
|