~vcs-imports/norfellocmms/trunk

« back to all changes in this revision

Viewing changes to app/models/user_account.rb

  • Committer: markku
  • Date: 2008-03-11 17:08:29 UTC
  • Revision ID: vcs-imports@canonical.com-20080311170829-xy6lhf6fs96xv1ab
Closes #433. Ordering of users respects the name option in all views. 
There are 8 name format options and adding new ones takes only two simple lines of code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
    self.find(:all, options)
91
91
  end
92
92
 
93
 
  # Method; login_and_name
94
 
  # ======================
95
 
  # Retuns:
96
 
  # -------
97
 
  # Login and name in format "login (name)"
 
93
  # Method: UserAccount.order_sql
 
94
  # =============================
 
95
  # Returns the ordering SQL clause for the model.
98
96
  #
99
 
  def login_and_name
100
 
    unless self.name == ''
101
 
      self.login + ' (' + self.name + ')'
102
 
    else
103
 
      self.login
104
 
    end
 
97
  def UserAccount.order_sql
 
98
    raise NotImplementedError
105
99
  end
106
100
 
107
101
  # Method; name