Sha256: b2123a0c222ac0d58377640a975135d52d03f0d95e99e3c1db42762564cb823b

Contents?: true

Size: 1.21 KB

Versions: 140

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

140 entries across 140 versions & 1 rubygems

Version Path
bullet_train-integrations-stripe-1.10.0 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.9.0 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.8.5 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.8.4 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.8.3 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.8.2 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.8.1 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.8.0 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.7.23 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.7.22 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.7.21 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.7.20 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.7.19 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.7.18 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.7.17 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.7.16 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.7.15 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.7.14 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.7.13 app/models/concerns/oauth/stripe_accounts/base.rb
bullet_train-integrations-stripe-1.7.12 app/models/concerns/oauth/stripe_accounts/base.rb