Sha256: 9ff9c65ffdfa269f43e4bf6abe9084a181cd5a1bbf129b19a86ec7bc2208a832

Contents?: true

Size: 419 Bytes

Versions: 2

Compression:

Stored size: 419 Bytes

Contents

require 'active_support/concern'

module PuntoPagosRails
  module ResourceExtension
    extend ActiveSupport::Concern

    included do
      has_many :transactions, class_name: 'PuntoPagosRails::Transaction', foreign_key: :resource_id

      def paid?
        return false unless self.transactions.any?
        self.transactions.last.completed?
      end
    end

    module ClassMethods
      # TODO
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
punto_pagos_rails-0.0.2 lib/punto_pagos_rails/resource_extension.rb
punto_pagos_rails-0.0.1 lib/punto_pagos_rails/resource_extension.rb