diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6c63858ce..9cbf813e7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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 diff --git a/app/models/notification.rb b/app/models/notification.rb index 7a9684a88..439b1fe80 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -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