Class: Plutus::Entry
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Plutus::Entry
- Defined in:
- app/models/plutus/entry.rb
Overview
Entries are the recording of debits and credits to various accounts. This table can be thought of as a traditional accounting Journal.
Posting to a Ledger can be considered to happen automatically, since Accounts have the reverse ‘has_many’ relationship to either it’s credit or debit entries
Class Method Summary collapse
-
.build(hash) ⇒ Object
Support the deprecated .build method.
Instance Method Summary collapse
-
#default_date ⇒ Object
attr_accessible :credits, :debits.
Class Method Details
.build(hash) ⇒ Object
Support the deprecated .build method
55 56 57 58 |
# File 'app/models/plutus/entry.rb', line 55 def self.build(hash) ActiveSupport::Deprecation.warn('Plutus::Transaction.build() is deprecated (use new instead)', caller) new(hash) end |
Instance Method Details
#default_date ⇒ Object
attr_accessible :credits, :debits
49 50 51 52 |
# File 'app/models/plutus/entry.rb', line 49 def default_date todays_date = ActiveRecord.default_timezone == :utc ? Time.now.utc : Time.now self.date ||= todays_date end |