@@ -47,8 +47,8 @@ defmodule MastaniServer.CMS.Delegate.Seeds do
4747 { :ok , bot } <- seed_bot ( ) ,
4848 { :ok , categories } <- seed_categories ( bot , :default ) ,
4949 { :ok , communities } <- seed_for_communities ( bot , :pl ) do
50- threadify_communities ( communities , threads )
51- tagfy_threads ( communities , threads , bot )
50+ threadify_communities ( communities , threads . entries )
51+ tagfy_threads ( communities , threads . entries , bot )
5252 categorify_communities ( communities , categories , :pl )
5353 end
5454 end
@@ -59,10 +59,10 @@ defmodule MastaniServer.CMS.Delegate.Seeds do
5959 def seed_communities ( :framework ) do
6060 with { :ok , threads } <- seed_threads ( :default ) ,
6161 { :ok , bot } <- seed_bot ( ) ,
62- { :ok , categories } <- seed_categories ( bot , :default ) ,
62+ { :ok , _categories } <- seed_categories ( bot , :default ) ,
6363 { :ok , communities } <- seed_for_communities ( bot , :framework ) do
64- threadify_communities ( communities , threads )
65- tagfy_threads ( communities , threads , bot )
64+ threadify_communities ( communities , threads . entries )
65+ tagfy_threads ( communities , threads . entries , bot )
6666
6767 # categorify_communities(communities, categories, :other)
6868 end
@@ -76,8 +76,8 @@ defmodule MastaniServer.CMS.Delegate.Seeds do
7676 { :ok , bot } <- seed_bot ( ) ,
7777 { :ok , categories } <- seed_categories ( bot , :default ) ,
7878 { :ok , communities } <- seed_for_communities ( bot , :editor ) do
79- threadify_communities ( communities , threads )
80- tagfy_threads ( communities , threads , bot )
79+ threadify_communities ( communities , threads . entries )
80+ tagfy_threads ( communities , threads . entries , bot )
8181
8282 categorify_communities ( communities , categories , :other )
8383 end
@@ -89,10 +89,10 @@ defmodule MastaniServer.CMS.Delegate.Seeds do
8989 def seed_communities ( :database ) do
9090 with { :ok , threads } <- seed_threads ( :default ) ,
9191 { :ok , bot } <- seed_bot ( ) ,
92- { :ok , categories } <- seed_categories ( bot , :default ) ,
92+ { :ok , _categories } <- seed_categories ( bot , :default ) ,
9393 { :ok , communities } <- seed_for_communities ( bot , :database ) do
94- threadify_communities ( communities , threads )
95- tagfy_threads ( communities , threads , bot )
94+ threadify_communities ( communities , threads . entries )
95+ tagfy_threads ( communities , threads . entries , bot )
9696
9797 # categorify_communities(communities, categories, :other)
9898 end
@@ -106,8 +106,8 @@ defmodule MastaniServer.CMS.Delegate.Seeds do
106106 { :ok , bot } <- seed_bot ( ) ,
107107 { :ok , categories } <- seed_categories ( bot , :default ) ,
108108 { :ok , communities } <- seed_for_communities ( bot , :devops ) do
109- threadify_communities ( communities , threads )
110- tagfy_threads ( communities , threads , bot )
109+ threadify_communities ( communities , threads . entries )
110+ tagfy_threads ( communities , threads . entries , bot )
111111
112112 categorify_communities ( communities , categories , :other )
113113 end
@@ -119,10 +119,10 @@ defmodule MastaniServer.CMS.Delegate.Seeds do
119119 def seed_communities ( :blockchain ) do
120120 with { :ok , threads } <- seed_threads ( :default ) ,
121121 { :ok , bot } <- seed_bot ( ) ,
122- { :ok , categories } <- seed_categories ( bot , :default ) ,
122+ { :ok , _categories } <- seed_categories ( bot , :default ) ,
123123 { :ok , communities } <- seed_for_communities ( bot , :blockchain ) do
124- threadify_communities ( communities , threads )
125- tagfy_threads ( communities , threads , bot )
124+ threadify_communities ( communities , threads . entries )
125+ tagfy_threads ( communities , threads . entries , bot )
126126
127127 # categorify_communities(communities, categories, :other)
128128 end
@@ -134,10 +134,10 @@ defmodule MastaniServer.CMS.Delegate.Seeds do
134134 def seed_communities ( :design ) do
135135 with { :ok , threads } <- seed_threads ( :default ) ,
136136 { :ok , bot } <- seed_bot ( ) ,
137- { :ok , categories } <- seed_categories ( bot , :default ) ,
137+ { :ok , _categories } <- seed_categories ( bot , :default ) ,
138138 { :ok , communities } <- seed_for_communities ( bot , :design ) do
139- threadify_communities ( communities , threads )
140- tagfy_threads ( communities , threads , bot )
139+ threadify_communities ( communities , threads . entries )
140+ tagfy_threads ( communities , threads . entries , bot )
141141
142142 # categorify_communities(communities, categories, :other)
143143 end
@@ -151,8 +151,8 @@ defmodule MastaniServer.CMS.Delegate.Seeds do
151151 { :ok , bot } <- seed_bot ( ) ,
152152 { :ok , categories } <- seed_categories ( bot , :default ) ,
153153 { :ok , communities } <- seed_for_communities ( bot , :city ) do
154- threadify_communities ( communities , threads )
155- tagfy_threads ( communities , threads , bot , :city )
154+ threadify_communities ( communities , threads . entries )
155+ tagfy_threads ( communities , threads . entries , bot , :city )
156156 categorify_communities ( communities , categories , :city )
157157 end
158158 end
@@ -174,9 +174,9 @@ defmodule MastaniServer.CMS.Delegate.Seeds do
174174 }
175175
176176 { :ok , community } = Community |> ORM . create ( args )
177- threadify_communities ( community , threads )
178177
179- tagfy_threads ( community , threads , bot , :home )
178+ threadify_communities ( community , threads . entries )
179+ tagfy_threads ( community , threads . entries , bot , :home )
180180 categorify_communities ( community , categories , :other )
181181 end
182182 end
@@ -283,49 +283,49 @@ defmodule MastaniServer.CMS.Delegate.Seeds do
283283 # seed raw communities, without thread or categories staff
284284 defp seed_for_communities ( bot , :pl ) do
285285 with { :error , _ } <- ORM . find_by ( Community , % { raw: "javascript" } ) do
286- { :ok , communities } = insert_multi_communities ( bot , @ pl_communities , :pl )
286+ { :ok , _communities } = insert_multi_communities ( bot , @ pl_communities , :pl )
287287 end
288288 end
289289
290290 defp seed_for_communities ( bot , :framework ) do
291291 with { :error , _ } <- ORM . find_by ( Community , % { raw: "react" } ) do
292- { :ok , communities } = insert_multi_communities ( bot , @ framework_communities , :framework )
292+ { :ok , _communities } = insert_multi_communities ( bot , @ framework_communities , :framework )
293293 end
294294 end
295295
296296 defp seed_for_communities ( bot , :editor ) do
297297 with { :error , _ } <- ORM . find_by ( Community , % { raw: "emacs" } ) do
298- { :ok , communities } = insert_multi_communities ( bot , @ editor_communities , :editor )
298+ { :ok , _communities } = insert_multi_communities ( bot , @ editor_communities , :editor )
299299 end
300300 end
301301
302302 defp seed_for_communities ( bot , :database ) do
303303 with { :error , _ } <- ORM . find_by ( Community , % { raw: "mysql" } ) do
304- { :ok , communities } = insert_multi_communities ( bot , @ database_communities , :database )
304+ { :ok , _communities } = insert_multi_communities ( bot , @ database_communities , :database )
305305 end
306306 end
307307
308308 defp seed_for_communities ( bot , :devops ) do
309309 with { :error , _ } <- ORM . find_by ( Community , % { raw: "cps-support" } ) do
310- { :ok , communities } = insert_multi_communities ( bot , @ devops_communities , :devops )
310+ { :ok , _communities } = insert_multi_communities ( bot , @ devops_communities , :devops )
311311 end
312312 end
313313
314314 defp seed_for_communities ( bot , :blockchain ) do
315315 with { :error , _ } <- ORM . find_by ( Community , % { raw: "bitcoin" } ) do
316- { :ok , communities } = insert_multi_communities ( bot , @ dblockchain_communities , :blockchain )
316+ { :ok , _communities } = insert_multi_communities ( bot , @ dblockchain_communities , :blockchain )
317317 end
318318 end
319319
320320 defp seed_for_communities ( bot , :design ) do
321321 with { :error , _ } <- ORM . find_by ( Community , % { raw: "css" } ) do
322- { :ok , communities } = insert_multi_communities ( bot , @ design_communities , :design )
322+ { :ok , _communities } = insert_multi_communities ( bot , @ design_communities , :design )
323323 end
324324 end
325325
326326 defp seed_for_communities ( bot , :city ) do
327327 with { :error , _ } <- ORM . find_by ( Community , % { raw: "chengdu" } ) do
328- { :ok , communities } = insert_multi_communities ( bot , @ city_communities , :city )
328+ { :ok , _communities } = insert_multi_communities ( bot , @ city_communities , :city )
329329 end
330330 end
331331
@@ -399,7 +399,7 @@ defmodule MastaniServer.CMS.Delegate.Seeds do
399399
400400 # tagfy only post job repo and video
401401
402- defp tagfy_threads ( communities , threads , bot , :city ) when is_list ( communities ) do
402+ defp tagfy_threads ( communities , _threads , bot , :city ) when is_list ( communities ) do
403403 Enum . each ( communities , fn community ->
404404 set_tags ( community , :post , bot , :city )
405405 end )
0 commit comments