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
Prepend timestamps with namespace to avoid naming conflicts #754
base: master
Are you sure you want to change the base?
Conversation
lib/aasm/base.rb
Outdated
@@ -263,12 +263,13 @@ def skip_instance_level_validation(event, name, aasm_name, klass) | |||
end | |||
end | |||
|
|||
def setup_timestamps(aasm_name) | |||
def setup_timestamps(aasm_name, namespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method setup_timestamps
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Code Climate has analyzed commit 61fe78e and detected 1 issue on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Bump this for sure, although I think it would be better if this were enabled through options.
Also, It looks like the README needs to be updated also before this could be merged. And as a small aside to this gem's maintainers: Cognitive Complexity is a rather subjective nag. 5 is far too sensitive, IMHO. |
+1 for this issue, a timestamps prefix would also be nice (but then isn't that what the namespace already is?) |
Current behavior is wrong definitely, it's a bug. Why there's no attention to this PR? |
Context:
A class contains two state machines that have conflicting state names and they are both using timestamps. At least one is using a namespace.
Actual behavior:
The timestamp of a particular state from the first state machine will be overridden by the transition to the conflicting state of the second state machine.
New behavior:
The timestamps are prepended by the namespace when provided to avoid name collision.