app/models/badge.rb
# Give rank to sash if it's greater. Delete lower ranks it may have.
Give rank to sash if it's greater. Delete lower ranks it may have.
Give rank to sash if it ' s greater . Delete lower ranks it may have .
def grant_rank_to(sash)
    if sash.has_lower_rank_than(self)
      sash.badges -= Badge.where(:name => name) 
      sash.badges << self
      sash.save
    end
  end
def grant_rank_to ( sash ) if sash . has_lower_rank_than ( self ) sash . badges -= Badge . where ( :name => name ) sash . badges << self sash . save end end
Give rank to sash if it's greater.
Give rank to sash if it ' s greater .
# Grant to sash if had lower rank. Do nothing if has same or greater rank. # Clean up old ranks
sash
<not_specific>