Sha256: d2a1e9f31d6f07a2bffe04ea094e2f3e6d107e578b1df69ab5741a1e455e3ea9

Contents?: true

Size: 643 Bytes

Versions: 1

Compression:

Stored size: 643 Bytes

Contents

module Skr

    class BankAccount < Model

        has_code_identifier from: 'name'

        belongs_to :gl_account, class_name: 'Skr::GlAccount', export: true

        belongs_to :address,  class_name: 'Skr::Address',
                   export: { writable: true }, dependent: :destroy

        def self.default
            account = nil
            if default_id = Skr.system_settings['bank_acount_id']
                account = BankAccount.find(default_id)
            end
            account ||
                BankAccount.find_by_code( Skr.config.default_bank_account_code ) ||
                BankAccount.first
        end

    end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stockor-0.4.0 lib/skr/models/bank_account.rb