Skip to content

Commit

Permalink
fix bug in param keys
Browse files Browse the repository at this point in the history
  • Loading branch information
rabidaudio committed May 15, 2023
1 parent d95a443 commit 767ff03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/data_struct/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def define(name, field_definitions, &)
# ActionController::Parameters#permit to permit all defined parameters.
def param_keys(clazz = self)
clazz.defined_attributes.map do |name, defn|
if explicit_permits[name]
{ name => explicit_permits[name] }
if clazz.respond_to?(:explicit_permits) && clazz.explicit_permits[name]
{ name => clazz.explicit_permits[name] }
elsif defn.is_a?(Array)
if defn[0].respond_to?(:defined_attributes)
{ name => param_keys(defn[0]) }
Expand Down

0 comments on commit 767ff03

Please sign in to comment.