mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-20 13:49:39 +02:00
* Prepare entry search for nested categories * Subcategory implementation * Remove caching for test stability
18 lines
481 B
Ruby
18 lines
481 B
Ruby
class Account::Transaction < ApplicationRecord
|
|
include Account::Entryable
|
|
|
|
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
|
|
|
|
scope :active, -> { where(excluded: false) }
|
|
|
|
class << self
|
|
def search(params)
|
|
Account::TransactionSearch.new(params).build_query(all)
|
|
end
|
|
end
|
|
end
|