diff options
| author | Teddy Wing | 2018-01-30 14:53:34 +0100 |
|---|---|---|
| committer | cedricnjanga | 2018-02-06 11:04:27 -0800 |
| commit | f6a00ca090d5048772ad1869eb6d39068aba16f2 (patch) | |
| tree | 9988b91b636818803be82d6cee6c50ee0b8dbdbd /app | |
| parent | fe3e3d7d8e623d8b172aa12496e24c5d91278166 (diff) | |
| download | chouette-core-f6a00ca090d5048772ad1869eb6d39068aba16f2.tar.bz2 | |
VehicleJourney.state_permited_attributes: Fix whitespace
Add line breaks to make this method more readable.
Refs #5574
Diffstat (limited to 'app')
| -rw-r--r-- | app/models/chouette/vehicle_journey.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/models/chouette/vehicle_journey.rb b/app/models/chouette/vehicle_journey.rb index 5cd87a66a..d94b69271 100644 --- a/app/models/chouette/vehicle_journey.rb +++ b/app/models/chouette/vehicle_journey.rb @@ -220,7 +220,12 @@ module Chouette end def self.state_permited_attributes item - attrs = item.slice('published_journey_identifier', 'published_journey_name', 'journey_pattern_id', 'company_id').to_hash + attrs = item.slice( + 'published_journey_identifier', + 'published_journey_name', + 'journey_pattern_id', + 'company_id' + ).to_hash if item['journey_pattern'] attrs['journey_pattern_id'] = item['journey_pattern']['id'] @@ -228,7 +233,12 @@ module Chouette attrs['company_id'] = item['company'] ? item['company']['id'] : nil - attrs["custom_field_values"] = Hash[*(item["custom_fields"] || {}).map{|k, v| [k, v["value"]]}.flatten] + attrs["custom_field_values"] = Hash[ + *(item["custom_fields"] || {}) + .map { |k, v| [k, v["value"]] } + .flatten + ] + attrs end |
