synchronisable 1.2.4 → 1.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 749d7fb93ed6999ea16377756790c8ea8509a7a4
4
- data.tar.gz: 9b5beac969f341f97c48b870496aa68f5258953f
3
+ metadata.gz: aa82239a1d8afe52781e0d25083bb8071f5d759c
4
+ data.tar.gz: 5ba879e3309b67c3871e049c78e355d7ebf6461b
5
5
  SHA512:
6
- metadata.gz: 1c94f8a06c248e9f6a3d0449961fc21d1957fc5f0c2bab493010885941b2a143031bd0a12758a653a2e1f9c7e4810dbfb5bc7ef52c6a7d4f6526863145576bbf
7
- data.tar.gz: c5edf4ca5f99323881187c5a64017a3918e56ec4b33270138073935064ed343e4e1020b4e465f20832896871dc604669e21fe7c7931e40b75af8f4db34ebe06a
6
+ metadata.gz: 33c2d51feed05c9c2c39127a61ef572b079a80a054594f8dd074bbf3d71e1c7e0a1c7887f387fbb5803985f5684ba69d5eaaef4dfcbbcdaf5a1322a1d36b3970
7
+ data.tar.gz: 5d7456b69a62988c315728a164f93214c4e26add827905c841499c9f9851a48f6fb58e079a2bf306e472964d496da38cc6d0a5c301cbc6766b935f5765c11536
data/TODO.md CHANGED
@@ -1,20 +1,10 @@
1
1
  Primary objectives
2
2
  ======================================
3
- - [x] general tests
4
- - [x] except/only
5
- - [x] sync method
6
- - [x] dependent syncronization & mapping
7
- - [x] tests for Synchronisable.sync
8
3
  - [ ] fix a mess with Context: return an array of sync contexts,
9
4
  or aggregate all syncronization contexts into just one
10
5
  - [ ] destroy_missed
11
- - [x] worker.rb refactoring
12
- - [x] integrate with travis, stillmaintained, gemnasium,
13
- codeclimate, coveralls, inch-pages, codersclan
14
6
  - [ ] write a good README
15
7
  - [ ] extended interface
16
- - [ ] sync with include
17
- - [x] sync with ids array
18
8
  - [ ] handle case when association type is a :hash
19
9
  - [ ] sync method for collection proxy (Model.where(condition).sync)
20
10
  - [ ] better specs for cases when we should fetch/find using complex params
@@ -24,12 +14,6 @@ Think about
24
14
  - [ ] has_many :bars, :through => FooModel
25
15
  - [ ] polymorphic associations
26
16
 
27
- Secondary objectives
28
- ======================================
29
- - [x] option for verbose logging
30
- - [x] colorized STDOUT
31
- - [x] actualize docs
32
-
33
17
 
34
18
  The desired interface:
35
19
  ======================================
@@ -27,6 +27,8 @@ module Synchronisable
27
27
  source.try(:with_indifferent_access)
28
28
  }
29
29
 
30
+ attribute :order, default: 0
31
+
30
32
  # Attributes to ignored.
31
33
  attribute :except, converter: SYMBOL_ARRAY_CONVERTER
32
34
 
@@ -2,7 +2,7 @@ module Synchronisable
2
2
  module VERSION
3
3
  MAJOR = 1
4
4
  MINOR = 2
5
- PATCH = 4
5
+ PATCH = 5
6
6
  SUFFIX = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, SUFFIX].compact.join('.')
@@ -42,7 +42,7 @@ module Synchronisable
42
42
  # @see Synchronisable::Context
43
43
  def self.sync(*args)
44
44
  options = args.extract_options!
45
- source = source_models(args)
45
+ source = source_models(args)
46
46
  source.map { |model| model.sync(options) }
47
47
  end
48
48
 
@@ -51,6 +51,7 @@ module Synchronisable
51
51
  def self.source_models(models)
52
52
  source = models.present? ? models : default_models
53
53
  source = source.present? ? source : find_models
54
+ source.sort { |lhs, rhs| lhs.synchronizer.order <=> rhs.synchronizer.order }
54
55
  end
55
56
 
56
57
  def self.default_models
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
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasiliy Yorkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-19 00:00:00.000000000 Z
11
+ date: 2015-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord