To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / vendor / plugins / redmine_bibliography / lib / bibliography / project_publications_patch.rb @ 461:841b2e40895d

History | View | Annotate | Download (638 Bytes)

1 454:2f1a308c4c11 luis
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
8 461:841b2e40895d luis
9
            named_scope :like, lambda {|q|
10
              s = "%#{q.to_s.strip.downcase}%"
11
              {:conditions => ["LOWER(name) LIKE :s OR LOWER(description) LIKE :s OR LOWER(homepage) LIKE :s", {:s => s}],
12
               :order => 'name'
13
              }
14
            }
15 454:2f1a308c4c11 luis
          end
16 461:841b2e40895d luis
    end #self.included
17
18
    module ProjectMethods
19
20
21
22
23
    end #ProjectMethods
24 454:2f1a308c4c11 luis
  end #ProjectPublicationsPatch
25
end #RedmineBibliography