Skip to content
Snippets Groups Projects
Commit d27ed43d authored by Andrew8xx8's avatar Andrew8xx8
Browse files

Hash syntax improved

parent 557a9fa3
No related branches found
No related tags found
1 merge request!3023State machine integrated to Issues, Merge Requests, Milestones
Loading
Loading
@@ -25,13 +25,13 @@ class Issue < ActiveRecord::Base
 
acts_as_taggable_on :labels
 
state_machine :state, :initial => :opened do
state_machine :state, initial: :opened do
event :close do
transition [:reopened, :opened] => :closed
end
 
event :reopen do
transition :closed => :reopened
transition closed: :reopened
end
 
state :opened
Loading
Loading
Loading
Loading
@@ -29,7 +29,7 @@ class MergeRequest < ActiveRecord::Base
 
attr_accessor :should_remove_source_branch
 
state_machine :state, :initial => :opened do
state_machine :state, initial: :opened do
event :close do
transition [:reopened, :opened] => :closed
end
Loading
Loading
@@ -39,7 +39,7 @@ class MergeRequest < ActiveRecord::Base
end
 
event :reopen do
transition :closed => :reopened
transition closed: :reopened
end
 
state :opened
Loading
Loading
Loading
Loading
@@ -26,13 +26,13 @@ class Milestone < ActiveRecord::Base
validates :title, presence: true
validates :project, presence: true
 
state_machine :state, :initial => :active do
state_machine :state, initial: :active do
event :close do
transition :active => :closed
transition active: :closed
end
 
event :activate do
transition :closed => :active
transition closed: :active
end
 
state :closed
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment