mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Use AR syntax in queries
This commit is contained in:
@@ -12,8 +12,8 @@ module Api
|
||||
|
||||
def adjustments
|
||||
adjustments = object.all_adjustments.where(
|
||||
"adjustable_type IN ('Spree::Order','Spree::Shipment')"
|
||||
).order("label DESC")
|
||||
adjustable_type: ["Spree::Order", "Spree::Shipment"]
|
||||
).order(label: :desc)
|
||||
ActiveModel::ArraySerializer.new(adjustments, each_serializer: Api::AdjustmentSerializer)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user