Skip to content

Commit

Permalink
Add back presets removed unitentionally
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
akadusei committed Sep 11, 2024
1 parent 407fdda commit 8f5d86b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 12 additions & 3 deletions src/bill/models/transaction.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8f5d86b

Please sign in to comment.