Skip to content

Commit

Permalink
configs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
drewteter committed Mar 17, 2023
1 parent 833785f commit c203d17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/models/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def self.method_missing(key, *args, &blk)
return Rails.application.config.send(key) if Rails.application.config.respond_to?(key)

Rails.logger.warn("Warning: Config #{key} was not found in the database or the application configuration, defaulting to environment")
return ENV[key.to_s] if ENV[key.to_s]
return ENV[key.to_s] if ENV[key.to_s].present?
return DEFAULT_CONFIGS[key.to_sym]
end

Expand Down
12 changes: 6 additions & 6 deletions app/views/admin/configs/_trip_planning_apis.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@

= f.input :open_trip_planner, required: true,
label: "URL of the Open Trip Planner Server",
input_html: {value: @configs.find_by(key: :open_trip_planner).try(:value)},
input_html: {value: @configs.open_trip_planner},
as: :string

= f.input :otp_itinerary_quantity, required: true,
label: "The number of Itineraries we request from OTP per transit type. This may be different from the number of Itineraries that are shown",
input_html: {value: @configs.find_by(key: :open_trip_planner).try(:value)},
input_html: {value: @configs.otp_itinerary_quantity},
as: :integer

-# = f.input :otp_max_itineraries_shown, required: true,
-# label: "The maximum number of requested Itineraries that we show per transit type.",
-# input_html: {value: @configs.find_by(key: :open_trip_planner).try(:value)},
-# input_html: {value: @configs.open_trip_planner},
-# as: :integer
=f.input :tff_api_key, required: false,
label: "API Key for Taxi Fare Finder",
input_html: {value: @configs.find_by(key: :tff_api_key).try(:value)},
input_html: {value: @configs.tff_api_key},
as: :string

=f.input :uber_token, required: false,
label: "Uber Token",
input_html: {value: @configs.find_by(key: :uber_token).try(:value)},
input_html: {value: @configs.uber_token},
as: :string

=f.input :lyft_client_token, required: false,
label: "Lyft Client Token",
input_html: {value: @configs.find_by(key: :lyft_client_token).try(:value)},
input_html: {value: @configs.lyft_client_token},
as: :string

:javascript
Expand Down

0 comments on commit c203d17

Please sign in to comment.