summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-10-16 00:00:23 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-10-16 00:00:23 +0000
commitfef21d5aa2d6108f39aa015ca29da31d888db026 (patch)
treef7a6cd705a67bf6679449a8b2915b52dcbfcaf8a
parentce99f3247fba90c1d87fceb64fa2f9385c6f4c26 (diff)
downloadredmine-fef21d5aa2d6108f39aa015ca29da31d888db026.tar.gz
redmine-fef21d5aa2d6108f39aa015ca29da31d888db026.zip
Remember the selected "Member of Role" and "Member of Group" options. #6467
Contributed by Yuki Kita git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4260 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/query.rb4
-rw-r--r--test/unit/query_test.rb14
2 files changed, 9 insertions, 9 deletions
diff --git a/app/models/query.rb b/app/models/query.rb
index 59131afcd..638cc8226 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -196,10 +196,10 @@ class Query < ActiveRecord::Base
@available_filters["assigned_to_id"] = { :type => :list_optional, :order => 4, :values => user_values } unless user_values.empty?
@available_filters["author_id"] = { :type => :list, :order => 5, :values => user_values } unless user_values.empty?
- group_values = Group.all.collect {|g| [g.name, g.id] }
+ group_values = Group.all.collect {|g| [g.name, g.id.to_s] }
@available_filters["member_of_group"] = { :type => :list_optional, :order => 6, :values => group_values } unless group_values.empty?
- role_values = Role.givable.collect {|r| [r.name, r.id] }
+ role_values = Role.givable.collect {|r| [r.name, r.id.to_s] }
@available_filters["assigned_to_role"] = { :type => :list_optional, :order => 7, :values => role_values } unless role_values.empty?
if User.current.logged?
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb
index db6173bae..85bf9b173 100644
--- a/test/unit/query_test.rb
+++ b/test/unit/query_test.rb
@@ -397,8 +397,8 @@ class QueryTest < ActiveSupport::TestCase
group2 = Group.generate!.reload
expected_group_list = [
- [group1.name, group1.id],
- [group2.name, group2.id]
+ [group1.name, group1.id.to_s],
+ [group2.name, group2.id.to_s]
]
assert_equal expected_group_list.sort, @query.available_filters["member_of_group"][:values].sort
end
@@ -415,14 +415,14 @@ class QueryTest < ActiveSupport::TestCase
end
should "have a list of the Roles as values" do
- assert @query.available_filters["assigned_to_role"][:values].include?(['Manager',1])
- assert @query.available_filters["assigned_to_role"][:values].include?(['Developer',2])
- assert @query.available_filters["assigned_to_role"][:values].include?(['Reporter',3])
+ assert @query.available_filters["assigned_to_role"][:values].include?(['Manager','1'])
+ assert @query.available_filters["assigned_to_role"][:values].include?(['Developer','2'])
+ assert @query.available_filters["assigned_to_role"][:values].include?(['Reporter','3'])
end
should "not include the built in Roles as values" do
- assert ! @query.available_filters["assigned_to_role"][:values].include?(['Non member',4])
- assert ! @query.available_filters["assigned_to_role"][:values].include?(['Anonymous',5])
+ assert ! @query.available_filters["assigned_to_role"][:values].include?(['Non member','4'])
+ assert ! @query.available_filters["assigned_to_role"][:values].include?(['Anonymous','5'])
end
end