Skip to content

Commit

Permalink
2.3のクエリの実装変更に仮対応
Browse files Browse the repository at this point in the history
  • Loading branch information
ameya86 committed Jun 18, 2014
1 parent a8d1a78 commit ea67261
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
7 changes: 7 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
チケットの既読/未読を管理し、チケット一覧に「既読」「読んだ日時」列を追加します。
チケットを更新すると、そのチケットは未読チケットに戻ります。

Redmine2.5.1で簡単な動作確認したのみ。


== インストール

Expand Down Expand Up @@ -35,6 +37,11 @@

== 更新履歴

=== Version 0.0.4

2.3のクエリの実装変更に仮対応。


=== Version 0.0.3

"活動"にチケットを読んだことが残るようにしました。
Expand Down
4 changes: 2 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
require 'already_read/issue_patch'
require 'already_read/issues_controller_patch'
require 'already_read/user_patch'
require 'already_read/query_patch'
require 'already_read/issue_query_patch'

Redmine::Plugin.register :redmine_already_read do
name 'Redmine Already Read plugin'
author 'OZAWA Yasuhiro'
description 'Markup read issues.'
version '0.0.3'
version '0.0.4'
url 'https://github.com/ameya86/redmine_already_read'
author_url 'http://blog.livedoor.jp/ameya86/'

Expand Down
11 changes: 6 additions & 5 deletions lib/already_read/issue_query_patch.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
require_dependency 'query'
require_dependency 'issue_query'

Query.add_available_column(QueryColumn.new(:already_read))
Query.add_available_column(QueryColumn.new(:already_read_date))
IssueQuery.add_available_column(QueryColumn.new(:already_read))
IssueQuery.add_available_column(QueryColumn.new(:already_read_date))

module AlreadyReadQueryPatch
module AlreadyReadIssueQueryPatch
def self.included(base) # :nodoc:
base.send(:include, InstanceMethods) # obj.method

Expand All @@ -27,7 +28,7 @@ def available_filters_with_already_read
end
end

class Query < ActiveRecord::Base
class IssueQuery < Query
# 既読/未読検出のSQL
def sql_for_already_read_field(field, operator, value)
db_table = AlreadyRead.table_name
Expand All @@ -47,4 +48,4 @@ def sql_for_already_read_field(field, operator, value)
end
end

Query.send(:include, AlreadyReadQueryPatch)
IssueQuery.send(:include, AlreadyReadIssueQueryPatch)

0 comments on commit ea67261

Please sign in to comment.