Don't instantiate objects in tag_string
This commit is contained in:
parent
0ac28cd9ea
commit
efd6275e68
1 changed files with 6 additions and 1 deletions
|
|
@ -112,7 +112,12 @@ class Profile < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def tag_string
|
||||
@tag_string || self.tags.map{|t| '#' << t.to_s }.join(' ')
|
||||
if @tag_string
|
||||
@tag_string
|
||||
else
|
||||
rows = connection.select_rows( self.tags.scoped.to_sql )
|
||||
rows.inject(""){|string, row| string << "##{row[1]} " }
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
|
|
|||
Loading…
Reference in a new issue