Open
Conversation
spajic
approved these changes
May 6, 2023
| - `docker-compose up` | ||
| - `rails s` | ||
| - `open http://localhost:3000/автобусы/Самара/Москва` | ||
| - `make open` |
| @from = City.find_by_name!(params[:from]) | ||
| @to = City.find_by_name!(params[:to]) | ||
| @trips = Trip.where(from: @from, to: @to).order(:start_time) | ||
| @trips = Trip.preload(bus: :services).where(from: @from, to: @to).order(:start_time).load |
| trip['bus']['services'].map do |service| | ||
| services[service] ||= Service.new(name: service) | ||
| end | ||
| end |
Collaborator
There was a problem hiding this comment.
Очень чисто написано, легко читается сверху вниз за один раз 👍
| </ul> | ||
| <%= render "delimiter" %> | ||
| <% end %> | ||
| <%= render partial: 'trip', collection: @trips, spacer_template: 'delimiter' %> |
|
|
||
| Перенес код по импорту данных из rake task в отдельный интерактор `ImportData` | ||
|
|
||
| Для того, чтобы лучше разобраться в коде и защитить его, написал rspec тесты и сделал рефакторинг |
| #### 5. | ||
|
|
||
| Вернул обратно partials, но сделал их вызов с указанием коллекции | ||
| Это сделало код более читабельным, но при этом мы не потеряли в производительности |
Collaborator
There was a problem hiding this comment.
Полностью согласен, почти всем на ревью пишу этот варик
| | |ДО |ПОСЛЕ ПЕРВОГО ШАГА |ПОСЛЕ ОБНОВЛЕНИЯ RUBY | | ||
| |------------------|--------------------------|--------------------------|----------------------| | ||
| | example.json | 0.547757 сек | 0.257931 сек | 0.221117 сек | | ||
| | large.json | очень долго | 56 сек | 45.511732 сек | |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.