mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:33:24 +08:00
23 lines
456 B
Ruby
23 lines
456 B
Ruby
# 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
|