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

Adding other projects to publication - created query for projects and controller actions to be used in the AJAX call; still need to get the AJAX call working
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Fri, 17 Jun 2011 18:59:49 +0100
parents 2f1a308c4c11
children b02b2eb2a312
rev   line source
luis@454 1 require_dependency 'project'
luis@454 2
luis@454 3 module Bibliography
luis@454 4 module ProjectPublicationsPatch
luis@454 5 def self.included(base)
luis@454 6 base.class_eval do
luis@454 7 has_and_belongs_to_many :publications
luis@461 8
luis@461 9 named_scope :like, lambda {|q|
luis@461 10 s = "%#{q.to_s.strip.downcase}%"
luis@461 11 {:conditions => ["LOWER(name) LIKE :s OR LOWER(description) LIKE :s OR LOWER(homepage) LIKE :s", {:s => s}],
luis@461 12 :order => 'name'
luis@461 13 }
luis@461 14 }
luis@454 15 end
luis@461 16 end #self.included
luis@461 17
luis@461 18 module ProjectMethods
luis@461 19
luis@461 20
luis@461 21
luis@461 22
luis@461 23 end #ProjectMethods
luis@454 24 end #ProjectPublicationsPatch
luis@454 25 end #RedmineBibliography