Index: config/locales/en.yml =================================================================== --- config/locales/en.yml (revision 3358) +++ config/locales/en.yml (working copy) @@ -276,6 +276,7 @@ field_content: Content field_group_by: Group results by field_sharing: Sharing + field_relations_from: Duplicated by setting_app_title: Application title setting_app_subtitle: Application subtitle Index: app/models/query.rb =================================================================== --- app/models/query.rb (revision 3358) +++ app/models/query.rb (working copy) @@ -195,7 +195,9 @@ if User.current.logged? @available_filters["watcher_id"] = { :type => :list, :order => 15, :values => [["<< #{l(:label_me)} >>", "me"]] } end - + # filter out duplicates + @available_filters["relations_from"] = { :type => :list, :order => 14, :values => [ ["none", "none"] ] } + if project # project specific filters unless @project.issue_categories.empty? @@ -395,6 +397,11 @@ db_field = 'user_id' sql << "#{Issue.table_name}.id #{ operator == '=' ? 'IN' : 'NOT IN' } (SELECT #{db_table}.watchable_id FROM #{db_table} WHERE #{db_table}.watchable_type='Issue' AND " sql << sql_for_field(field, '=', v, db_table, db_field) + ')' + elsif field == 'relations_from' + # filter out duplicates + db_table = IssueRelation.table_name + db_field = 'issue_from_id' + sql << "#{Issue.table_name}.id NOT IN (SELECT #{db_table}.issue_from_id from #{db_table} where relation_type='duplicates')" else # regular field db_table = Issue.table_name