Sha256: c0ab7d41a91cace56b4c3038f0f91ab805200ec35890b9043ee4cb61ba295fd5

Contents?: true

Size: 831 Bytes

Versions: 22

Compression:

Stored size: 831 Bytes

Contents

david = User.create(email: 'david@site.com', name: 'david', password: 'password', password_confirmation: 'password')
james = User.create(email: 'james@site.com', name: 'james', password: 'password', password_confirmation: 'password')
sally = User.create(email: 'sally@site.com', name: 'sally', password: 'password', password_confirmation: 'password')
chloe = User.create(email: 'chloe@site.com', name: 'chloe', password: 'password', password_confirmation: 'password')

david.add_role(:super_user)
james.add_role(:admin)
sally.add_role(:moderator)
chloe.add_role(:admin)
chloe.add_role(:moderator)

10.times do
  user = User.all.sample
  post = Post.create(
    title: "Post #{Faker::Lorem.words(number: rand(1..3)).join(' ')}",
    body: "#{Faker::Lorem.sentences(number: 8).join("<br />")}"
  )
  user.add_role(:author, post)
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
rails_app_generator-0.3.6 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.3.5 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.3.4 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.3.3 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.3.2 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.3.1 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.3.0 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.2.43 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.2.42 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.2.41 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.2.40 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.2.39 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.2.38 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.2.37 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.2.36 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.2.35 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.2.34 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.2.33 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.2.32 after_templates/addons/rolify/db/seeds.rb
rails_app_generator-0.2.31 after_templates/addons/rolify/db/seeds.rb