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 @ 723:d41bf754c0f2
History | View | Annotate | Download (623 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 | 464:fbdfec975bfa | luis | has_and_belongs_to_many :publications, :uniq => true |
| 8 | 461:841b2e40895d | luis | |
| 9 | named_scope :like, lambda {|q|
|
||
| 10 | s = "%#{q.to_s.strip.downcase}%"
|
||
| 11 | 462:b02b2eb2a312 | luis | {:conditions => ["LOWER(name) LIKE :s OR LOWER(homepage) LIKE :s", {:s => s}],
|
| 12 | 461:841b2e40895d | luis | :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 |