Sha256: 050790fec3d9fe19a6cad4aacbd52b20703700198483dc02bfd263c945b63e09

Contents?: true

Size: 880 Bytes

Versions: 25

Compression:

Stored size: 880 Bytes

Contents

module Pageflow
  class EditLocksController < Pageflow::ApplicationController
    before_filter :authenticate_user!

    respond_to :json

    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)
      respond_with(entry.reload.edit_lock, :location => entry_edit_lock_url(entry))
    end

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

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

    protected

    def edit_lock_params
      params.permit(:edit_lock => [:force, :id]).fetch(:edit_lock, {})
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
pageflow-12.6.0 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.5.0 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.4.1 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.4.0 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.3.0 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.2.0 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.1.0 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.0.4 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.0.3 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.0.2 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.0.1 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.0.0 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.0.0.rc7 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.0.0.rc6 app/controllers/pageflow/edit_locks_controller.rb
pageflow-0.11.4 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.0.0.rc5 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.0.0.rc4 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.0.0.rc3 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.0.0.rc2 app/controllers/pageflow/edit_locks_controller.rb
pageflow-12.0.0.rc1 app/controllers/pageflow/edit_locks_controller.rb