Skip to content

Conversation

@Akise17
Copy link

@Akise17 Akise17 commented Jun 10, 2025

No description provided.

@Akise17 Akise17 force-pushed the feature/make_type_code_configurable branch from 7b88e50 to 27170b7 Compare June 17, 2025 05:04
@Akise17 Akise17 force-pushed the feature/make_type_code_configurable branch from 27170b7 to 750ae96 Compare June 17, 2025 05:05
@Akise17 Akise17 force-pushed the feature/make_type_code_configurable branch from 650a47f to 25f4433 Compare June 20, 2025 03:23
@Akise17 Akise17 force-pushed the feature/make_type_code_configurable branch from 25f4433 to c003d7a Compare June 20, 2025 03:23
xml['ram'].TypeCode payment_code
xml['ram'].Information payment_text
if payment_iban
xml['ram'].Information payment_text if payment_text && payment_text != ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
xml['ram'].Information payment_text if payment_text && payment_text != ''
xml['ram'].Information payment_text if payment_text.present?

Copy link
Author

@Akise17 Akise17 Jun 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tbk303 cannot using present? because it's method from rails.

# gem "rails"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's pretty easy to just copy over those methods from rails, please check my PR: https://github.com/fortytools/ruby-secretariat/pull/9/files

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bigsolom Ahh okay thanks

bigsolom and others added 3 commits July 30, 2025 19:26
introduce blank? and present? method to make checking for blank values easier
@Akise17 Akise17 merged commit 752c24e into main Jul 31, 2025
5 checks passed
trade_settlement = by_version(version, 'ApplicableSupplyChainTradeSettlement', 'ApplicableHeaderTradeSettlement')
xml['ram'].send(trade_settlement) do
if payment_reference && payment_reference != ''
if payment_reference.present?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

present? is a method from Rails and the gem does not depend on Rails, so shouldnt introduce that dependency here. In our context it probably works but we should keep this upstream compatable.

See also comment on object extensions below.

@@ -0,0 +1,14 @@
module Secretariat
module ObjectExtensions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we should do this because the upstream maintainer of the gem seems to like to stick to != ''

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO it's a better approach than !='', I create a RP for the gem to adapt this approach.
In worst case if the PR were rejected we can keep this approach for our fork and mind that when merging upstream changes to our fork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants