make Notification.for return a query, not evaluate.. also limit notifications pulled back to 25
This commit is contained in:
parent
6101f57d62
commit
20ca2e2e93
2 changed files with 2 additions and 2 deletions
|
|
@ -17,7 +17,7 @@ class ApplicationController < ActionController::Base
|
|||
@aspect = nil
|
||||
@aspects = current_user.aspects.fields(:name)
|
||||
@aspects_dropdown_array = @aspects.collect{|x| [x.to_s, x.id]}
|
||||
@notifications = Notification.for(current_user)
|
||||
@notifications = Notification.for(current_user).limit(25).all
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,6 @@ class Notification
|
|||
attr_accessible :object_id, :kind, :user_id, :person_id
|
||||
|
||||
def self.for(user, opts={})
|
||||
self.all(opts.merge(:user_id => user.id))
|
||||
self.where(opts.merge(:user_id => user.id))
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue