Class: Spree::ReturnReason
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spree::ReturnReason
- Includes:
- NamedType
- Defined in:
- app/models/spree/return_reason.rb
Class Method Summary collapse
Class Method Details
.reasons_for_return_items(return_items) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'app/models/spree/return_reason.rb', line 7 def self.reasons_for_return_items(return_items) reasons = Spree::ReturnReason.active # Only allow an inactive reason if it's already associated to a return item return_items.each do |return_item| if return_item.return_reason && !return_item.return_reason.active? reasons << return_item.return_reason end end reasons end |