synchronisable 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/generators/synchronisable/templates/create_imports_migration.rb +1 -1
- data/lib/generators/synchronisable/templates/initializer.rb +4 -1
- data/lib/synchronisable/gateway.rb +3 -3
- data/lib/synchronisable/source.rb +2 -2
- data/lib/synchronisable/version.rb +1 -1
- data/spec/dummy/app/gateways/gateway_base.rb +2 -2
- data/spec/models/team_spec.rb +1 -1
- 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: 2c1f748803a02f7c1b7b95b242e770cc7032a84f
|
4
|
+
data.tar.gz: c51b4721c09630040b4ea819253164d79773dbec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25eea98055394b60662658fb346911113d476aede530686f20a8dc538cdec28c5ebde7afa7ce8eb4c31afb5ed2c70dc5dfeddc4cc3d24c894c548a2f3ad63d56
|
7
|
+
data.tar.gz: 35cedc621888df0858b7825e6b2b8041c21986e92cd2a7434ebb117fb68c21bde79d34295e52168e17f74928523c118ed42fb29b89cc3121190168e99e0236ff
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Synchronisable.configure do |config|
|
|
10
10
|
# :colorize => true
|
11
11
|
# }
|
12
12
|
|
13
|
-
#
|
13
|
+
# You can restrict synchronized models by specifying their class names.
|
14
14
|
# By default it will try to sync all models that have
|
15
15
|
# a `synchronisable` dsl instruction.
|
16
16
|
#
|
@@ -18,5 +18,8 @@ Synchronisable.configure do |config|
|
|
18
18
|
|
19
19
|
# What to do with an associated import record
|
20
20
|
# when its synchronisable is destroyed. Default is `:destroy`.
|
21
|
+
# For other available options see:
|
22
|
+
# http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
|
23
|
+
#
|
21
24
|
# config.dependent_import = :destroy
|
22
25
|
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
module Synchronisable
|
2
2
|
class Gateway
|
3
3
|
def fetch(params = {})
|
4
|
-
not_implemented :fetch
|
4
|
+
not_implemented! :fetch
|
5
5
|
end
|
6
6
|
|
7
7
|
def find(params)
|
8
|
-
not_implemented :find
|
8
|
+
not_implemented! :find
|
9
9
|
end
|
10
10
|
|
11
11
|
protected
|
12
12
|
|
13
|
-
def not_implemented(method)
|
13
|
+
def not_implemented!(method)
|
14
14
|
raise NotImplementedError,
|
15
15
|
I18n.t('errors.gateway_method_missing', method: method)
|
16
16
|
end
|
@@ -49,14 +49,14 @@ module Synchronisable
|
|
49
49
|
def find_import_by_unique_id
|
50
50
|
Import.find_by(
|
51
51
|
unique_id: @unique_id.to_s,
|
52
|
-
synchronisable_type: @model
|
52
|
+
synchronisable_type: @model.to_s
|
53
53
|
)
|
54
54
|
end
|
55
55
|
|
56
56
|
def find_import_by_remote_id
|
57
57
|
Import.find_by(
|
58
58
|
remote_id: @remote_id.to_s,
|
59
|
-
synchronisable_type: @model
|
59
|
+
synchronisable_type: @model.to_s
|
60
60
|
)
|
61
61
|
end
|
62
62
|
|
data/spec/models/team_spec.rb
CHANGED
@@ -66,7 +66,7 @@ describe Team do
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
context 'when there
|
69
|
+
context 'when there are 2 imports with corresponding local records' do
|
70
70
|
include_context 'team imports'
|
71
71
|
|
72
72
|
context 'when local id is specified' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synchronisable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vasiliy Yorkin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|