Skip to content

Commit

Permalink
Add reorder
Browse files Browse the repository at this point in the history
add reorder(nil) for the issue - spree-contrib#191
  • Loading branch information
rafayet-monon authored Aug 7, 2021
1 parent af4d7b9 commit 1e1fc26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/spree/product_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Spree
module ProductDecorator
def self.prepended(base)
base.has_many :relations, -> { order(:position) }, class_name: 'Spree::Relation', as: :relatable
base.has_many :relation_types, -> { distinct }, class_name: 'Spree::RelationType', through: :relations
base.has_many :relation_types, -> { distinct.reorder(nil) }, class_name: 'Spree::RelationType', through: :relations

# When a Spree::Product is destroyed, we also want to destroy all
# Spree::Relations "from" it as well as "to" it.
Expand Down

0 comments on commit 1e1fc26

Please sign in to comment.