Skip to content

Commit

Permalink
Allow nil in initialize_with to support if's
Browse files Browse the repository at this point in the history
  • Loading branch information
antulik committed Sep 23, 2024
1 parent 00e5010 commit 88a4ded
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_interaction/extras.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def initialize(...)
def initialize_with(&block)
after_initialize do
hash = instance_exec(&block)
hash.each do |filter_name, value|
hash&.each do |filter_name, value|
public_send "#{filter_name}=", value if !inputs.given?(filter_name)
end
end
Expand Down

0 comments on commit 88a4ded

Please sign in to comment.