149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
# File 'lib/magick/rails/railtie.rb', line 149
def enabled?(feature_name, context = {})
if defined?(RequestStore)
cache_key = "#{feature_name}:#{context.hash}"
cached = RequestStore.store[:magick_features]&.[](cache_key)
return cached unless cached.nil?
end
result = super(feature_name, context)
if defined?(RequestStore)
RequestStore.store[:magick_features] ||= {}
RequestStore.store[:magick_features][cache_key] = result
end
result
end
|