mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
* Flatten Holding model * Flatten balance model * Entries domain renames * Fix valuations reference * Fix trades stream * Fix brakeman warnings * Fix tests * Replace existing entryable type references in DB
17 lines
420 B
Ruby
17 lines
420 B
Ruby
class Transaction < ApplicationRecord
|
|
include Entryable, Transferable, Provided
|
|
|
|
belongs_to :category, optional: true
|
|
belongs_to :merchant, optional: true
|
|
|
|
has_many :taggings, as: :taggable, dependent: :destroy
|
|
has_many :tags, through: :taggings
|
|
|
|
accepts_nested_attributes_for :taggings, allow_destroy: true
|
|
|
|
class << self
|
|
def search(params)
|
|
Search.new(params).build_query(all)
|
|
end
|
|
end
|
|
end
|