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

Create namespaced scopes #735

Merged
merged 3 commits into from Mar 25, 2021

Conversation

caiohsramos
Copy link
Contributor

Closes #733

Creates namespaced scopes when namespace: ... option is provided. Keeps current behaviour of creating unnamespaced scopes.

Example

aasm column: :final_targeting_state, namespace: :final_targeting, create_scopes: true do
  state :unstarted, initial: true
  state :started
  state :succeeded
  state :failed
end

creates the scopes:

  • klass.final_targeting_unstarted
  • klass.final_targeting_started
  • klass.final_targeting_succeeded
  • klass.final_targeting_failed
  • klass.unstarted
  • klass.started
  • klass.succeeded
  • klass.failed

@codeclimate
Copy link

codeclimate bot commented Mar 25, 2021

Code Climate has analyzed commit 7b7b2dd and detected 0 issues on this pull request.

View more on Code Climate.

@codecov-io
Copy link

codecov-io commented Mar 25, 2021

Codecov Report

Merging #735 (7b7b2dd) into master (8622d3e) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #735      +/-   ##
==========================================
+ Coverage   95.36%   95.38%   +0.02%     
==========================================
  Files          35       35              
  Lines        1252     1258       +6     
==========================================
+ Hits         1194     1200       +6     
  Misses         58       58              
Impacted Files Coverage Δ
lib/aasm/persistence/base.rb 93.93% <100.00%> (+1.34%) ⬆️

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 8622d3e...7b7b2dd. Read the comment docs.

@anilmaurya anilmaurya merged commit adfeeb5 into aasm:master Mar 25, 2021
@anilmaurya
Copy link
Member

Thank you @caiohsramos for the contribution. 👍

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.

Namespaces state machines create unnamespaced scopes
3 participants