Class: Thredded::DatabaseSeeder::PrivateTopics

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

Constant Summary collapse

MODEL_CLASS =
PrivateTopic

Instance Attribute Summary

Attributes inherited from BaseSeedData

#seeder

Instance Method Summary collapse

Methods inherited from CollectionSeedData

#find

Methods inherited from BaseSeedData

#find_or_create, #initialize

Constructor Details

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

Instance Method Details

#create(count: 1) ⇒ Object



227
228
229
230
231
232
233
234
# File 'lib/thredded/database_seeder.rb', line 227

def create(count: 1)
  FactoryGirl.create_list(
    :private_topic, count,
    user: seeder.users[1..-1].sample,
    last_user: seeder.users.sample,
    users: [seeder.first_user]
  )
end