Hash syntax improved
This commit is contained in:
parent
557a9fa321
commit
d27ed43daa
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
|
@ -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…
Reference in a new issue