public
Description: The open source social networking platform in Ruby on Rails from the author of RailsSpace
Homepage: http://insoshi.com
Clone URL: git://github.com/insoshi/insoshi.git
Fixed sample data to truncate topic name
Michael Hartl (author)
Sat Mar 01 17:02:46 -0800 2008
commit  e801aaafb3feb3443a2d260727b1a82510a2a075
tree    cae9abbbf7327238c0f2b3d1fbc3a530caa43bae
parent  cb0f09de5b70156446f793bd4d66bc915476a684
...
11
12
13
14
 
15
16
17
...
11
12
13
 
14
15
16
17
0
@@ -11,7 +11,7 @@ class HomeController < ApplicationController
0
     
0
     @topics = Topic.find(:all, :order => "created_at DESC", :limit => 6)
0
     @members = Person.find(:all, :order => "people.created_at DESC",
0
- :limit => 8, :include => :photos)
0
+ :include => :photos, :limit => 8)
0
     respond_to do |format|
0
       format.html
0
     end
...
34
35
36
37
38
 
 
39
40
41
 
42
43
44
...
70
71
72
73
 
 
74
75
76
...
34
35
36
 
 
37
38
39
40
 
41
42
43
44
...
70
71
72
 
73
74
75
76
77
0
@@ -34,11 +34,11 @@ namespace :db do
0
 end
0
 
0
 def create_people
0
- [%w(female F), %w(male M)].each do |pair|
0
- filename = File.join(DATA_DIRECTORY, "#{pair[0]}_names.txt")
0
+ %w[male female].each do |gender|
0
+ filename = File.join(DATA_DIRECTORY, "#{gender}_names.txt")
0
     names = File.open(filename).readlines
0
     password = "foobar"
0
- photos = Dir.glob("lib/tasks/sample_data/#{pair[0]}_photos/*.jpg").shuffle
0
+ photos = Dir.glob("lib/tasks/sample_data/#{gender}_photos/*.jpg").shuffle
0
     names.each_with_index do |name, i|
0
       name.strip!
0
       person = Person.create!(:email => "#{name.downcase}@michaelhartl.com",
0
@@ -70,7 +70,8 @@ def make_forum_posts
0
   forum = Forum.find(1)
0
   people = Person.find(:all)
0
   (1..25).each do |n|
0
- name = @lipsum.split.shuffle[0..8].join(' ')
0
+ name = @lipsum.split.shuffle[0..10].join(' ')
0
+ name = name[0...Topic::MAX_NAME]
0
     topic = forum.topics.create(:name => name, :person => people.pick,
0
                                 :created_at => rand(10).hours.ago)
0
     25.times do

Comments

    No one has commented yet.