Class: Thredded::DatabaseSeeder::Topics

Inherits:
CollectionSeedData show all
Defined in:
lib/thredded/database_seeder.rb

Constant Summary collapse

MODEL_CLASS =
Topic

Instance Attribute Summary

Attributes inherited from BaseSeedData

#seeder

Instance Method Summary collapse

Methods inherited from CollectionSeedData

#find

Methods inherited from BaseSeedData

create, #find_or_create, #initialize

Constructor Details

This class inherits a constructor from Thredded::DatabaseSeeder::BaseSeedData

Instance Method Details

#create(count: 1, messageboard: seeder.first_messageboard) ⇒ Object



221
222
223
224
225
226
227
228
229
# File 'lib/thredded/database_seeder.rb', line 221

def create(count: 1, messageboard: seeder.first_messageboard)
  log "Creating #{count} topics in #{messageboard.name}..."
  FactoryBot.create_list(
    :topic, count,
    messageboard: messageboard,
    user: seeder.users.sample,
    last_user: seeder.users.sample
  )
end