view plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb @ 1155:a34a06ba1e33 redmine-2.2-integration

Provide a JS callback which should (?) be rendered by toggle_active ajax call
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Tue, 15 Jan 2013 15:48:21 +0000
parents 807426fa6017
children 29dd06e01be3
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

            # todo: review usage of scope --lf.20130108
            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