Is there any short arm for
@notifications = Notification.find(:all, :conditions => ['expires_at > ?', Time.now])
notif = Notification.find(:all, cookie[0].to_i)
@notifications.delete(notif[0]) if not notif.empty?
cookie is the identifier of the notification stored in cookies. it is in an iteration that removes notifications that the user does not want to see.
thank! =)
source
share