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
No related merge requests found
Loading
@@ -25,13 +25,13 @@ class Issue < ActiveRecord::Base
Loading
@@ -25,13 +25,13 @@ class Issue < ActiveRecord::Base
   
acts_as_taggable_on :labels acts_as_taggable_on :labels
   
state_machine :state, :initial => :opened do state_machine :state, initial: :opened do
event :close do event :close do
transition [:reopened, :opened] => :closed transition [:reopened, :opened] => :closed
end end
   
event :reopen do event :reopen do
transition :closed => :reopened transition closed: :reopened
end end
   
state :opened state :opened
Loading
Loading
Loading
@@ -29,7 +29,7 @@ class MergeRequest < ActiveRecord::Base
Loading
@@ -29,7 +29,7 @@ class MergeRequest < ActiveRecord::Base
   
attr_accessor :should_remove_source_branch attr_accessor :should_remove_source_branch
   
state_machine :state, :initial => :opened do state_machine :state, initial: :opened do
event :close do event :close do
transition [:reopened, :opened] => :closed transition [:reopened, :opened] => :closed
end end
Loading
@@ -39,7 +39,7 @@ class MergeRequest < ActiveRecord::Base
Loading
@@ -39,7 +39,7 @@ class MergeRequest < ActiveRecord::Base
end end
   
event :reopen do event :reopen do
transition :closed => :reopened transition closed: :reopened
end end
   
state :opened state :opened
Loading
Loading
Loading
@@ -26,13 +26,13 @@ class Milestone < ActiveRecord::Base
Loading
@@ -26,13 +26,13 @@ class Milestone < ActiveRecord::Base
validates :title, presence: true validates :title, presence: true
validates :project, presence: true validates :project, presence: true
   
state_machine :state, :initial => :active do state_machine :state, initial: :active do
event :close do event :close do
transition :active => :closed transition active: :closed
end end
   
event :activate do event :activate do
transition :closed => :active transition closed: :active
end end
   
state :closed 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