lib/onix/product.rb
# :category: High level
# List of ONIX outlets values
:category: High level
List of ONIX outlets values
: category : High level List of ONIX outlets values
def onix_outlets_values
      if @publishing_detail
        @publishing_detail.sales_rights.map { |sri|
          sri.sales_restrictions.select { |sr| (!sr.start_date or sr.start_date <= Date.today) and (!sr.end_date or sr.end_date >= Date.today) }.map { |sr|
            sr.sales_outlets.select { |so|
              so.identifier and so.identifier.type.human=="OnixSalesOutletIdCode" }.map { |so| so.identifier.value } } }.flatten
      else
        []
      end
    end
def onix_outlets_values if @publishing_detail @publishing_detail . sales_rights . map { | sri | sri . sales_restrictions . select { | sr | ( ! sr . start_date or sr . start_date <= Date . today ) and ( ! sr . end_date or sr . end_date >= Date . today ) } . map { | sr | sr . sales_outlets . select { | so | so . identifier and so . identifier . type . human == "OnixSalesOutletIdCode" } . map { | so | so . identifier . value } } } . flatten else [ ] end end
:category: High level
List of ONIX outlets values
: category : High level List of ONIX outlets values