To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / vendor / plugins / redmine_bibliography / lib / bibliography / project_publications_patch.rb @ 1077:9b5b4e7970cd
History | View | Annotate | Download (623 Bytes)
| 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 |
named_scope :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 |