Skip to content

Commit 8c620ea

Browse files
committed
Optimization StoriesController#index
1 parent 8af1b32 commit 8c620ea

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

app/views/stories/_main_stories_feed.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@
5555
<% if !user_signed_in? && i == 4 %>
5656
<%= render "stories/sign_in_invitation" %>
5757
<% end %>
58-
<%= render "articles/single_story", story: story %>
58+
<% cache(story) do %>
59+
<%= render "articles/single_story", story: story %>
60+
<% end %>
5961
<% end %>
6062
<% end %>
6163
<% if @stories.size > 1 %>

config/application.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class Application < Rails::Application
2222
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
2323
# config.i18n.default_locale = :de
2424

25+
config.skylight.environments << "development"
26+
config.skylight.environments << "local_production"
27+
2528
config.autoload_paths += Dir["#{config.root}/app/labor/"]
2629
config.autoload_paths += Dir["#{config.root}/app/decorators/"]
2730
config.autoload_paths += Dir["#{config.root}/app/services/"]

config/environments/local_production.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@
126126

127127
config.middleware.use Rack::HostRedirect,
128128
"practicaldev.herokuapp.com" => "dev.to"
129-
130-
config.skylight.environments << "local_production"
131129
end
132130

133131
# rubocop:enable Metrics/BlockLength

0 commit comments

Comments
 (0)