mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 04:51:14 +00:00
e59e8ac8e7
- Add .params to models and update controllers - Add afk time to gather - Reannotate models - Fix rspec problem by using latest rspec plugins from github
22 lines
473 B
Ruby
22 lines
473 B
Ruby
class LocksController < ApplicationController
|
|
def create
|
|
@lock = Lock.new(Lock.params(params, cuser))
|
|
raise AccessError unless @lock.can_create? cuser
|
|
|
|
if @lock.save
|
|
flash[:notice] = t(:topics_locked)
|
|
else
|
|
flash[:error] = @lock.errors.full_messages.to_s
|
|
end
|
|
|
|
redirect_to_back
|
|
end
|
|
|
|
def destroy
|
|
@lock = Lock.find params[:id]
|
|
raise AccessError unless @lock.can_destroy? cuser
|
|
|
|
@lock.destroy
|
|
redirect_to_back
|
|
end
|
|
end
|