From bc7993b658a72cdf7cf9b4c08a6cac2df9ea0405 Mon Sep 17 00:00:00 2001 From: Dan Rice Date: Sat, 27 Dec 2014 18:10:58 -0500 Subject: [PATCH 1/4] Test with Ruby 2.2 --- .travis.yml | 1 + doc/CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 144dcca1..b2fd014e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ rvm: - 1.9.3 - 2.0.0 - 2.1 + - 2.2 bundler_args: --without development --jobs=3 --retry=3 diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index d705f691..f5f8c99d 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -2,6 +2,7 @@ * Removed support for deprecated password-hashing algorithm. This eliminates config.salt. Note the addition of a pre-upgrade step to check for obsolete passwords. +* Tracks is tested on Ruby 1.9.3, 2.0.0, 2.1, and 2.2. ## Version 2.3 From 19a3d2091d9ea9e9599c33423d1f2f06b09a01fc Mon Sep 17 00:00:00 2001 From: Dan Rice Date: Sat, 27 Dec 2014 18:11:11 -0500 Subject: [PATCH 2/4] Update cucumber --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b38a7a1a..7f11d7b7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -65,7 +65,7 @@ GEM execjs coffee-script-source (1.8.0) crass (0.2.1) - cucumber (1.3.17) + cucumber (1.3.18) builder (>= 2.1.2) diff-lcs (>= 1.1.3) gherkin (~> 2.12) From 0d6e0efcee6ac09d7d69e4533f20836a38120203 Mon Sep 17 00:00:00 2001 From: Matteo Giaccone Date: Thu, 1 Jan 2015 18:10:23 +0000 Subject: [PATCH 3/4] Fix warnings for Ruby 2.2 update --- Gemfile.lock | 2 +- app/models/recurring_todos/abstract_recurring_todos_builder.rb | 1 - test/models/recurring_todos/monthly_repeat_pattern_test.rb | 3 --- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7f11d7b7..20c266e9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -91,7 +91,7 @@ GEM gherkin (2.12.2) multi_json (~> 1.3) hike (1.2.3) - htmlentities (4.3.2) + htmlentities (4.3.3) i18n (0.6.11) jquery-rails (3.1.2) railties (>= 3.0, < 5.0) diff --git a/app/models/recurring_todos/abstract_recurring_todos_builder.rb b/app/models/recurring_todos/abstract_recurring_todos_builder.rb index 93a4bee7..4b4f78aa 100644 --- a/app/models/recurring_todos/abstract_recurring_todos_builder.rb +++ b/app/models/recurring_todos/abstract_recurring_todos_builder.rb @@ -77,7 +77,6 @@ module RecurringTodos end_date: attributes[:end_date], ends_on: attributes[:ends_on], number_of_occurences: attributes[:number_of_occurences], - target: attributes[:target], project: attributes[:project], context: attributes[:context], project_id: attributes[:project_id], diff --git a/test/models/recurring_todos/monthly_repeat_pattern_test.rb b/test/models/recurring_todos/monthly_repeat_pattern_test.rb index 67e28741..952ccfd6 100644 --- a/test/models/recurring_todos/monthly_repeat_pattern_test.rb +++ b/test/models/recurring_todos/monthly_repeat_pattern_test.rb @@ -14,7 +14,6 @@ module RecurringTodos builder = RecurringTodosBuilder.new(@admin, { 'recurring_period' => 'monthly', 'description' => 'a repeating todo', # generic - 'recurring_period' => 'monthly', 'recurring_target' => 'show_from_date', 'ends_on' => 'ends_on_end_date', 'end_date' => Time.zone.now + 1.week, @@ -44,7 +43,6 @@ module RecurringTodos builder = RecurringTodosBuilder.new(@admin, { 'recurring_period' => 'monthly', 'description' => 'a repeating todo', # generic - 'recurring_period' => 'monthly', 'recurring_target' => 'show_from_date', 'ends_on' => 'ends_on_end_date', 'end_date' => Time.zone.now + 1.week, @@ -64,7 +62,6 @@ module RecurringTodos builder = RecurringTodosBuilder.new(@admin, { 'recurring_period' => 'monthly', 'description' => 'a repeating todo', # generic - 'recurring_period' => 'monthly', 'recurring_target' => 'show_from_date', 'ends_on' => 'ends_on_end_date', 'end_date' => Time.zone.now + 1.week, From 7f1246f42f91c6c0884d7c70be24f9511d40892d Mon Sep 17 00:00:00 2001 From: Dan Rice Date: Sat, 3 Jan 2015 18:11:47 -0500 Subject: [PATCH 4/4] Make User.projects.actionize deterministic Add project.id to the comparison to ensure consistent order when counts are identical. --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index e5456c27..49bc4c2e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -62,7 +62,7 @@ class User < ActiveRecord::Base end def actionize(scope_conditions = {}) todos_in_project = where(scope_conditions).includes(:todos) - todos_in_project.to_a.sort!{ |x, y| -(x.todos.active.count <=> y.todos.active.count) } + todos_in_project.to_a.sort_by!{ |x| [-x.todos.active.count, -x.id] } todos_in_project.reject{ |p| p.todos.active.count > 0 } sorted_project_ids = todos_in_project.map {|p| p.id}