Sha256: 11090f831840045eafe61096d6d3b94e40e0c6d65b7804501b0c3b74e5b275d2

Contents?: true

Size: 610 Bytes

Versions: 4

Compression:

Stored size: 610 Bytes

Contents

class StripeTaxRate < StripeModelCallbacks::ApplicationRecord
  has_many :stripe_subscription_default_tax_rates, dependent: :destroy

  def self.stripe_class
    Stripe::TaxRate
  end

  def assign_from_stripe(object)
    check_object_is_stripe_class(object)
    assign_attributes(
      created: Time.zone.at(object.created),
      inclusive: object.inclusive == true,
      stripe_id: object.id
    )

    StripeModelCallbacks::AttributesAssignerService.execute!(
      model: self,
      stripe_model: object,
      attributes: %w[display_name description jurisdiction percentage inclusive]
    )
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
stripe_model_callbacks-0.1.6 lib/stripe_model_callbacks/models/stripe_tax_rate.rb
stripe_model_callbacks-0.1.5 lib/stripe_model_callbacks/models/stripe_tax_rate.rb
stripe_model_callbacks-0.1.4 lib/stripe_model_callbacks/models/stripe_tax_rate.rb
stripe_model_callbacks-0.1.3 lib/stripe_model_callbacks/models/stripe_tax_rate.rb