Sha256: b96e028763b1ea1f10381fdc9ac4523bc8ddacf5e038d58cad27fd3974dca7d8

Contents?: true

Size: 705 Bytes

Versions: 5

Compression:

Stored size: 705 Bytes

Contents

module BraintreeRails
  class Plan
    include Model

    singleton_class.not_supported_apis(:delete)
    not_supported_apis(:create, :create!, :update, :update!, :destroy)

    define_attributes(
      :readonly => [
        :billing_day_of_month, :billing_frequency, :created_at, :currency_iso_code, :description, :id, :merchant_id, :name,
        :number_of_billing_cycles, :price, :trial_duration, :trial_duration_unit, :trial_period, :updated_at
      ]
    )
    has_many :add_ons,       :class => AddOns
    has_many :discounts,     :class => Discounts
    has_many :subscriptions, :class => Subscriptions

    def self.all
      braintree_model_class.all.map{ |plan| new(plan) }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
braintree-rails-1.2.3 lib/braintree_rails/plan.rb
braintree-rails-1.2.2 lib/braintree_rails/plan.rb
braintree-rails-1.2.1 lib/braintree_rails/plan.rb
braintree-rails-1.2.0 lib/braintree_rails/plan.rb
braintree-rails-1.1.0 lib/braintree_rails/plan.rb