Please sign in to comment.
Revert grep to select since they are not the same
A previous commit swapped out a call to select for a call to grep in time_zone_options_for_select. This behavior actually causes the regexp priority option to stop working. ActiveSupport::TimeZone overrides the =~ operator which is what the select block was using previously. Enumerable#grep checks pattern === element and in this case that would be /US/ === ActiveSupport::TimeZone which does not work because ActiveSupport::TimeZone does not supply an implicit converting to_str method, only an explicit to_s method. It would be impossible to provide a to_str method that behaves identically to the =~ method provided on ActiveSupport::TimeZone so the only option is to revert back to using select with =~.
- Loading branch information...
Showing with 3 additions and 4 deletions.