-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Use OpenStruct over MiqHashStruct
This is almost a straight 1 for 1 conversion, and performs much better than our implementation: MiqHashStruct. * * * Regarding the [WIP] portion: The only part that doesn't work (but also doesn't make any sense that it ever did), was the portion of this code that was commented out: - if tz[1].to_i_with_method == val.to_i_with_method - # Save [value, description] for timezones array - init_values[field_name] = [val, tz[0]] - end + # if tz[1].to_i_with_method == val.to_i_with_method + # # Save [value, description] for timezones array + # init_values[field_name] = [val, tz[0]] + # end `tz` in the above always seems to be a MiqHashStruct (in the previous commit), and when `tz[1]` is called, it hit's `method_missing` with `:[]` as the method argument. This of course will almost never have a match in the underlying `@hash` in the MiqHashStruct, but will not blow up at least. When it is an OpenStruct, this fails with an error since `1` can't be converted to a symbol properly. I am uncertain if this code is ever activated, so for now, I have just commented it out to observe the advantages to using OpenStruct over MiqHashStruct.
- Loading branch information
1 parent
7f77ae9
commit ef7672b
Showing
3 changed files
with
24 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters