lib/hanami/extensions/action/slice_configured_action.rb in hanami-2.0.0.rc1 vs lib/hanami/extensions/action/slice_configured_action.rb in hanami-2.0.0
- old
+ new
@@ -58,11 +58,11 @@
#
# For example, given an app-level base action class, with custom config:
#
# module MyApp
# class Action < Hanami::Action
- # config.default_response_format = :json
+ # config.format :json
# end
# end
#
# And then an action in a slice inheriting from it:
#
@@ -89,10 +89,13 @@
slice_value = slice.config.actions.public_send(setting.name)
parent_value = slice.parent.config.actions.public_send(setting.name) if slice.parent
next if slice.parent && slice_value == parent_value
- action_class.config.public_send(:"#{setting.name}=", slice_value)
+ action_class.config.public_send(
+ :"#{setting.name}=",
+ setting.mutable? ? slice_value.dup : slice_value
+ )
end
end
def extend_behavior(action_class)
if actions_config.sessions.enabled?