Class: Spree::CreditCards::Find

Inherits:
BaseFinder show all
Defined in:
app/finders/spree/credit_cards/find.rb

Instance Attribute Summary

Attributes inherited from BaseFinder

#params, #scope

Instance Method Summary collapse

Methods inherited from BaseFinder

#initialize

Constructor Details

This class inherits a constructor from Spree::BaseFinder

Instance Method Details

#executeObject



4
5
6
7
8
9
# File 'app/finders/spree/credit_cards/find.rb', line 4

def execute
  return scope.default.take if params[:id].eql?('default')
  return scope.where(payment_method_id: params[:filter]['payment_method_id']) if params[:filter].present?

  scope
end