diff --git a/app/models/post.rb b/app/models/post.rb index 6f92b08fee6..f659684cbb4 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -271,19 +271,6 @@ class Post < ActiveRecord::Base Post.excerpt(cooked, maxlength, options) end - - # A list of versions including the initial version - def all_versions - result = [] - result << { number: 1, display_username: user.username, created_at: created_at } - versions.order(:number).includes(:user).each do |v| - if v.user.present? - result << { number: v.number, display_username: v.user.username, created_at: v.created_at } - end - end - result - end - def is_first_post? post_number == 1 end diff --git a/spec/components/post_creator_spec.rb b/spec/components/post_creator_spec.rb index 2d77d0177f2..5787525cd41 100644 --- a/spec/components/post_creator_spec.rb +++ b/spec/components/post_creator_spec.rb @@ -90,8 +90,6 @@ describe PostCreator do reply = PostCreator.new(admin, raw: "this is my test reply 123 testing", topic_id: created_post.topic_id).create end - topic_id = created_post.topic_id - messages.map{|m| m.channel}.sort.should == [ "/new", "/users/#{admin.username}", @@ -110,7 +108,6 @@ describe PostCreator do p = nil messages = MessageBus.track_publish do p = creator.create - topic_id = p.topic_id end latest = messages.find{|m| m.channel == "/new"} @@ -397,7 +394,7 @@ describe PostCreator do context 'disable validations' do it 'can save a post' do creator = PostCreator.new(user, raw: 'q', title: 'q', skip_validations: true) - post = creator.create + creator.create creator.errors.should be_nil end end