trogdir_models 0.3.0 → 0.4.0

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: 81d87720d663131edba6072fab87909a42d4d377
4
- data.tar.gz: 4dd28c82748f6bf10f83dc259b3cce4f69a36b96
3
+ metadata.gz: 6f383c224c4d3b60da1abb28b5c1c616663b652c
4
+ data.tar.gz: 67cafb2056fc38d88b3a1b31f671312dca76c581
5
5
  SHA512:
6
- metadata.gz: 28dd7d986223671e7f0a4762c0ed893075fa862a020a12ce9ba18b946c6c0f5bebea9171643f81bae5122976548e2f17ebee9de58c559480909f591908f08f1d
7
- data.tar.gz: a8d7e94a1c1e4669b89d59587350b75a2b015d2e0c33ce4c6adf96839ea50a721c9db6e89576a5618a1d19ef215a36503d5449e2ce131da48c0c0cb2a9bf48f9
6
+ metadata.gz: 49bdfbb9f4a51109239f1fea13245300c1ece7e93f591195233df650a902535430c95aff2817530a85756d1da89bd5019f80d22ac3f83a8a3b26ad62ed4480ec
7
+ data.tar.gz: 3e463e11faa193bfe1df9af7b14c17ab5c787344ebe22a55c1c599098c748fcd020a5aa0a6ea156eac37a5165ec420df6c0e983f8cd2d7f2f9a49033e91ecb94
@@ -12,4 +12,11 @@ class SyncLog
12
12
  validates :started_at, presence: true
13
13
 
14
14
  delegate :changeset, to: :change_sync
15
+
16
+ def self.find_through_parents(id)
17
+ id = Moped::BSON::ObjectId(id)
18
+ changeset = Changeset.find_by('change_syncs.sync_logs._id' => id)
19
+ change_sync = changeset.change_syncs.find_by('sync_logs._id' => id)
20
+ change_sync.sync_logs.find(id)
21
+ end
15
22
  end
@@ -1,3 +1,3 @@
1
1
  module TrogdirModels
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -0,0 +1,6 @@
1
+ FactoryGirl.define do
2
+ factory :change_sync do
3
+ changeset { create(:person).history_tracks.first }
4
+ syncinator
5
+ end
6
+ end
@@ -0,0 +1,10 @@
1
+ FactoryGirl.define do
2
+ factory :sync_log do
3
+ change_sync
4
+ started_at { Time.now }
5
+ errored_at nil
6
+ succeeded_at nil
7
+ action nil
8
+ message nil
9
+ end
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trogdir_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Crownoble
@@ -161,11 +161,13 @@ files:
161
161
  - lib/trogdir_models.rb
162
162
  - lib/trogdir_models/version.rb
163
163
  - spec/factories/address_factory.rb
164
+ - spec/factories/change_sync_factory.rb
164
165
  - spec/factories/email_factory.rb
165
166
  - spec/factories/id_factory.rb
166
167
  - spec/factories/person_factory.rb
167
168
  - spec/factories/phone_factory.rb
168
169
  - spec/factories/photo_factory.rb
170
+ - spec/factories/sync_log_factory.rb
169
171
  - spec/factories/syncinator_factory.rb
170
172
  homepage: https://github.com/biola/trogdir-models
171
173
  licenses: