Module: Bookkeeping::Extension::ClassMethods

Defined in:
app/models/bookkeeping/extension.rb

Instance Method Summary collapse

Instance Method Details

#has_accounts(&block) ⇒ Object



19
20
21
22
23
24
25
# File 'app/models/bookkeeping/extension.rb', line 19

def has_accounts(&block)
  has_many :accounts, as: :accountable, class_name: 'Bookkeeping::Account', inverse_of: :accountable do
    extend ProxyMethods

    class_eval(&block) if block
  end
end