discourse/lib/discourse_dev/post_revision.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
457 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'discourse_dev/record'
require 'faker'
module DiscourseDev
class PostRevision < Record
def initialize
super(::PostRevision, DiscourseDev.config.post_revisions[:count])
end
def create!
data = { raw: Faker::DiscourseMarkdown.sandwich(sentences: 5) }
::PostRevisor.new(Post.random).revise!(User.random, data)
end
def populate!
@count.times { create! }
end
end
end