mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 13:03:45 +08:00
24 lines
457 B
Ruby
24 lines
457 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
|