Skip to content

Commit

Permalink
Update Boolean pretty_value to include default fallback
Browse files Browse the repository at this point in the history
This will prevent the interface from breaking in the event a value is not correctly matched as 'true' or 'false'
  • Loading branch information
codealchemy committed Aug 11, 2021
1 parent 238f18e commit af85794
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rails_admin/config/fields/types/boolean.rb
Expand Up @@ -12,12 +12,12 @@ class Boolean < RailsAdmin::Config::Fields::Base

register_instance_option :pretty_value do
case value
when nil
%(<span class='label label-default'>&#x2012;</span>)
when false
%(<span class='label label-danger'>&#x2718;</span>)
when true
%(<span class='label label-success'>&#x2713;</span>)
else
%(<span class='label label-default'>&#x2012;</span>)
end.html_safe
end

Expand Down

0 comments on commit af85794

Please sign in to comment.