cirandas.net

ref: master

plugins/suppliers/lib/suppliers_plugin/product_helper.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
module SuppliersPlugin::ProductHelper

  protected

  def supplier_choices suppliers
    @supplier_choices ||= suppliers.map do |s|
      [s.abbreviation_or_name, s.id]
    end.sort{ |a,b| a[0].downcase <=> b[0].downcase }
  end

end