From 8f5d86b8b0b4ee6b153595423a21b525052c6ac8 Mon Sep 17 00:00:00 2001 From: akadusei Date: Wed, 11 Sep 2024 15:45:00 +0000 Subject: [PATCH] Add back presets removed unitentionally Fixes compile error in an app: ``` Showing last frame. Use --error-trace for full trace. In src/serializers/transaction_serializer.cr:20:35 20 | credit_note_id: transaction.credit_note_id, ^------------- Error: undefined method 'credit_note_id' for Transaction ``` --- CHANGELOG.md | 5 +++++ src/bill/models/transaction.cr | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9034183..6cdfcda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [Unreleased] - + +### Fixed +- Add back presets removed unitentionally + ## [0.19.1] - 2024-09-11 ### Removed diff --git a/src/bill/models/transaction.cr b/src/bill/models/transaction.cr index f61893c..073104e 100644 --- a/src/bill/models/transaction.cr +++ b/src/bill/models/transaction.cr @@ -3,9 +3,18 @@ module Bill::Transaction include Bill::ReferenceColumns # include Bill::BelongsToUser - # include Bill::CreditNoteTransactionSource - # include Bill::InvoiceTransactionSource - # include Bill::ReceiptTransactionSource + + {% if Avram::Model.all_subclasses.find(&.name.== :CreditNote.id) %} + include Bill::CreditNoteTransactionSource + {% end %} + + {% if Avram::Model.all_subclasses.find(&.name.== :Invoice.id) %} + include Bill::InvoiceTransactionSource + {% end %} + + {% if Avram::Model.all_subclasses.find(&.name.== :Receipt.id) %} + include Bill::ReceiptTransactionSource + {% end %} column amount : Amount column description : String