# HG changeset patch # User luisf # Date 1357662125 0 # Node ID 807426fa6017cfac9f0de9110415a3cd45e3c1d1 # Parent 48c5fdd6cf106f4531496d388158e91b5eb9dc27 Added debug/todo comments to previous commits changes. diff -r 48c5fdd6cf10 -r 807426fa6017 plugins/redmine_bibliography/app/models/author.rb --- a/plugins/redmine_bibliography/app/models/author.rb Tue Jan 08 16:19:01 2013 +0000 +++ b/plugins/redmine_bibliography/app/models/author.rb Tue Jan 08 16:22:05 2013 +0000 @@ -10,6 +10,7 @@ name.downcase <=> author.name.downcase end + # todo: review usage of scope --lf.20130108 scope :like, lambda {|q| s = "%#{q.to_s.strip.downcase}%" {:conditions => ["LOWER(name) LIKE :s", {:s => s}], diff -r 48c5fdd6cf10 -r 807426fa6017 plugins/redmine_bibliography/app/models/authorship.rb --- a/plugins/redmine_bibliography/app/models/authorship.rb Tue Jan 08 16:19:01 2013 +0000 +++ b/plugins/redmine_bibliography/app/models/authorship.rb Tue Jan 08 16:22:05 2013 +0000 @@ -12,6 +12,7 @@ attr_accessor :is_user, :author_user_id, :search_name, :identify_author, :search_results before_save :associate_author_user + # todo: review usage of scope --lf.20130108 scope :like_unique, lambda {|q| s = "%#{q.to_s.strip.downcase}%" {:conditions => ["LOWER(name_on_paper) LIKE :s OR LOWER(email) LIKE :s", {:s => s}], @@ -20,6 +21,7 @@ } } + # todo: review usage of scope --lf.20130108 scope :like, lambda {|q| s = "%#{q.to_s.strip.downcase}%" {:conditions => ["LOWER(name_on_paper) LIKE :s OR LOWER(email) LIKE :s", {:s => s}], diff -r 48c5fdd6cf10 -r 807426fa6017 plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb --- a/plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb Tue Jan 08 16:19:01 2013 +0000 +++ b/plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb Tue Jan 08 16:22:05 2013 +0000 @@ -6,6 +6,7 @@ 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}],