From 3c059d0356656f20266bc2d098dd2d886aced317 Mon Sep 17 00:00:00 2001 From: Uwe Kubosch Date: Thu, 19 Oct 2023 08:14:35 +0200 Subject: [PATCH] Release version 0.7.2: Make session attributes available in the views --- build.gradle | 2 +- src/main/resources/ruby/slim_helper.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d7fac70..9d72c71 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { } group 'no.datek' -version '0.7.1' +version '0.7.2' final String JRUBY_VERSION = '9.4.3.0'; repositories { diff --git a/src/main/resources/ruby/slim_helper.rb b/src/main/resources/ruby/slim_helper.rb index 7420b12..9a5f9df 100644 --- a/src/main/resources/ruby/slim_helper.rb +++ b/src/main/resources/ruby/slim_helper.rb @@ -64,6 +64,7 @@ def params.[](key) context_values = RequestContext.default_context(locale, params, rendering_context, request) context_values.update variables context_values.update Hash[request.getAttributeNames.select { |a| a !~ /\./ && !context_values[a] }.map { |a| [a, request.getAttribute(a)] }] + context_values.update Hash[request.session.getAttributeNames.select { |a| a !~ /\./ && !context_values[a] }.map { |a| [a, request.session.getAttribute(a)] }] context_values.update RequestContext.application_attributes(request) view_shape = VIEW_SHAPES.fetch_or_store(context_values.keys) do |key| LOG.info "Creating new view shape (#{rendering_context.url}): #{context_values.keys}"