Skip to content

Commit

Permalink
Use QueryFilter instead of Hash to support redmine 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
codeout committed Dec 28, 2017
1 parent ccd3bf2 commit 7c0caa1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/already_read/issue_query_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ def available_filters_with_already_read
available_filters_without_already_read

if !has_filter?('already_read')
@available_filters['already_read'] = {:type => :list, :order => 20, :values => @available_filters['author_id'][:values], :name => l(:field_already_read)}
if Redmine::VERSION.to_a[0] >= 3 && Redmine::VERSION.to_a[1] >= 4 # newer or equal to 3.4.0
@available_filters['already_read'] = QueryFilter.new(
'already_read',
type: :list,
order: 20,
values: @available_filters['author_id'][:values],
name: l(:field_already_read)
)
else
@available_filters['already_read'] = {:type => :list, :order => 20, :values => @available_filters['author_id'][:values], :name => l(:field_already_read)}
end
end

return @available_filters
Expand Down

0 comments on commit 7c0caa1

Please sign in to comment.