Skip to content

Commit

Permalink
Rubocop -a
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen committed Jan 21, 2023
1 parent dd0c6d9 commit 6ffa05d
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions app/controllers/alchemy/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,13 @@ def locale_prefix_not_allowed?
# If no index page and no admin users are present we show the "Welcome to Alchemy" page.
#
def load_index_page
@page ||= begin
Alchemy::Page.
contentpages.
language_roots.
where(language: Language.current).
includes(page_includes).
first
end
@page ||= Alchemy::Page
.contentpages
.language_roots
.where(language: Language.current)
.includes(page_includes)
.first

render template: "alchemy/welcome", layout: false if signup_required?
end

Expand All @@ -127,13 +126,11 @@ def load_index_page
def load_page
page_not_found! unless Language.current

@page ||= begin
Alchemy::Page.
contentpages.
where(language: Language.current).
includes(page_includes).
find_by(urlname: params[:urlname])
end
@page ||= Alchemy::Page
.contentpages
.where(language: Language.current)
.includes(page_includes)
.find_by(urlname: params[:urlname])
end

def enforce_locale
Expand Down Expand Up @@ -222,10 +219,12 @@ def page_etag
# or the cache is stale, because it's been republished by the user.
#
def render_fresh_page?
must_not_cache? || stale?(etag: page_etag,
last_modified: @page.published_at,
public: !@page.restricted,
template: "pages/show")
must_not_cache? || stale?(
etag: page_etag,
last_modified: @page.published_at,
public: !@page.restricted,
template: "pages/show",
)
end

# don't cache pages if we have flash message to display or the page has caching disabled
Expand Down

0 comments on commit 6ffa05d

Please sign in to comment.