Refactoring of message system.
This commit is contained in:
parent
a0e10141dc
commit
3ea8d5a2ef
21 changed files with 94 additions and 113 deletions
|
|
@ -8,7 +8,7 @@ class HomeController < ApplicationController
|
|||
@unaccepted_tasks = @current_user.unaccepted_tasks
|
||||
# task in next week
|
||||
@next_tasks = @current_user.next_tasks
|
||||
@messages = Message.user.find :all, :limit => 5
|
||||
@messages = Message.all :order => 'created_at DESC', :limit => 5
|
||||
# count tasks with no responsible person
|
||||
# tasks for groups the current user is not a member are ignored
|
||||
tasks = Task.find(:all, :conditions => ["assigned = ? and done = ?", false, false])
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class LoginController < ApplicationController
|
|||
user.reset_password_token = user.new_random_password(16)
|
||||
user.reset_password_expires = Time.now.advance(:days => 2)
|
||||
if user.save
|
||||
email = Mailer.deliver_password(user)
|
||||
email = Mailer.deliver_reset_password(user)
|
||||
logger.debug("Sent password reset email to #{user.email}.")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ class MessagesController < ApplicationController
|
|||
|
||||
# Renders the "inbox" action.
|
||||
def index
|
||||
@messages = Message.user
|
||||
@messages = Message.all :order => 'created_at DESC', :limit => 100
|
||||
end
|
||||
|
||||
# Creates a new message object.
|
||||
|
|
@ -21,7 +21,6 @@ class MessagesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
# Shows a single message.
|
||||
def show
|
||||
@message = Message.find(params[:id])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue