Sha256: 9602183fc9dc6aef7e5b3731c0925e73eb3db9268080f046420050d8bc8f9d03
Contents?: true
Size: 710 Bytes
Versions: 16
Compression:
Stored size: 710 Bytes
Contents
module Spree module OptionValues class FindAvailable include ProductFilterable def initialize(scope: OptionValue.spree_base_scopes, products_scope: Product.spree_base_scopes) @scope = scope @products_scope = products_scope end def execute find_available(scope, products_scope).includes(:translations).select(select_args).order(order_args) end private attr_reader :scope, :products_scope def select_args "#{OptionValue.table_name}.*, #{OptionType.table_name}.position AS option_type_position" end def order_args "option_type_position, #{OptionValue.table_name}.position" end end end end
Version data entries
16 entries across 16 versions & 1 rubygems