[phase-13]add glossary_term to activity
This commit is contained in:
parent
4acdaedb81
commit
1292a94881
@ -4,6 +4,21 @@ class GlossaryTerm < ActiveRecord::Base
|
||||
|
||||
# class method from Redmine::Acts::Attachable::ClassMethods
|
||||
acts_as_attachable view_permission: :view_glossary, edit_permission: :manage_glossary, delete_permission: :manage_glossary
|
||||
|
||||
acts_as_event datetime: :updated_at,
|
||||
description: :description,
|
||||
author: nil,
|
||||
title: Proc.new {|o| "#{l(:glossary_title)} ##{o.id} - #{o.name}" },
|
||||
url: Proc.new {|o| { controller: 'glossary_terms',
|
||||
action: 'show',
|
||||
id: o.id,
|
||||
project_id: o.project }
|
||||
}
|
||||
|
||||
acts_as_activity_provider scope: joins(:project),
|
||||
type: 'glossary_terms',
|
||||
permission: :view_glossary,
|
||||
timestamp: :updated_at
|
||||
|
||||
scope :search_by_name, -> (keyword) {
|
||||
where 'name like ?', "#{sanitize_sql_like(keyword)}%"
|
||||
|
7
init.rb
7
init.rb
@ -1,3 +1,7 @@
|
||||
#Rails.configuration.to_prepare do
|
||||
# Redmine::Activity.register :glossary_terms
|
||||
#end
|
||||
|
||||
Redmine::Plugin.register :redmine_glossary do
|
||||
name 'Redmine Glossary plugin'
|
||||
author 'Toru Takahashi'
|
||||
@ -26,3 +30,6 @@ Redmine::Plugin.register :redmine_glossary do
|
||||
param: :project_id
|
||||
|
||||
end
|
||||
|
||||
|
||||
Redmine::Activity.register :glossary_terms
|
||||
|
Loading…
Reference in New Issue
Block a user