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

Add Transaction#mutated? #308

Closed
no-reply opened this issue Aug 10, 2016 · 1 comment
Closed

Add Transaction#mutated? #308

no-reply opened this issue Aug 10, 2016 · 1 comment
Assignees
Labels

Comments

@no-reply
Copy link
Member

no-reply commented Aug 10, 2016

This would check whether the Transaction has any changes from the target Repository.

For the implementations we have now, the check would be easy to implement and cheap:

  • For the base class, it's changes.inserts.empty? && changes.deletes.empty?;
  • For the SerializableTransaction it's a simple object equality check on two Hamster::Hash instances.

For other transactions, things might not be so easy. We could recommend NotImplementedError in that case, or provide an API like #<=>'s nil for "not comparable".

As a motivating use case, see: samvera/ldp#28 (comment)

@artob artob added the feature label Aug 11, 2016
@artob
Copy link
Member

artob commented Aug 11, 2016

I would generally prefer #mutated? over #changed?, as a more specific term. ("What changed? Oh, it was mutated.")

@no-reply no-reply changed the title Add Transaction#changed? or similar? Add Transaction#mutated? Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants