mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
Create named scope for each state name #365
This commit is contained in:
parent
c73f883e1c
commit
7ba401b991
1 changed files with 3 additions and 3 deletions
|
@ -53,9 +53,9 @@ module AASM
|
|||
|
||||
class Base
|
||||
# make sure to create a (named) scope for each state
|
||||
def state_with_scope(name, *args)
|
||||
state_without_scope(name, *args)
|
||||
create_scope(name) if create_scope?(name)
|
||||
def state_with_scope(*args)
|
||||
names = state_without_scope(*args)
|
||||
names.each { |name| create_scope(name) if create_scope?(name) }
|
||||
end
|
||||
alias_method :state_without_scope, :state
|
||||
alias_method :state, :state_with_scope
|
||||
|
|
Loading…
Reference in a new issue