129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
# File 'lib/magick/rails/railtie.rb', line 129
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
|