app/models/esa/context.rb in event_sourced_accounting-0.1.0 vs app/models/esa/context.rb in event_sourced_accounting-0.1.1
- old
+ new
@@ -1,5 +1,7 @@
+require 'esa/associations/amounts_extension'
+
module ESA
# The Context provides a persisted filtered view on the objects related to a Chart.
#
# @author Lenno Nagel
class Context < ActiveRecord::Base
@@ -12,10 +14,10 @@
has_many :rulesets, :through => :chart
has_many :unscoped_events, :through => :rulesets, :source => :events, :uniq => true
has_many :unscoped_flags, :through => :rulesets, :source => :flags, :uniq => true
has_many :unscoped_transactions, :through => :accounts, :source => :transactions, :uniq => true
- has_many :unscoped_amounts, :through => :accounts, :source => :amounts, :uniq => true, :extend => Associations::AmountsExtension
+ has_many :unscoped_amounts, :through => :accounts, :source => :amounts, :uniq => true, :extend => ESA::Associations::AmountsExtension
belongs_to :parent, :class_name => "Context"
has_many :subcontexts, :class_name => "Context", :foreign_key => "parent_id", :dependent => :destroy
after_initialize :default_values, :initialize_filters