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