Skip to content

Commit

Permalink
Use a more idiomatic way of building strings
Browse files Browse the repository at this point in the history
String interpolation is the much preferred way to join strings in Ruby,
and also avoids issues were `:+` can sometimes not work as expected.

Worth noting:  I was getting errors on this line when running the code
locally when `@ems_id` was an integer.  It might be that in the
controller, it is passed in as a string, but this way, either works and
Ruby will convert it as needed.
  • Loading branch information
NickLaMuro committed Aug 10, 2018
1 parent 0446030 commit 0cff4de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/ems_dashboard_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def format_data(ems_type, attributes, attr_icon, attr_url, attr_hsh)
attr_data = []
attributes.each do |attr|
attr_data.push(
:id => attr_hsh[attr] + '_' + @ems_id,
:id => "#{attr_hsh[attr]}_#{@ems_id}",
:iconClass => attr_icon[attr],
:title => attr_hsh[attr],
:count => @ems.send(attr).count,
Expand Down

0 comments on commit 0cff4de

Please sign in to comment.