Mercurial > hg > soundsoftware-site
annotate vendor/plugins/redmine_bibliography/app/models/author.rb @ 696:a0e028d6060a luisf
The booktitle string was missing from the all_fields class variable (BibtexEntryType class); fixes Bug #297.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Mon, 19 Sep 2011 12:48:52 +0100 |
parents | 7097dc91e58e |
children | a0c9cc95bcf3 |
rev | line source |
---|---|
luis@328 | 1 class Author < ActiveRecord::Base |
luis@468 | 2 has_many :authorships, :dependent => :destroy |
luis@328 | 3 has_many :publications, :through => :authorships |
luis@403 | 4 |
luis@466 | 5 belongs_to :user |
luis@478 | 6 |
luis@478 | 7 def <=>(author) |
luis@478 | 8 name.downcase <=> author.name.downcase |
luis@478 | 9 end |
luis@403 | 10 |
luis@477 | 11 named_scope :like, lambda {|q| |
luis@477 | 12 s = "%#{q.to_s.strip.downcase}%" |
luis@477 | 13 {:conditions => ["LOWER(name) LIKE :s", {:s => s}], |
luis@477 | 14 :order => 'name' |
luis@477 | 15 } |
luis@478 | 16 } |
luis@478 | 17 |
luis@328 | 18 end |