RobinBrouwer/bootstrap_flash_messages — pull request #15 by mhuggins (2014-09-27 23:33:32+00:00)
Title: Default to :info if the alert type isn't found

If any flash messages are created with an alert type that doesn't match the current set of mappings, the resulting CSS class is "alert alert-". This changes the behavior to default to "info" if a mapping isn't found, resulting in a class of "alert alert-info".

For reference, the specific scenario in which I hit this was in conjunction with the popular Devise gem, whereby invalid login credentials produces a flash message with key "alert".

In addition, I turned this into a class level constant and froze the hash to prevent changes.