Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

removing the requester email from collaborators #50

Merged
merged 1 commit into from

2 participants

@benilovj
Owner

Zendesk does not allow for the requester email to be within the list
of collaborators. This change takes the requester out of the collabs
if set.

@benilovj benilovj removing the requester email from collaborators
Zendesk does not allow for the requester email to be within the list
of collaborators. This change takes the requester out of the collabs
if set.
bdaa875
@JordanHatch JordanHatch merged commit 4f35a51 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 13, 2013
  1. @benilovj

    removing the requester email from collaborators

    benilovj authored
    Zendesk does not allow for the requester email to be within the list
    of collaborators. This change takes the requester out of the collabs
    if set.
This page is out of date. Refresh to see the latest.
View
4 app/models/shared/requester.rb
@@ -18,7 +18,9 @@ def collaborator_emails
end
def collaborator_emails=(emails_as_string)
- @collaborator_emails = emails_as_string.split(",").collect(&:strip)
+ collaborator_emails = emails_as_string.split(",").collect(&:strip)
+ filtered_collaborators = collaborator_emails.reject { |collab| collab == email }
+ @collaborator_emails = filtered_collaborators
end
def collaborator_emails_are_all_valid
View
5 test/unit/models/requester_test.rb
@@ -25,4 +25,9 @@ class RequesterTest < Test::Unit::TestCase
should "have an empty list of collaborator emails if not set" do
assert_equal [], Requester.new.collaborator_emails
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")
+ assert_equal ["a@b.com", "c@d.com"], requester.collaborator_emails
+ end
end
Something went wrong with that request. Please try again.