Skip to content

Commit

Permalink
wip - calculating @all_contributors when displaying all ICLA signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
nellshamrell committed Feb 9, 2016
1 parent 6823998 commit 3543230
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/controllers/concerns/contributor_searching.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def search_contributors(search_term)
def all_contributors(search_term)
# Finds the intersection between the users returned by the search
# and the list of users who are authorized contributors
if search_term.empty?
if search_term.present?
User.search(search_term) & User.authorized_contributors
else
User.authorized_contributors
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/contributors_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ContributorsController < ApplicationController
before_filter :find_contributor, only: [:update, :destroy]
include ContributorSearching
before_filter :find_contributor, only: [:update, :destroy]

#
# PATCH /organizations/:organization_id/contributors/:id
Expand Down Expand Up @@ -43,7 +43,6 @@ def become_a_contributor
# Display all of the users who are authorized to contribute
#
def index
puts "FIRING"
search_contributors(params[:contributors_q])

# @all_contributors is set in ContributorSearching#search_contributors
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/icla_signatures_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class IclaSignaturesController < ApplicationController
include ContributorSearching
before_filter :redirect_if_signed!, only: [:new, :create]
before_filter :authenticate_user!, except: [:index, :agreement]
before_filter :require_linked_github_account!, only: [:new, :create, :re_sign]
Expand All @@ -9,6 +10,7 @@ class IclaSignaturesController < ApplicationController
# Displays a list of all users who have a signed ICLA.
#
def index
search_contributors(params[:contributors_q])
@icla_signatures = IclaSignature.by_user.page(params[:page]).per(50)
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/contributors/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</tbody>
</table>

<%= paginate @contributors %>
<%= paginate @all_contributors %>
</div>
</div>
</div>
Expand Down

0 comments on commit 3543230

Please sign in to comment.