closes # 9426
[arvados.git] / apps / workbench / app / controllers / user_agreements_controller.rb
1 class UserAgreementsController < ApplicationController
2   skip_before_filter :check_user_agreements
3   skip_before_filter :find_object_by_uuid
4   skip_before_filter :check_user_profile
5
6   def index
7     if unsigned_user_agreements.empty?
8       redirect_to(params[:return_to] || :back)
9     end
10   end
11
12   def model_class
13     Collection
14   end
15
16   def sign
17     params[:checked].each do |checked|
18       if (r = CollectionsHelper.match_uuid_with_optional_filepath(checked))
19         UserAgreement.sign uuid: r[1]
20       end
21     end
22     current_user.activate
23     redirect_to(params[:return_to] || :back)
24   end
25 end