|
|
@ -131,9 +131,9 @@ class Journal < ActiveRecord::Base |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def predecessor |
|
|
|
def predecessor |
|
|
|
@predecessor ||= Journal.where("journaled_type = ? AND journaled_id = ? AND created_at <= ? AND id < ?", |
|
|
|
@predecessor ||= Journal.where("journaled_type = ? AND journaled_id = ? AND id < ?", |
|
|
|
journaled_type, journaled_id, created_at, id) |
|
|
|
journaled_type, journaled_id, id) |
|
|
|
.order("created_at DESC") |
|
|
|
.order("version DESC") |
|
|
|
.first |
|
|
|
.first |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|