Created
August 10, 2010 08:54
-
-
Save bogdan/516939 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Recommendation.transaction do | |
Contributor.with_user.each do |contributor| | |
rand(5).times do | |
recommendation_group = groups.rand | |
Recommendation.create( | |
:user => contributor.user, | |
:group => recommendation_group, | |
:body => Faker::Lorem.sentence(5) | |
) | |
end | |
end | |
end | |
#Reviews | |
Review.transaction do | |
Contributor.with_user.each do |contributor| | |
rand(5).times do | |
review_group = groups.rand | |
Review.create( | |
:user => contributor.user, | |
:group => review_group, | |
:body => Faker::Lorem.sentence(20) | |
#:title => Faker::Lorem.sentence(1) | |
) | |
end | |
end | |
end | |
#Inspirations | |
Inspiration.transaction do | |
Contributor.with_user.each do |contributor| | |
rand(5).times do | |
inspiration_group = groups.rand | |
contributor_books = contributor.products | |
if contributor_books.size > 0 | |
Inspiration.create( | |
:user => contributor.user, | |
:group => inspiration_group, | |
:body => Faker::Lorem.sentence(5) | |
) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment