Fix to ticket 2.
When updating the last page revision in the "continuous revision" case, created_at should be used instead of Time.now.
This commit is contained in:
parent
da3674770e
commit
ef65e5e78a
2 changed files with 2 additions and 1 deletions
|
@ -20,7 +20,7 @@ class Page
|
||||||
# by the same author, not more than 30 minutes ago, then update the last revision instead of
|
# by the same author, not more than 30 minutes ago, then update the last revision instead of
|
||||||
# creating a new one
|
# creating a new one
|
||||||
if !@revisions.empty? && continous_revision?(created_at, author)
|
if !@revisions.empty? && continous_revision?(created_at, author)
|
||||||
@revisions.last.created_at = Time.now
|
@revisions.last.created_at = created_at
|
||||||
@revisions.last.content = content
|
@revisions.last.content = content
|
||||||
@revisions.last.clear_display_cache
|
@revisions.last.clear_display_cache
|
||||||
else
|
else
|
||||||
|
|
|
@ -64,6 +64,7 @@ class PageTest < Test::Unit::TestCase
|
||||||
@page.revise("HisWay would be MyWay in kinda update", Time.local(2004, 4, 4, 16, 57), "MarianneSyhler")
|
@page.revise("HisWay would be MyWay in kinda update", Time.local(2004, 4, 4, 16, 57), "MarianneSyhler")
|
||||||
assert_equal 2, @page.revisions.length
|
assert_equal 2, @page.revisions.length
|
||||||
assert_equal "HisWay would be MyWay in kinda update", @page.revisions.last.content
|
assert_equal "HisWay would be MyWay in kinda update", @page.revisions.last.content
|
||||||
|
assert_equal Time.local(2004, 4, 4, 16, 57), @page.revisions.last.created_at
|
||||||
|
|
||||||
@page.revise("HisWay would be MyWay in the house", Time.local(2004, 4, 4, 16, 58), "DavidHeinemeierHansson")
|
@page.revise("HisWay would be MyWay in the house", Time.local(2004, 4, 4, 16, 58), "DavidHeinemeierHansson")
|
||||||
assert_equal 3, @page.revisions.length
|
assert_equal 3, @page.revisions.length
|
||||||
|
|
Loading…
Reference in a new issue