Created
August 21, 2019 00:16
-
-
Save msarit/a8aa9667832e3d50091e5d388e137ef1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| def build_page_data | |
| current_id = nil | |
| categories = {} | |
| features = [] | |
| @page_data.each do |row| | |
| if row[:group_id] != current_id | |
| categories[current_id][:features] = features unless features.empty? | |
| features = [] | |
| current_id = category[:group_id] | |
| categories[category[:group_id]] = format_data(row) | |
| end | |
| features << features_hash(row) | |
| end | |
| categories[current_id][:features] = features unless features.empty? | |
| categories | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment