Class: SyncLog

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document
Defined in:
lib/trogdir/sync_log.rb

Class Method Summary collapse

Class Method Details

.find_through_parents(id) ⇒ Object



19
20
21
22
23
24
# File 'lib/trogdir/sync_log.rb', line 19

def self.find_through_parents(id)
  id = BSON::ObjectId.from_string(id.to_s) unless id.is_a? BSON::ObjectId
  changeset = Changeset.find_by('change_syncs.sync_logs._id' => id)
  change_sync = changeset.change_syncs.find_by('sync_logs._id' => id)
  change_sync.sync_logs.find(id)
end