Skip to content

Commit

Permalink
🚧 Add OrderMetadataValues module for boot up
Browse files Browse the repository at this point in the history
This module is needed for the application to boot up because it is being
called by OER and ETD.
  • Loading branch information
kirkkwang committed Jun 4, 2024
1 parent 67ce76d commit 4f7584f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/models/concerns/order_metadata_values.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

module OrderMetadataValues
extend ActiveSupport::Concern

included do
def self.multi_valued_properties_for_ordering
properties.collect do |prop_name, node_config|
# Only concerned with properties displayed to end users
next if %w[head tail based_near].include?(prop_name)

prop_name.to_sym if node_config.instance_variable_get(:@opts)&.dig(:multiple)
end.compact
end

prepend OrderAlready.for(*multi_valued_properties_for_ordering)
end
end

0 comments on commit 4f7584f

Please sign in to comment.