Add Topic#max_post_number to find max post number
This commit is contained in:
parent
c4cce68613
commit
f2b5e20840
|
@ -476,6 +476,10 @@ class Topic < ActiveRecord::Base
|
||||||
first_post_number
|
first_post_number
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def max_post_number
|
||||||
|
posts.maximum(:post_number).to_i
|
||||||
|
end
|
||||||
|
|
||||||
def move_posts(moved_by, post_ids, opts)
|
def move_posts(moved_by, post_ids, opts)
|
||||||
|
|
||||||
topic = nil
|
topic = nil
|
||||||
|
|
Loading…
Reference in New Issue