Request activation if is_active==false but no user agreements seem to
[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
5   def model_class
6     Collection
7   end
8
9   def sign
10     params[:checked].each do |checked|
11       if r = checked.match(/^([0-9a-f]+)/)
12         UserAgreement.sign uuid: r[1]
13       end
14     end
15     current_user.activate
16     redirect_to(params[:return_to] || :back)
17   end
18 end