diff --git a/Gemfile.lock b/Gemfile.lock index df3f6058..0f715f4a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,13 +8,13 @@ GEM remote: https://rubygems.org/ specs: RedCloth (4.2.9) - aasm (3.0.22) - actionmailer (3.2.14) - actionpack (= 3.2.14) + aasm (3.0.25) + actionmailer (3.2.16) + actionpack (= 3.2.16) mail (~> 2.5.4) - actionpack (3.2.14) - activemodel (= 3.2.14) - activesupport (= 3.2.14) + actionpack (3.2.16) + activemodel (= 3.2.16) + activesupport (= 3.2.16) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) @@ -22,23 +22,23 @@ GEM rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.2.1) - activemodel (3.2.14) - activesupport (= 3.2.14) + activemodel (3.2.16) + activesupport (= 3.2.16) builder (~> 3.0.0) - activerecord (3.2.14) - activemodel (= 3.2.14) - activesupport (= 3.2.14) + activerecord (3.2.16) + activemodel (= 3.2.16) + activesupport (= 3.2.16) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.14) - activemodel (= 3.2.14) - activesupport (= 3.2.14) - activesupport (3.2.14) + activeresource (3.2.16) + activemodel (= 3.2.16) + activesupport (= 3.2.16) + activesupport (3.2.16) i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) acts_as_list (0.3.0) activerecord (>= 3.0) - arel (3.0.2) + arel (3.0.3) aruba (0.5.3) childprocess (>= 0.3.6) cucumber (>= 1.1.1) @@ -46,9 +46,10 @@ GEM bcrypt-ruby (3.1.2) bluecloth (2.2.0) builder (3.0.4) - bullet (4.6.0) - uniform_notifier - capybara (2.1.0) + bullet (4.7.1) + activesupport + uniform_notifier (>= 1.4.0) + capybara (2.2.0) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) @@ -63,11 +64,11 @@ GEM coffee-script-source execjs coffee-script-source (1.6.3) - cucumber (1.3.6) + cucumber (1.3.10) builder (>= 2.1.2) diff-lcs (>= 1.1.3) - gherkin (~> 2.12.0) - multi_json (~> 1.7.5) + gherkin (~> 2.12) + multi_json (>= 1.7.5, < 2.0) multi_test (>= 0.0.2) cucumber-rails (1.4.0) capybara (>= 1.1.2) @@ -75,39 +76,40 @@ GEM nokogiri (>= 1.5.0) rails (>= 3.0.0) database_cleaner (0.9.1) - diff-lcs (1.2.4) + diff-lcs (1.2.5) + docile (1.1.1) erubis (2.7.0) - execjs (2.0.1) + execjs (2.0.2) factory_girl (4.2.0) activesupport (>= 3.0.0) factory_girl_rails (4.2.1) factory_girl (~> 4.2.0) railties (>= 3.0.0) - ffi (1.9.0) + ffi (1.9.3) formatize (1.1.0) RedCloth (~> 4.2) actionpack (~> 3.0) bluecloth (~> 2.2) - gherkin (2.12.1) + gherkin (2.12.2) multi_json (~> 1.3) hike (1.2.3) htmlentities (4.3.1) - i18n (0.6.5) + i18n (0.6.9) journey (1.0.4) jquery-rails (2.3.0) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - json (1.8.0) + json (1.8.1) libv8 (3.16.14.3) mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) - mime-types (1.25) - mini_portile (0.5.1) - multi_json (1.7.9) - multi_test (0.0.2) - mysql2 (0.3.13) - nokogiri (1.6.0) + mime-types (1.25.1) + mini_portile (0.5.2) + multi_json (1.8.2) + multi_test (0.0.3) + mysql2 (0.3.14) + nokogiri (1.6.1) mini_portile (~> 0.5.0) polyglot (0.3.3) rack (1.4.5) @@ -119,47 +121,48 @@ GEM rack rack-test (0.6.2) rack (>= 1.0) - rails (3.2.14) - actionmailer (= 3.2.14) - actionpack (= 3.2.14) - activerecord (= 3.2.14) - activeresource (= 3.2.14) - activesupport (= 3.2.14) + rails (3.2.16) + actionmailer (= 3.2.16) + actionpack (= 3.2.16) + activerecord (= 3.2.16) + activeresource (= 3.2.16) + activesupport (= 3.2.16) bundler (~> 1.0) - railties (= 3.2.14) - rails_autolink (1.1.0) + railties (= 3.2.16) + rails_autolink (1.1.5) rails (> 3.1) - railties (3.2.14) - actionpack (= 3.2.14) - activesupport (= 3.2.14) + railties (3.2.16) + actionpack (= 3.2.16) + activesupport (= 3.2.16) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - rake (10.1.0) + rake (10.1.1) rdoc (3.12.2) json (~> 1.4) ref (1.0.5) - rspec-expectations (2.14.2) + rspec-expectations (2.14.4) diff-lcs (>= 1.1.3, < 2.0) - rubyzip (0.9.9) - safe_yaml (0.9.5) + rubyzip (1.1.0) + safe_yaml (0.9.7) sanitize (2.0.6) nokogiri (>= 1.4.4) - sass (3.2.10) + sass (3.2.13) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - selenium-webdriver (2.35.1) + selenium-webdriver (2.39.0) childprocess (>= 0.2.5) multi_json (~> 1.0) - rubyzip (< 1.0.0) + rubyzip (~> 1.0) websocket (~> 1.0.4) - simplecov (0.7.1) - multi_json (~> 1.0) - simplecov-html (~> 0.7.1) - simplecov-html (0.7.1) + simplecov (0.8.2) + docile (~> 1.1.0) + multi_json + simplecov-html (~> 0.8.0) + simplecov-html (0.8.0) sprockets (2.2.2) hike (~> 1.2) multi_json (~> 1.0) @@ -174,23 +177,23 @@ GEM ref thor (0.18.1) tilt (1.4.1) - timecop (0.6.3) - tolk (1.3.11) + timecop (0.7.1) + tolk (1.3.12) safe_yaml (~> 0.8) will_paginate treetop (1.4.15) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.37) + tzinfo (0.3.38) uglifier (1.3.0) execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) - uniform_notifier (1.3.0) + uniform_notifier (1.4.0) websocket (1.0.7) - will_paginate (3.0.4) + will_paginate (3.0.5) xpath (2.0.0) nokogiri (~> 1.3) - yard (0.8.7) + yard (0.8.7.3) PLATFORMS ruby diff --git a/app/models/project.rb b/app/models/project.rb index e5e6205e..c048d1af 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -19,24 +19,24 @@ class Project < ActiveRecord::Base include AASM aasm_column :state - aasm_initial_state :active + aasm.initial_state :active # extend NamePartFinder # include Tracks::TodoList - aasm_state :active - aasm_state :hidden, :enter => :hide_todos, :exit => :unhide_todos - aasm_state :completed, :enter => :set_completed_at_date, :exit => :clear_completed_at_date + aasm.state :active + aasm.state :hidden, :enter => :hide_todos, :exit => :unhide_todos + aasm.state :completed, :enter => :set_completed_at_date, :exit => :clear_completed_at_date - aasm_event :activate do + aasm.event :activate do transitions :to => :active, :from => [:active, :hidden, :completed] end - aasm_event :hide do + aasm.event :hide do transitions :to => :hidden, :from => [:active, :completed] end - aasm_event :complete do + aasm.event :complete do transitions :to => :completed, :from => [:active, :hidden] end @@ -104,7 +104,7 @@ class Project < ActiveRecord::Base # as a result of acts_as_state_machine calling state=() to update the attribute def transition_to(candidate_state) case candidate_state.to_sym - when aasm_current_state + when aasm.current_state return when :hidden hide! diff --git a/app/models/recurring_todo.rb b/app/models/recurring_todo.rb index def17a7a..58333014 100644 --- a/app/models/recurring_todo.rb +++ b/app/models/recurring_todo.rb @@ -14,16 +14,16 @@ class RecurringTodo < ActiveRecord::Base include AASM aasm_column :state - aasm_initial_state :active + aasm.initial_state :active - aasm_state :active, :enter => Proc.new { |t| t.occurences_count = 0 } - aasm_state :completed, :enter => Proc.new { |t| t.completed_at = Time.zone.now }, :exit => Proc.new { |t| t.completed_at = nil } + aasm.state :active, :enter => Proc.new { |t| t.occurences_count = 0 } + aasm.state :completed, :enter => Proc.new { |t| t.completed_at = Time.zone.now }, :exit => Proc.new { |t| t.completed_at = nil } - aasm_event :complete do + aasm.event :complete do transitions :to => :completed, :from => [:active] end - aasm_event :activate do + aasm.event :activate do transitions :to => :active, :from => [:completed] end diff --git a/app/models/todo.rb b/app/models/todo.rb index bd8c22da..e26b6140 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -57,23 +57,23 @@ class Todo < ActiveRecord::Base # state machine include AASM aasm_column :state - aasm_initial_state Proc.new { |t| (t.show_from && t.user && (t.show_from > t.user.date)) ? :deferred : :active} + aasm.initial_state Proc.new { |t| (t.show_from && t.user && (t.show_from > t.user.date)) ? :deferred : :active} - aasm_state :active - aasm_state :project_hidden - aasm_state :completed, :enter => Proc.new { |t| t.completed_at = Time.zone.now }, :exit => Proc.new { |t| t.completed_at = nil} - aasm_state :deferred, :exit => Proc.new { |t| t[:show_from] = nil } - aasm_state :pending + aasm.state :active + aasm.state :project_hidden + aasm.state :completed, :enter => Proc.new { |t| t.completed_at = Time.zone.now }, :exit => Proc.new { |t| t.completed_at = nil} + aasm.state :deferred, :exit => Proc.new { |t| t[:show_from] = nil } + aasm.state :pending - aasm_event :defer do + aasm.event :defer do transitions :to => :deferred, :from => [:active] end - aasm_event :complete do + aasm.event :complete do transitions :to => :completed, :from => [:active, :project_hidden, :deferred, :pending] end - aasm_event :activate do + aasm.event :activate do transitions :to => :active, :from => [:project_hidden, :deferred] transitions :to => :active, :from => [:completed], :guard => :no_uncompleted_predecessors? transitions :to => :active, :from => [:pending], :guard => :no_uncompleted_predecessors_or_deferral? @@ -81,17 +81,17 @@ class Todo < ActiveRecord::Base transitions :to => :deferred, :from => [:pending], :guard => :guard_for_transition_from_deferred_to_pending end - aasm_event :hide do + aasm.event :hide do transitions :to => :project_hidden, :from => [:active, :deferred, :pending] end - aasm_event :unhide do + aasm.event :unhide do transitions :to => :deferred, :from => [:project_hidden], :guard => Proc.new{|t| !t.show_from.blank? } transitions :to => :pending, :from => [:project_hidden], :guard => :uncompleted_predecessors? transitions :to => :active, :from => [:project_hidden] end - aasm_event :block do + aasm.event :block do transitions :to => :pending, :from => [:active, :deferred, :project_hidden] end @@ -350,6 +350,7 @@ class Todo < ActiveRecord::Base elsif !(value.nil? || value.is_a?(NullProject)) p = Project.find_by_name(value[:name]) p = Project.create(value) if p.nil? + self.original_project=(p) else self.original_project=value diff --git a/app/views/projects/show.m.erb b/app/views/projects/show.m.erb index 9ac8c90e..e457801b 100644 --- a/app/views/projects/show.m.erb +++ b/app/views/projects/show.m.erb @@ -28,4 +28,4 @@ <% else -%><%= render :partial => "notes/notes_summary", :collection => @project.notes %> <% end -%>