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 simple option for auto-generated timestamps #677

Merged
merged 1 commit into from Mar 8, 2021
Merged

Add simple option for auto-generated timestamps #677

merged 1 commit into from Mar 8, 2021

Conversation

jaynetics
Copy link
Contributor

This aims to solve #418 in a slightly simpler way than #427 - by setting up a callback that, upon entering state foo, checks if there is a setter foo_at= and if so, uses it.

I've only added tests for POROs and ActiveRecord. I suspect this will work for most ORMs, but haven't looked into that.

If this is accepted it might make sense to mention the new option in the README. I just didn't know where to put it in there.

@Javierchik
Copy link

Let's merge this ASAP please!

@anilmaurya
Copy link
Member

Hi @jaynetics
Sorry, I missed your PR.
I want to merge it, can you update Readme with timestamps option and also add specs in mongoid_persistence_spec ?

@codecov-io
Copy link

codecov-io commented Nov 12, 2020

Codecov Report

Merging #677 (14ae850) into master (39e47ea) will increase coverage by 0.22%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #677      +/-   ##
==========================================
+ Coverage   95.14%   95.36%   +0.22%     
==========================================
  Files          35       35              
  Lines        1236     1252      +16     
==========================================
+ Hits         1176     1194      +18     
+ Misses         60       58       -2     
Impacted Files Coverage Δ
lib/aasm/base.rb 97.79% <100.00%> (+0.89%) ⬆️
lib/aasm/configuration.rb 100.00% <100.00%> (ø)
lib/aasm/persistence/active_record_persistence.rb 90.90% <0.00%> (-3.21%) ⬇️
lib/aasm/persistence/mongoid_persistence.rb 97.36% <0.00%> (-2.64%) ⬇️
lib/aasm/state_machine_store.rb 79.06% <0.00%> (-0.48%) ⬇️
lib/aasm/core/transition.rb 97.87% <0.00%> (-0.05%) ⬇️
lib/aasm/aasm.rb 98.95% <0.00%> (-0.03%) ⬇️
lib/aasm.rb 100.00% <0.00%> (ø)
lib/aasm/core/event.rb 97.75% <0.00%> (ø)
lib/aasm/core/state.rb 91.83% <0.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39e47ea...14ae850. Read the comment docs.

@codeclimate
Copy link

codeclimate bot commented Mar 7, 2021

Code Climate has analyzed commit 14ae850 and detected 0 issues on this pull request.

View more on Code Climate.

@jaynetics
Copy link
Contributor Author

@anilmaurya I've added a Readme entry and mongo spec as you requested. Let me know if anything else needs to be done!

@anilmaurya anilmaurya merged commit 143eedc into aasm:master Mar 8, 2021
@anilmaurya
Copy link
Member

Thank you @jaynetics for your contribution.

@jaynetics jaynetics deleted the simple_timestamps_option branch March 8, 2021 05:59
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

4 participants