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
|
def url
|
||||||
begin
|
begin
|
||||||
uri = URI.parse(@attributes['url'])
|
uri = URI.parse(self[:url])
|
||||||
url = "#{uri.scheme}://#{uri.host}"
|
url = "#{uri.scheme}://#{uri.host}"
|
||||||
url += ":#{uri.port}" unless ["80", "443"].include?(uri.port.to_s)
|
url += ":#{uri.port}" unless ["80", "443"].include?(uri.port.to_s)
|
||||||
url += "/"
|
url += "/"
|
||||||
rescue => e
|
rescue => e
|
||||||
url = @attributes['url']
|
url = self[:url]
|
||||||
end
|
end
|
||||||
url
|
url
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue