synchronisable 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9f2e26970dfe050c9902385f60c2dcbc7d54448
4
- data.tar.gz: dd2ee445a9f95ea088cf7ec84136312cafc71c6e
3
+ metadata.gz: 2c1f748803a02f7c1b7b95b242e770cc7032a84f
4
+ data.tar.gz: c51b4721c09630040b4ea819253164d79773dbec
5
5
  SHA512:
6
- metadata.gz: 86838267edeb7919d1e379ce58e9a26620eb9da69757731d4e8d2b484d02cfc12984cf9ea65fcf373a499d6f52bc4d79a7b489c1bdaf4ab97560cc1017c64e7d
7
- data.tar.gz: 2982a13a2ab1d01778cd4829f2666d261dc4f0b40da7f2dc97ce39aa21ce9cb77e913f2c8ed698347a354aa27945a87bc750ac19968c3ac818508c7f2051f32f
6
+ metadata.gz: 25eea98055394b60662658fb346911113d476aede530686f20a8dc538cdec28c5ebde7afa7ce8eb4c31afb5ed2c70dc5dfeddc4cc3d24c894c548a2f3ad63d56
7
+ data.tar.gz: 35cedc621888df0858b7825e6b2b8041c21986e92cd2a7434ebb117fb68c21bde79d34295e52168e17f74928523c118ed42fb29b89cc3121190168e99e0236ff
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  # Synchronisable
9
9
 
10
- ### :construction: this README & docs are work in progress :construction:
10
+ ### :construction: work in progress :construction:
11
11
 
12
12
  ## Overview
13
13
 
@@ -7,7 +7,7 @@ class CreateImports < ActiveRecord::Migration
7
7
  t.string :remote_id, null: false
8
8
  t.string :unique_id
9
9
 
10
- t.timestamps
10
+ t.timestamps null: false
11
11
  end
12
12
 
13
13
  add_index :imports, :remote_id
@@ -10,7 +10,7 @@ Synchronisable.configure do |config|
10
10
  # :colorize => true
11
11
  # }
12
12
 
13
- # If you want to restrict synchronized models.
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
 
@@ -2,7 +2,7 @@ module Synchronisable
2
2
  module VERSION
3
3
  MAJOR = 1
4
4
  MINOR = 2
5
- PATCH = 0
5
+ PATCH = 1
6
6
  SUFFIX = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, SUFFIX].compact.join('.')
@@ -2,11 +2,11 @@ require 'synchronisable/gateway'
2
2
 
3
3
  class GatewayBase < Synchronisable::Gateway
4
4
  def id_key
5
- not_implemented :id_key
5
+ not_implemented! :id_key
6
6
  end
7
7
 
8
8
  def source
9
- not_implemented :source
9
+ not_implemented! :source
10
10
  end
11
11
 
12
12
  def fetch(params)
@@ -66,7 +66,7 @@ describe Team do
66
66
  end
67
67
  end
68
68
 
69
- context 'when there is 2 imports with corresponding local records' do
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.0
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: 2014-10-21 00:00:00.000000000 Z
11
+ date: 2015-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord