Mercurial > hg > soundsoftware-site
view vendor/plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb @ 934:1a46b2c6da28
Merge from branch "cannam"
author | Chris Cannam |
---|---|
date | Wed, 11 Jul 2012 13:30:20 +0100 |
parents | fbdfec975bfa |
children |
line wrap: on
line source
require_dependency 'project' module Bibliography module ProjectPublicationsPatch def self.included(base) base.class_eval do has_and_belongs_to_many :publications, :uniq => true named_scope :like, lambda {|q| s = "%#{q.to_s.strip.downcase}%" {:conditions => ["LOWER(name) LIKE :s OR LOWER(homepage) LIKE :s", {:s => s}], :order => 'name' } } end end #self.included module ProjectMethods end #ProjectMethods end #ProjectPublicationsPatch end #RedmineBibliography