Sha256: b2123a0c222ac0d58377640a975135d52d03f0d95e99e3c1db42762564cb823b

Contents?: true

Size: 1.21 KB

Versions: 141

Compression:

Stored size: 1.21 KB

Contents

module Oauth::StripeAccounts::Base
  extend ActiveSupport::Concern
  # 🚅 add concerns above.

  included do
    belongs_to :user, optional: true
    # 🚅 add belongs_to associations above.

    has_many :webhooks_incoming_oauth_stripe_account_webhooks, class_name: "Webhooks::Incoming::Oauth::StripeAccountWebhook", foreign_key: "oauth_stripe_account_id"
    has_many :integrations_stripe_installations, class_name: "Integrations::StripeInstallation", foreign_key: "oauth_stripe_account_id"
    # 🚅 add has_many associations above.

    # 🚅 add has_one associations above.

    # 🚅 add scopes above.

    validates :uid, presence: true
    # 🚅 add validations above.

    # 🚅 add callbacks above.

    # 🚅 add delegations above.
  end

  def label_string
    name
  end

  # TODO You should update this with an implementation appropriate for the provider you're integrating with.
  # This must return _something_, otherwise new installations won't save.
  def name
    data.dig("info", "name").presence || "Stripe Account"
  rescue
    "Stripe Account"
  end

  def name_was
    name
  end

  def update_from_oauth(auth)
    self.uid = auth.uid
    self.data = auth
    save
  end

  # 🚅 add methods above.
end

Version data entries

141 entries across 141 versions & 1 rubygems

Version Path
bullet_train-integrations-stripe-1.6.26 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.25 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.24 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.23 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.22 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.21 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.20 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.19 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.18 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.17 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.16 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.15 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.14 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.13 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.12 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.11 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.10 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.9 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.8 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.6.7 app/models/concerns/oauth/stripe_accounts/base.rb