Class: Pageflow::EditLocksController

Inherits:
ApplicationController show all
Defined in:
app/controllers/pageflow/edit_locks_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
15
# File 'app/controllers/pageflow/edit_locks_controller.rb', line 7

def create
  entry = Entry.find(params[:entry_id])
  authorize!(:edit, entry)
  entry.edit_lock.acquire(current_user, edit_lock_params)

  entry.snapshot(creator: current_user) unless entry.feature_state('no_edit_lock_snapshot')

  respond_with(entry.reload.edit_lock, :location => entry_edit_lock_url(entry))
end

#destroyObject



24
25
26
27
28
# File 'app/controllers/pageflow/edit_locks_controller.rb', line 24

def destroy
  entry = Entry.find(params[:entry_id])
  entry.edit_lock.release(current_user)
  head :no_content
end

#updateObject



17
18
19
20
21
22
# File 'app/controllers/pageflow/edit_locks_controller.rb', line 17

def update
  entry = Entry.find(params[:entry_id])
  authorize!(:edit, entry)
  entry.edit_lock.acquire(current_user, edit_lock_params)
  head :no_content
end