Skip to content

Commit 468e088

Browse files
committed
Added seed to create example networks
1 parent e4c66cd commit 468e088

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

db/seeds.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@ def self.create_protip_for(user)
55
yield protip = user.protips.build
66
protip.save!
77
end
8+
9+
def self.create_network_for(name)
10+
Network.find_or_create_by_name(name) do |n|
11+
n.create_slug!
12+
end
13+
end
814
end
915

16+
S.create_network_for('Ruby')
17+
S.create_network_for('JavaScript')
18+
1019
Plan.find_or_create_by_id(1) do |s|
1120
s.amount = 0
1221
s.interval = 'month'
@@ -152,7 +161,7 @@ def self.create_protip_for(user)
152161
#Network.rebuild_index
153162
Opportunity.rebuild_index
154163
Protip.rebuild_index
155-
164+
156165
#Team.rebuild_index #TODO: Disabled until switched from mongo
157166
Team.all.each { |team| team.tire.update_index }
158167
end

0 commit comments

Comments
 (0)