diff plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb @ 1484:51364c0cd58f redmine-2.4-integration

Merge from live branch. Still need to merge manually in files overridden by plugins.
author Chris Cannam
date Wed, 15 Jan 2014 09:59:14 +0000
parents 29dd06e01be3
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb	Wed Jan 15 09:59:14 2014 +0000
@@ -0,0 +1,25 @@
+require_dependency 'project'
+
+module Bibliography
+  module ProjectPublicationsPatch
+    def self.included(base)
+          base.class_eval do
+            has_and_belongs_to_many :publications, :uniq => true
+
+            scope :name_or_homepage_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
\ No newline at end of file