Skip to content

Commit

Permalink
fix: avoid breaking customer screen
Browse files Browse the repository at this point in the history
  • Loading branch information
lhguerra committed Nov 13, 2024
1 parent 34b41f0 commit 4d7ce8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/customers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def update_cache

def build_customer_consolidations(customer)
customer_last_data_point = customer.customer_consolidations.order(:consolidation_date).last
customer.customer_consolidations.monthly_data.or(customer.customer_consolidations.where(id: customer_last_data_point.id)).distinct.order(:consolidation_date)
customer.customer_consolidations.monthly_data.or(customer.customer_consolidations.where(id: customer_last_data_point&.id)).distinct.order(:consolidation_date)
end

def build_pressure_and_speed
Expand Down

0 comments on commit 4d7ce8a

Please sign in to comment.