Skip to content

Commit

Permalink
Better error message if key is not specified in ATTRIBUTE_TYPES (#1762)
Browse files Browse the repository at this point in the history
[key] → fetch(key)

to provide better error description if something goes wrong.
Originally, we get "NoMethodError: undefined method
`associative?' for nil:NilClass"
  • Loading branch information
inem authored Feb 26, 2021
1 parent 255167d commit 1b68b75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/administrate/base_dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def attribute_not_found_message(attr)

def attribute_includes(attributes)
attributes.map do |key|
field = self.class::ATTRIBUTE_TYPES[key]
field = attribute_type_for(key)

key if field.associative?
end.compact
Expand Down

0 comments on commit 1b68b75

Please sign in to comment.