discourse/lib/discourse_dev/post_revision.rb

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

23 lines
456 B
Ruby
Raw Permalink 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