Sha256: 0ff230a0962dab470d401def5040545f48c473fd3bb12d7b84ada5ed6786fc78

Contents?: true

Size: 356 Bytes

Versions: 4

Compression:

Stored size: 356 Bytes

Contents

require 'active_support/concern'

module Moneytree
  module Order
    extend ActiveSupport::Concern

    included do
      has_many :moneytree_transactions, class_name: 'Moneytree::Transaction', foreign_key: 'order_id', inverse_of: :order, as: :order
    end

    def new_payment(*args)
      moneytree_transactions << Payment.new(*args)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
moneytree-rails-0.1.7 lib/moneytree/order.rb
moneytree-rails-0.1.6 lib/moneytree/order.rb
moneytree-rails-0.1.5 lib/moneytree/order.rb
moneytree-rails-0.1.4 lib/moneytree/order.rb