Hash syntax improved

This commit is contained in:
Andrew8xx8 2013-02-18 17:22:18 +04:00
parent 557a9fa321
commit d27ed43daa
3 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -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
@ -39,7 +39,7 @@ class MergeRequest < ActiveRecord::Base
end
event :reopen do
transition :closed => :reopened
transition closed: :reopened
end
state :opened

View file

@ -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