@@ -12,13 +12,12 @@ def render_single(component_name, data_hash)
1212 }
1313 }
1414
15- response = HTTParty . post ( ssr_server_url , body : body . to_json , headers : { "Content-Type" => 'application/json' } )
15+ response = :: HTTParty . post ( ssr_server_url , body : body . to_json , headers : { "Content-Type" => 'application/json' } )
1616
17- return JSON . parse ( response . body ) . dig ( "results" , "content" , "html" )
17+ return :: JSON . parse ( response . body ) . dig ( "results" , "content" , "html" )
1818 end
1919
2020 def render_many ( component_name , payloads = [ ] )
21-
2221 # hypernova has an odd payload format, so we need to make the keys to the hash
2322 # 0: {}, 1: {}, 2: {} # etc
2423
@@ -31,27 +30,27 @@ def render_many(component_name, payloads=[])
3130 }
3231 end
3332
34- response = HTTParty . post ( ssr_server_url , body : body_h . to_json , headers : { "Content-Type" => 'application/json' } )
33+ response = :: HTTParty . post ( ssr_server_url , body : body_h . to_json , headers : { "Content-Type" => 'application/json' } )
3534
36- return JSON . parse ( response . body ) [ "results" ] . map { |k , v | v [ "html" ] }
35+ return :: JSON . parse ( response . body ) [ "results" ] . map { |k , v | v [ "html" ] }
3736 end
3837
3938 def render_multiple_todo_items ( todo_items )
40- item_hashes = todo_items . map { |item | TodoItemSerializer . new ( item ) . to_h }
39+ item_hashes = todo_items . map { |item | :: TodoItemSerializer . new ( item ) . to_h }
4140
4241 raw render_many ( 'TodoItem' , item_hashes ) . join ( "\n " )
4342 end
4443
4544 def render_single_todo_item ( todo_item )
46- raw render_single ( 'TodoItem' , TodoItemSerializer . new ( todo_item ) . to_h )
45+ raw render_single ( 'TodoItem' , :: TodoItemSerializer . new ( todo_item ) . to_h )
4746 end
4847
4948 # to speed up SSR we should do this.
5049 def cached_todo_item ( todo_item )
5150 key = "vuessr::todo_item::#{ todo_item . cache_key } "
5251 puts "key-> #{ key } "
5352
54- Rails . cache . fetch ( key , expires_in : 10 . seconds ) do
53+ :: Rails . cache . fetch ( key , expires_in : 10 . seconds ) do
5554 render_single_todo_item ( todo_item )
5655 end
5756 end
0 commit comments