comparison plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb @ 1484:51364c0cd58f redmine-2.4-integration

Merge from live branch. Still need to merge manually in files overridden by plugins.
author Chris Cannam
date Wed, 15 Jan 2014 09:59:14 +0000
parents 29dd06e01be3
children
comparison
equal deleted inserted replaced
1464:261b3d9a4903 1484:51364c0cd58f
1 require_dependency 'project'
2
3 module Bibliography
4 module ProjectPublicationsPatch
5 def self.included(base)
6 base.class_eval do
7 has_and_belongs_to_many :publications, :uniq => true
8
9 scope :name_or_homepage_like, lambda {|q|
10 s = "%#{q.to_s.strip.downcase}%"
11 {:conditions => ["LOWER(name) LIKE :s OR LOWER(homepage) LIKE :s", {:s => s}],
12 :order => 'name'
13 }
14 }
15 end
16 end #self.included
17
18 module ProjectMethods
19
20
21
22
23 end #ProjectMethods
24 end #ProjectPublicationsPatch
25 end #RedmineBibliography