Sha256: 4d8daec5bfc167448e2ba1956ccc86123ba7353d663bd888b97e3df269e07661

Contents?: true

Size: 469 Bytes

Versions: 3

Compression:

Stored size: 469 Bytes

Contents

Spree::PaymentMethod.class_eval do
  has_many :store_payment_methods
  has_many :stores, :through => :store_payment_methods

  def self.available(display_on = 'both', store = nil)
    result = all.select do |p|
      p.active &&
        (p.environment == Rails.env || p.environment.blank?) &&
        (store.nil? || store.payment_methods.empty? || store.payment_methods.include?(p)) &&
        (p.display_on == display_on.to_s || p.display_on.blank?)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
solidus_multi_domain-1.0.3 app/models/spree/payment_method_decorator.rb
solidus_multi_domain-1.0.1 app/models/spree/payment_method_decorator.rb
solidus_multi_domain-1.0.0 app/models/spree/payment_method_decorator.rb