diff --git a/lib/discourse_dev/post.rb b/lib/discourse_dev/post.rb index 1bfdbd4..f6c76e1 100644 --- a/lib/discourse_dev/post.rb +++ b/lib/discourse_dev/post.rb @@ -27,7 +27,8 @@ def data topic_id: topic.id, raw: Faker::Markdown.sandwich(sentences: 5), created_at: Faker::Time.between(from: topic.last_posted_at, to: DateTime.now), - skip_validations: true + skip_validations: true, + skip_guardian: true } end @@ -44,7 +45,7 @@ def generate_likes(post) user = self.user next if user_ids.include?(user.id) - PostActionCreator.new(user, post, PostActionType.types[:like]).perform + PostActionCreator.new(user, post, PostActionType.types[:like], created_at: Faker::Time.between(from: post.created_at, to: DateTime.now)).perform user_ids << user.id end end diff --git a/lib/discourse_dev/record.rb b/lib/discourse_dev/record.rb index 2492d10..f1f6160 100644 --- a/lib/discourse_dev/record.rb +++ b/lib/discourse_dev/record.rb @@ -12,6 +12,8 @@ class Record def initialize(model, count = DEFAULT_COUNT) Faker::Discourse.unique.clear + RateLimiter.disable + @model = model @type = model.to_s @count = count