annotate plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb @ 1157:13ab8b6e8132 redmine-2.2-integration

A couple of further html_safes
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Tue, 15 Jan 2013 15:55:45 +0000
parents 807426fa6017
children 29dd06e01be3
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@464 7 has_and_belongs_to_many :publications, :uniq => true
luis@1123 8
luis@1124 9 # todo: review usage of scope --lf.20130108
luis@1123 10 scope :like, lambda {|q|
luis@461 11 s = "%#{q.to_s.strip.downcase}%"
luis@462 12 {:conditions => ["LOWER(name) LIKE :s OR LOWER(homepage) LIKE :s", {:s => s}],
luis@461 13 :order => 'name'
luis@461 14 }
luis@461 15 }
luis@454 16 end
luis@461 17 end #self.included
luis@1123 18
luis@461 19 module ProjectMethods
luis@461 20
luis@461 21
luis@461 22
luis@1123 23
luis@461 24 end #ProjectMethods
luis@454 25 end #ProjectPublicationsPatch
luis@454 26 end #RedmineBibliography