Skip to content

Commit 8d7399a

Browse files
committed
Merge pull request riseuplabs#86 from azul/bugfix/comment-updates-page
ensure posting a comment updates the page
2 parents 8e6ec1f + 30bd553 commit 8d7399a

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

app/controllers/pages/posts_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def show
2525
def create
2626
@post = Post.create! @page, current_user, post_params
2727
current_user.updated(@page)
28+
@page.save
2829
# maybe? :anchor => @page.discussion.posts.last.dom_id), :paging => params[:paging] || '1')
2930
render_posts_refresh @page.posts(pagination_params)
3031
end

test/functional/pages/posts_controller_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def test_create_post
1616
assert_response :success
1717
assert_equal 1, @page.reload.posts.count
1818
assert_equal body, @page.posts.first.body
19+
assert_equal @user, @page.updated_by
1920
end
2021

2122
def test_edit_post

0 commit comments

Comments
 (0)