diff options
Diffstat (limited to 'app/models/public_body.rb')
-rw-r--r-- | app/models/public_body.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 9c4956b68..546de2c40 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -21,7 +21,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: public_body.rb,v 1.22 2008-02-27 12:04:10 francis Exp $ +# $Id: public_body.rb,v 1.23 2008-02-27 12:18:28 francis Exp $ class PublicBody < ActiveRecord::Base validates_presence_of :name @@ -50,14 +50,14 @@ class PublicBody < ActiveRecord::Base # When name or short name is changed, also change the url name def short_name=(short_name) write_attribute(:short_name, short_name) - update_url_name + self.update_url_name end def name=(name) write_attribute(:name, name) - update_url_name + self.update_url_name end def update_url_name - url_name = MySociety::Format.simplify_url_part(short_or_long_name) + url_name = MySociety::Format.simplify_url_part(self.short_or_long_name) write_attribute(:url_name, url_name) end # Return the short name if present, or else long name |