mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
* Initial pass at Plaid EU * Add EU support to Plaid Items * Lint * Temp fix for rubocop isseus * Merge cleanup * Pass in region and get tests passing * Use absolute path for translation --------- Signed-off-by: Josh Pigford <josh@joshpigford.com>
23 lines
515 B
Ruby
23 lines
515 B
Ruby
module Plaidable
|
|
extend ActiveSupport::Concern
|
|
|
|
class_methods do
|
|
def plaid_provider
|
|
Provider::Plaid.new if Rails.application.config.plaid
|
|
end
|
|
|
|
def plaid_eu_provider
|
|
Provider::Plaid.new if Rails.application.config.plaid_eu
|
|
end
|
|
|
|
def plaid_provider_for(plaid_item)
|
|
return nil unless plaid_item
|
|
plaid_item.eu? ? plaid_eu_provider : plaid_provider
|
|
end
|
|
end
|
|
|
|
private
|
|
def plaid_provider_for(plaid_item)
|
|
self.class.plaid_provider_for(plaid_item)
|
|
end
|
|
end
|