Module: Freemium::Transaction

Included in:
AccountTransaction
Defined in:
lib/freemium/transaction.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/freemium/transaction.rb', line 4

def self.included(base)
  base.class_eval do
    scope :since, lambda { |time| where(["created_at >= ?", time]) }

    belongs_to :subscription, :class_name => "Subscription"

    composed_of :amount, :class_name => 'Money', :mapping => [ %w(amount_cents cents) ], :allow_nil => true
  end
end