Skip to content

Commit

Permalink
Fill the name of an user with its login if blank
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed May 12, 2011
1 parent 654789f commit f2d4cfa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def login
account ? account.login : name
end

def name=(name)
super name.present? ? name : account.login
end

### Sphinx ####

# TODO Thinking Sphinx
Expand Down

0 comments on commit f2d4cfa

Please sign in to comment.