Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bugfix: taking requester out of cc list now works

  • Loading branch information...
commit 3da9d2b45d2968b3346436ad9c7e542601545efd 1 parent 3ba48fd
@benilovj benilovj authored
View
6 app/models/shared/requester.rb
@@ -16,13 +16,11 @@ def email=(new_email)
end
def collaborator_emails
- @collaborator_emails || []
+ (@collaborator_emails || []).reject { |collab| collab == email }
end
def collaborator_emails=(emails_as_string)
- collaborator_emails = emails_as_string.split(",").collect(&:strip)
- filtered_collaborators = collaborator_emails.reject { |collab| collab == email }
- @collaborator_emails = filtered_collaborators
+ @collaborator_emails = emails_as_string.split(",").collect(&:strip)
end
def collaborator_emails_are_all_valid
View
3  test/unit/models/requester_test.rb
@@ -29,7 +29,8 @@ class RequesterTest < Test::Unit::TestCase
end
should "remove the requester from the collaborators (as Zendesk doesn't allow this)" do
- requester = Requester.new(email: "requester@x.com", collaborator_emails: "a@b.com, requester@x.com, c@d.com")
+ requester = Requester.new(collaborator_emails: "a@b.com, requester@x.com, c@d.com")
+ requester.email = "requester@x.com"
assert_equal ["a@b.com", "c@d.com"], requester.collaborator_emails
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.