diff --git a/lib/data_struct/dsl.rb b/lib/data_struct/dsl.rb index af84adb..9549692 100644 --- a/lib/data_struct/dsl.rb +++ b/lib/data_struct/dsl.rb @@ -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]) }