Skip to content

Conversation

@VGasparini
Copy link
Contributor

Even in update operations, the change set can may be null

image

So, an error is throw when try to iterate over it

image

@VGasparini VGasparini self-assigned this Oct 13, 2025
@VGasparini VGasparini requested a review from andrepiske October 13, 2025 13:14
Copy link
Member

@andrepiske andrepiske left a comment

Choose a reason for hiding this comment

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

oh I see. I guess it can never be nil when generated by irontrail itself (at least it shouldn't) but maybe for synthetic records (e.g. imported records).

Can you please add a test case to check this condition?

this method is currently tested in

describe 'ChangeModelConcern#compute_changeset' do
before { hotel }
let(:cest) { Time.find_zone('Europe/Vienna') }
let(:trail) { ordered_trails[1] }
subject(:changeset) { trail.compute_changeset }
it 'has the right time in Japan' do
expect(changeset['time_in_japan'][0]).to eq(cest.parse('2023-07-23 14:22:55.021'))
expect(changeset['time_in_japan'][1]).to eq(cest.parse('2023-10-13T17:16:15.021'))
end
it 'has the right time at the Hotel' do
expect(changeset['hotel_time'][0]).to eq(cest.parse('2023-04-25 15:22:54.833'))
expect(changeset['hotel_time'][1]).to eq(cest.parse('2023-10-12 16:18:29.422'))
end
end

The CONTRIBUTING.md file should help you run tests locally :)

@VGasparini VGasparini requested a review from andrepiske October 13, 2025 18:24
@mhfs mhfs merged commit 5990d94 into main Oct 17, 2025
10 checks passed
@mhfs mhfs deleted the fix/compute_changeset branch October 17, 2025 17:07
andrepiske added a commit that referenced this pull request Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants