Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not modify the value if it is the same. #837

Merged
merged 2 commits into from Oct 1, 2018
Merged

Conversation

teclator
Copy link
Contributor

@teclator teclator commented Sep 26, 2018

A simple fix for http://bugzilla.suse.com/show_bug.cgi?id=1109812

The bug appeared because this change:

https://github.com/yast/yast-yast2/pull/818/files#diff-d15e2fb4c53a9dc67f63ddf07c2b6aaeL148

Now we do not check current value when writing, with this change we should not mark it as modified if the value is the same.

@coveralls
Copy link

coveralls commented Sep 26, 2018

Coverage Status

Coverage increased (+0.004%) to 30.493% when pulling bcc3380 on bug_1109812 into ecad7e8 on SLE-15-GA.

@@ -183,6 +184,7 @@ def has_many(*relations, scope: nil, cache: false) # rubocop:disable Style/Predi
attr_reader relation

define_method "#{relation}=" do |item|
return item if public_send(relation) == item
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It could be improved, doing a sort of the items but will need other checks, so not added by now.

Copy link
Member

@schubi2 schubi2 left a comment

Choose a reason for hiding this comment

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

LGTM

@teclator teclator merged commit 7773623 into SLE-15-GA Oct 1, 2018
@teclator teclator deleted the bug_1109812 branch October 1, 2018 08:23
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.

None yet

3 participants