Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Support/fix member addition #233

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def index
def create
@project = current_user.projects.find(params[:project_id])
@users = @project.users
@user = User.find_or_create_by_email(params[:user][:email]) do |u|
@user = User.find_or_create_by(email: params[:user][:email]) do |u|
# Set to true if the user was not found
u.was_created = true
u.name = params[:user][:name]
Expand Down
Binary file added app/models/.project.rb.swp
Binary file not shown.
4 changes: 2 additions & 2 deletions app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def from_csv(csv_string)
row_attrs = row.to_hash
story = create({
:state => row_attrs["Current State"].downcase,
:title => row_attrs["Story"],
:story_type => row_attrs["Story Type"].downcase,
:title => row_attrs["Title"] || row_attrs["Story"],
:story_type => (row_attrs["Type"] || row_attrs["Story Type"]).downcase,
:requested_by => users.detect {|u| u.name == row["Requested By"]},
:owned_by => users.detect {|u| u.name == row["Owned By"]},
:accepted_at => row_attrs["Accepted at"],
Expand Down