synchronisable 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/TODO.md +0 -16
- data/lib/synchronisable/synchronizer.rb +2 -0
- data/lib/synchronisable/version.rb +1 -1
- data/lib/synchronisable.rb +2 -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: aa82239a1d8afe52781e0d25083bb8071f5d759c
|
4
|
+
data.tar.gz: 5ba879e3309b67c3871e049c78e355d7ebf6461b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
======================================
|
data/lib/synchronisable.rb
CHANGED
@@ -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
|
+
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-
|
11
|
+
date: 2015-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|