Skip to content

Commit

Permalink
Use .sort_by instead of .order
Browse files Browse the repository at this point in the history
active_hash had an issue raised which seems to relate to the bug in
production where .order method breaks finder, returning the wrong record
for the given parameters

active-hash/active_hash#193
  • Loading branch information
beeLorna committed May 14, 2023
1 parent 643d4b4 commit afcc6ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/plants_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def index
end
end

@plants = Plant.where(filter).order(week: :desc)
@plants = Plant.where(filter).sort_by(&:week).reverse
end

def show
Expand Down

0 comments on commit afcc6ce

Please sign in to comment.