Skip to content

Commit

Permalink
Annotate code segments with comments
Browse files Browse the repository at this point in the history
  • Loading branch information
akadusei committed Dec 6, 2024
1 parent d48def3 commit b8cee00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bill/operations/mixins/validate_has_line_items.cr
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ module Bill::ValidateHasLineItems
private def validate_has_line_items
return unless {{ T }}Status.now_finalized?(status)

unless record
unless record # If creating
return unless responds_to?(:line_items_to_create) &&
self.line_items_to_create.empty?
end

record.try do |record|
record.try do |record| # If updating
return unless record.line_items.empty?

return unless responds_to?(:line_items_to_save) &&
Expand Down

0 comments on commit b8cee00

Please sign in to comment.