mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-09 17:14:20 +01:00
A few minor changes and bug fixes:
* On first user signup, the user no longer needs to login and after signing up. They are automatically logged in. * The Projects page was showing the name of the last project listed in the new project form. It is now appropriately blank. * When trying to create a new action, an error was occurring trying to update tags if the action failed to save. We now only try to update tags if the action saved. I wonder if we should be using some sort of ActiveRecord transaction here. If anyone knows about this, please contact me. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@481 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
38b2e336a8
commit
5a878b3e84
6 changed files with 11 additions and 5 deletions
|
|
@ -136,6 +136,7 @@ class ProjectsController < ApplicationController
|
|||
@active_projects = @projects.select{ |p| p.active? }
|
||||
@hidden_projects = @projects.select{ |p| p.hidden? }
|
||||
@completed_projects = @projects.select{ |p| p.completed? }
|
||||
@new_project = @user.projects.build
|
||||
render
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -65,8 +65,10 @@ class TodosController < ApplicationController
|
|||
end
|
||||
|
||||
@saved = @todo.save
|
||||
@todo.tag_with(params[:tag_list],@user)
|
||||
@todo.reload
|
||||
if @saved
|
||||
@todo.tag_with(params[:tag_list],@user)
|
||||
@todo.reload
|
||||
end
|
||||
|
||||
respond_to do |wants|
|
||||
wants.html { redirect_to :action => "index" }
|
||||
|
|
|
|||
|
|
@ -80,11 +80,13 @@ class UsersController < ApplicationController
|
|||
return
|
||||
end
|
||||
|
||||
user.is_admin = true if User.no_users_yet?
|
||||
first_user_signing_up = User.no_users_yet?
|
||||
user.is_admin = true if first_user_signing_up
|
||||
if user.save
|
||||
@user = User.authenticate(user.login, params['user']['password'])
|
||||
@user.create_preference
|
||||
@user.save
|
||||
session['user_id'] = @user.id if first_user_signing_up
|
||||
notify :notice, "Signup successful for user #{@user.login}."
|
||||
redirect_back_or_home
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue