Don't use AR internals (@attributes)
This commit is contained in:
parent
3a8302ff7f
commit
9ad2409264
1 changed files with 2 additions and 2 deletions
|
|
@ -201,12 +201,12 @@ class Person < ActiveRecord::Base
|
|||
|
||||
def url
|
||||
begin
|
||||
uri = URI.parse(@attributes['url'])
|
||||
uri = URI.parse(self[:url])
|
||||
url = "#{uri.scheme}://#{uri.host}"
|
||||
url += ":#{uri.port}" unless ["80", "443"].include?(uri.port.to_s)
|
||||
url += "/"
|
||||
rescue => e
|
||||
url = @attributes['url']
|
||||
url = self[:url]
|
||||
end
|
||||
url
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue