Commit d27ed43daa18476b3fec6e705406c76a1b057f60

Authored by Andrew8xx8
1 parent 557a9fa3

Hash syntax improved

app/models/issue.rb
... ... @@ -25,13 +25,13 @@ class Issue < ActiveRecord::Base
25 25  
26 26 acts_as_taggable_on :labels
27 27  
28   - state_machine :state, :initial => :opened do
  28 + state_machine :state, initial: :opened do
29 29 event :close do
30 30 transition [:reopened, :opened] => :closed
31 31 end
32 32  
33 33 event :reopen do
34   - transition :closed => :reopened
  34 + transition closed: :reopened
35 35 end
36 36  
37 37 state :opened
... ...
app/models/merge_request.rb
... ... @@ -29,7 +29,7 @@ class MergeRequest < ActiveRecord::Base
29 29  
30 30 attr_accessor :should_remove_source_branch
31 31  
32   - state_machine :state, :initial => :opened do
  32 + state_machine :state, initial: :opened do
33 33 event :close do
34 34 transition [:reopened, :opened] => :closed
35 35 end
... ... @@ -39,7 +39,7 @@ class MergeRequest < ActiveRecord::Base
39 39 end
40 40  
41 41 event :reopen do
42   - transition :closed => :reopened
  42 + transition closed: :reopened
43 43 end
44 44  
45 45 state :opened
... ...
app/models/milestone.rb
... ... @@ -26,13 +26,13 @@ class Milestone < ActiveRecord::Base
26 26 validates :title, presence: true
27 27 validates :project, presence: true
28 28  
29   - state_machine :state, :initial => :active do
  29 + state_machine :state, initial: :active do
30 30 event :close do
31   - transition :active => :closed
  31 + transition active: :closed
32 32 end
33 33  
34 34 event :activate do
35   - transition :closed => :active
  35 + transition closed: :active
36 36 end
37 37  
38 38 state :closed
... ...