Skip to content

Commit

Permalink
fully dup a config
Browse files Browse the repository at this point in the history
  • Loading branch information
jrochkind committed Feb 13, 2025
1 parent a010d9e commit 574ca93
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/models/bot_challenge_page/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,13 @@ def initialize(**values)

# key in rack env that says challenge is required
attribute :env_challenge_trigger_key, default: "bot_detect.should_challenge"

# make sure dup dups all attributes please
def initialize_dup(source)
self.class.attr_defaults.keys.each do |attr_key|
instance_variable_set("@#{attr_key}", instance_variable_get("@#{attr_key}").deep_dup)
super
end
end
end
end

0 comments on commit 574ca93

Please sign in to comment.